mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 18:53:12 +00:00
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
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);
|
|
}
|
|
}
|