2026-04-28 18:55:14 -05:00
|
|
|
using Data.SeaHavenIndustries;
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IAccountDataService
|
|
|
|
|
{
|
|
|
|
|
Task<Accounts?> GetByIdAsync(int id);
|
|
|
|
|
Task<Accounts?> GetByIdWithDetailsAsync(int id);
|
|
|
|
|
Task<IEnumerable<Accounts>> GetAllAsync();
|
|
|
|
|
Task<(IEnumerable<Accounts> Items, int TotalCount)> GetPagedAsync(int page, int pageSize, string? search = null);
|
|
|
|
|
Task<Accounts> AddAsync(Accounts account);
|
|
|
|
|
Task UpdateAsync(Accounts account);
|
|
|
|
|
Task DeleteAsync(int id);
|
|
|
|
|
Task<bool> ExistsAsync(int id);
|
2026-08-26 14:16:59 -03:00
|
|
|
Task<bool> ExistsActiveAsync(int id, CancellationToken cancellationToken = default);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<int> CountAsync();
|
2026-08-11 10:45:37 -03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns the id when exactly one non-deleted account has this exact Name
|
|
|
|
|
/// (same rule as SH-221 backfill). Null when name is blank, zero matches, or ambiguous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
Task<int?> TryGetUniqueActiveIdByExactNameAsync(
|
|
|
|
|
string? name,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
2026-04-28 18:55:14 -05:00
|
|
|
}
|
|
|
|
|
}
|