shoc-backend/SeaHaven.DataServices/Interfaces/IContactDataService.cs

43 lines
1.5 KiB
C#
Raw Normal View History

2026-04-28 18:55:14 -05:00
using Data.SeaHavenIndustries;
namespace SeaHaven.DataServices.Interfaces
{
/// <summary>
/// Data service interface for Contact entity
/// Handles all data access operations for Contacts
/// </summary>
public interface IContactDataService
{
// Query operations
Task<Contacts?> GetByIdAsync(int id);
Task<Contacts?> GetByIdWithDetailsAsync(int id);
Task<IEnumerable<Contacts>> GetAllAsync();
Task<IEnumerable<Contacts>> GetByAccountIdAsync(int accountId);
Task<IEnumerable<Contacts>> GetByTypeAsync(string type);
Task<Contacts?> GetByEmailAsync(string email);
Task<Contacts?> GetByPhoneAsync(string phone);
// Paged results
Task<(IEnumerable<Contacts> Items, int TotalCount)> GetPagedAsync(
int page,
int pageSize,
string? search = null,
string? type = null);
// Command operations
Task<Contacts> AddAsync(Contacts contact);
Task UpdateAsync(Contacts contact);
Task DeleteAsync(int id);
// Validation operations
Task<bool> ExistsAsync(int id);
Task<bool> EmailExistsAsync(string email, int? excludeId = null);
Task<bool> PhoneExistsAsync(string phone, int? excludeId = null);
// Count operations
Task<int> CountAsync();
Task<int> CountByAccountIdAsync(int accountId);
Task<int> CountByTypeAsync(string type);
}
}