using Ablera.Serdica.Authority.Plugins.Base.Models;

namespace Ablera.Serdica.Authority.Plugins.Base.Contracts;

/*====================================================================*/
/*  Core, storage‑agnostic responsibilities are split across focused  */
/*  contracts.  Implementations can cherry‑pick or aggregate as needed */
/*====================================================================*/

public interface IUserRepository<TUser>
    where TUser : class
{
    Task<OperationResult> CreateAsync(TUser user, string password, CancellationToken ct = default);
    Task<OperationResult> UpdateAsync(TUser user, CancellationToken ct = default);
    Task<TUser?> FindByIdAsync(string id, CancellationToken ct = default);
    Task<TUser?> FindByEmailAsync(string email, CancellationToken ct = default);
    Task<TUser?> FindByNameAsync(string username, CancellationToken ct = default);
}
