using e_suite.API.Common.repository;
using e_suite.Database.Audit;
using e_suite.Database.Core.Models;
using e_suite.Database.Core.Tables.Domain;
using e_suite.Database.Core.Tables.UserManager;
using e_suite.UnitTestCore;
using eSuite.Core.Miscellaneous;
using MockQueryable;

namespace e_suite.Modules.RoleManager.UnitTests.Helpers;

public class FakeUserManagerRepository : FakeRepository, IUserManagerRepository
{
    public List<User> Users { get; } = [];

    public Task<User?> GetUserByEmail(string loginEmail, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<User?> GetUserSsoId(long ssoId, string ssoUserId, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<User?> GetUserByDomainSsoId(long domainSsoId, string ssoUserId, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task AddEmailUserAction(
        AuditUserDetails auditUserDetails,
        EmailUserAction emailConfirmation,
        CancellationToken cancellationToken
    )
    {
        throw new NotImplementedException();
    }

    public Task AddUser(AuditUserDetails auditUserDetails, User user, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task EditUser(AuditUserDetails auditUserDetails, User user, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<EmailUserAction?> GetEmailUserAction(Guid token, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<EmailUserAction?> GetCurrentEmailUserAction(
        long userId,
        EmailUserActionType emailUserActionType,
        CancellationToken cancellationToken
    )
    {
        throw new NotImplementedException();
    }

    public Task DeleteEmailUserAction(
        AuditUserDetails auditUserDetails,
        EmailUserAction emailUserAction,
        CancellationToken cancellationToken
    )
    {
        throw new NotImplementedException();
    }

    public IQueryable<User> GetUsers()
    {
        return Users.BuildMock();
    }

    public User? GetUserById(IGeneralIdRef generalIdRef)
    {
        throw new NotImplementedException();
    }

    public Task<User?> GetUserByIdAsync(IGeneralIdRef generalIdRef, CancellationToken cancellationToken)
    {
        return Task.FromResult(Users.SingleOrDefault(x => x.Id == generalIdRef.Id || x.Guid == generalIdRef.Guid));
    }

    public Task<SsoProvider?> GetSsoProviderById(long id, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public IQueryable<SsoProvider> GetSsoProviders()
    {
        throw new NotImplementedException();
    }

    public Task SaveSingleUseGuidForUser(SingleUseGuid singleUseGuid, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<User?> GetUserBySingleUseGuid(Guid guid, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task DeleteSingleUseGuid(Guid guid, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }
    
    public Task<Domain?> GetDomainById(GeneralIdRef userRegistrationDomainId, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task DeleteExpiredEmailUserActions()
    {
        throw new NotImplementedException();
    }

    public Task DeleteExpiredSingleUseGuids()
    {
        throw new NotImplementedException();
    }
}