2026-04-15 17:39:48 -03:00
|
|
|
using SIGCM2.Application.Common;
|
2026-04-13 21:36:01 -03:00
|
|
|
using SIGCM2.Domain.Entities;
|
|
|
|
|
|
|
|
|
|
namespace SIGCM2.Application.Abstractions.Persistence;
|
|
|
|
|
|
|
|
|
|
public interface IUsuarioRepository
|
|
|
|
|
{
|
|
|
|
|
Task<Usuario?> GetByUsernameAsync(string username);
|
2026-04-14 13:28:16 -03:00
|
|
|
Task<Usuario?> GetByIdAsync(int id, CancellationToken ct = default);
|
2026-04-15 10:47:48 -03:00
|
|
|
Task<bool> ExistsByUsernameAsync(string username, CancellationToken ct = default);
|
|
|
|
|
Task<int> AddAsync(Usuario usuario, CancellationToken ct = default);
|
2026-04-15 17:39:48 -03:00
|
|
|
|
|
|
|
|
// UDT-008
|
|
|
|
|
Task UpdateUltimoLoginAsync(int id, DateTime utcNow, CancellationToken ct = default);
|
|
|
|
|
Task<PagedResult<UsuarioListItem>> GetPagedAsync(UsuariosQuery query, CancellationToken ct = default);
|
|
|
|
|
Task<Usuario?> GetDetailAsync(int id, CancellationToken ct = default);
|
|
|
|
|
Task UpdateAsync(int id, UpdateUsuarioFields fields, DateTime fechaModificacion, CancellationToken ct = default);
|
|
|
|
|
Task UpdatePasswordAsync(int id, string passwordHash, bool mustChangePassword, CancellationToken ct = default);
|
|
|
|
|
Task<int> CountActiveAdminsAsync(CancellationToken ct = default);
|
2026-04-13 21:36:01 -03:00
|
|
|
}
|