BareGit
#pragma once

#include <cstdint>
#include <string>

#include <mw/error.hpp>

#include "data.h"

/// Own username onboarding, username changes, and creator promotion.
class UserService
{
public:
    /// Construct a service over the application persistence boundary.
    explicit UserService(DataSourceInterface& data_source);

    /// Set or change one user's validated Unicode username.
    mw::E<User> setUsername(
        std::int64_t user_id, const std::string& submitted_username);

    /// Permanently promote one player after re-reading the administrator.
    mw::E<User> promote(
        std::int64_t administrator_user_id,
        std::int64_t target_user_id);

private:
    DataSourceInterface& data_source_;
};