Move dotnet api into new directory

This commit is contained in:
Aaron Po
2026-04-27 15:59:17 -04:00
parent e8c5b8a80c
commit 189bce040b
132 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
using Domain.Entities;
namespace Service.UserManagement.User;
public interface IUserService
{
Task<IEnumerable<UserAccount>> GetAllAsync(
int? limit = null,
int? offset = null
);
Task<UserAccount> GetByIdAsync(Guid id);
Task UpdateAsync(UserAccount userAccount);
}

View File

@@ -0,0 +1,29 @@
using Domain.Entities;
using Domain.Exceptions;
using Infrastructure.Repository.UserAccount;
namespace Service.UserManagement.User;
public class UserService(IUserAccountRepository repository) : IUserService
{
public async Task<IEnumerable<UserAccount>> GetAllAsync(
int? limit = null,
int? offset = null
)
{
return await repository.GetAllAsync(limit, offset);
}
public async Task<UserAccount> GetByIdAsync(Guid id)
{
var user = await repository.GetByIdAsync(id);
if (user is null)
throw new NotFoundException($"User with ID {id} not found");
return user;
}
public async Task UpdateAsync(UserAccount userAccount)
{
await repository.UpdateAsync(userAccount);
}
}