#pragma once

#include <eedb/data/IUser.hpp>

namespace eedb {

class IUserRepository {
    template < typename T >
    using optional    = std::experimental::optional< T >;
    using string      = std::string;
    using string_view = std::experimental::string_view;

    using Email = std::weak_ptr< Email >;
    using User  = std::weak_ptr< User >;

  public:
    virtual ~IUserRepository() = default;

    virtual optional< User > readByUid(int) const           = 0;
    virtual optional< User > readByName(string_view) const  = 0;
    virtual optional< User > readByEmail(const Email) const = 0;
    virtual optional< User > readByToken(string_view) const = 0;

    virtual void update(User);

    virtual void create(User);

    virtual void remove(User);
};
}
