Fix db seeding, migration, repository services

This commit is contained in:
danial23 2025-05-19 22:22:33 -04:00
parent 872dc1e263
commit 6b87902ca7
Signed by: danial23
SSH key fingerprint: SHA256:IJ8VP0j2WMUVweTYnzUUnEjNgPnGx+mAt+RhqWZ01bU
22 changed files with 606 additions and 64 deletions

View file

@ -5,10 +5,10 @@ using CSR.Domain.Entities;
public interface IUserRepository
{
Task<User?> GetByIdAsync(int id);
Task<User?> GetByUsernameAsync(string username);
// Task<User?> GetByEmailAsync(string email);
// Task<User?> GetByUsernameAsync(string username);
// Task<IEnumerable<User>> GetAllAsync();
Task AddAsync(User user);
Task<IEnumerable<User>?> GetAllByRoleIdAsync(int roleId);
Task<User?> AddAsync(User user);
Task UpdateAsync(User user);
Task DeleteAsync(int id);
}

View file

@ -2,7 +2,12 @@ namespace CSR.Application.Interfaces;
public interface IUserService
{
public record CreateUserResult(Domain.Entities.User? User, string? ErrorMessage);
record RegisterNewUserResult(Domain.Entities.User? User, IEnumerable<string>? Errors);
public void CreateUser(string username, string email, string password, bool isAdmin = false);
Task<RegisterNewUserResult> RegisterNewUser
(
string username,
string email,
string password
);
}