#pragma once

#include <eedb/data/User.hpp>

namespace eedb {

class Users {
  protected:
    template < typename T >
    using unique_ptr = std::unique_ptr< T >;
    template < typename T >
    using shared_ptr = std::shared_ptr< T >;

    using string_view = std::experimental::string_view;
    using string      = std::string;

    using AuthToken = string_view;

  public:
    virtual ~Users() = default;

    virtual shared_ptr< User > findWith(int) const                       = 0;
    virtual shared_ptr< User > findWith(const AuthIdentity & name) const = 0;
    virtual shared_ptr< User > findWith(const Email & email) const       = 0;
    virtual shared_ptr< User > findWith(const AuthToken & token) const   = 0;

    // adds new user into users
    virtual shared_ptr< User > addUser(unique_ptr< AuthIdentity >) = 0;
};
}
