mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 20:03:11 +00:00
41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
using SeaHaven.Services.DTOs;
|
|
|
|
namespace SeaHaven.Services.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// Contact business service interface
|
|
/// Handles business logic, validation, and orchestration for Contact operations
|
|
/// </summary>
|
|
public interface IContactService
|
|
{
|
|
// Query operations
|
|
Task<ContactDTO?> GetContactByIdAsync(int id);
|
|
Task<ContactDTO?> GetContactByIdWithDetailsAsync(int id);
|
|
Task<IEnumerable<ContactDTO>> GetAllContactsAsync();
|
|
Task<IEnumerable<ContactDTO>> GetContactsByAccountIdAsync(int accountId);
|
|
Task<IEnumerable<ContactDTO>> GetContactsByTypeAsync(string type);
|
|
Task<ContactDTO?> GetContactByEmailAsync(string email);
|
|
|
|
// Paged results
|
|
Task<PagedResult<ContactDTO>> GetContactsPagedAsync(
|
|
int page,
|
|
int pageSize,
|
|
string? search = null,
|
|
string? type = null);
|
|
|
|
// Command operations
|
|
Task<ContactDTO> CreateContactAsync(CreateContactDTO dto, string userId);
|
|
Task<ContactDTO> UpdateContactAsync(int id, UpdateContactDTO dto, string userId);
|
|
Task DeleteContactAsync(int id, string userId);
|
|
|
|
// Validation operations
|
|
Task<bool> ContactExistsAsync(int id);
|
|
Task<bool> EmailExistsAsync(string email, int? excludeId = null);
|
|
Task<bool> PhoneExistsAsync(string phone, int? excludeId = null);
|
|
|
|
// Statistics
|
|
Task<int> GetTotalContactCountAsync();
|
|
Task<int> GetContactCountByAccountAsync(int accountId);
|
|
Task<Dictionary<string, int>> GetContactCountByTypeAsync();
|
|
}
|
|
}
|