2026-04-28 18:55:14 -05:00
|
|
|
using SeaHaven.Services.DTOs;
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.Services.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IVendorService
|
|
|
|
|
{
|
|
|
|
|
Task<VendorDTO?> GetVendorByIdAsync(int id);
|
|
|
|
|
Task<VendorDTO?> GetVendorByIdWithDetailsAsync(int id);
|
|
|
|
|
Task<IEnumerable<VendorDTO>> GetAllVendorsAsync();
|
2026-07-23 12:55:47 -03:00
|
|
|
Task<PagedResult<VendorDTO>> GetVendorsPagedAsync(
|
|
|
|
|
int page,
|
|
|
|
|
int pageSize,
|
|
|
|
|
string? search = null,
|
|
|
|
|
bool? isActive = true,
|
|
|
|
|
IReadOnlyCollection<string>? companies = null,
|
|
|
|
|
IReadOnlyCollection<string>? trades = null,
|
|
|
|
|
IReadOnlyCollection<string>? locations = null,
|
|
|
|
|
IReadOnlyCollection<string>? jobBuckets = null);
|
2026-08-03 17:53:24 -03:00
|
|
|
|
2026-09-15 16:02:44 -03:00
|
|
|
// SH-198 legacy vendor directory contract backing GetVendorList: one row per
|
|
|
|
|
// technician (per-technician rows UNION company-only rows), raw pagination.
|
|
|
|
|
Task<PagedResult<VendorDirectoryItemDTO>> GetVendorTechnicianDirectoryPagedAsync(
|
|
|
|
|
int page,
|
|
|
|
|
int pageSize,
|
|
|
|
|
string? search = null,
|
|
|
|
|
bool? isActive = true,
|
|
|
|
|
IReadOnlyCollection<string>? companies = null,
|
|
|
|
|
IReadOnlyCollection<string>? trades = null,
|
|
|
|
|
IReadOnlyCollection<string>? locations = null,
|
|
|
|
|
IReadOnlyCollection<string>? jobBuckets = null,
|
|
|
|
|
CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
// SH-281 company directory backing GetVendorDirectoryList: company-grouped
|
|
|
|
|
// rows with nested technicians and bounded page sizes.
|
|
|
|
|
Task<PagedResult<VendorDirectoryItemDTO>> GetVendorCompanyDirectoryPagedAsync(
|
2026-08-03 17:53:24 -03:00
|
|
|
int page,
|
|
|
|
|
int pageSize,
|
|
|
|
|
string? search = null,
|
|
|
|
|
bool? isActive = true,
|
|
|
|
|
IReadOnlyCollection<string>? companies = null,
|
|
|
|
|
IReadOnlyCollection<string>? trades = null,
|
|
|
|
|
IReadOnlyCollection<string>? locations = null,
|
|
|
|
|
IReadOnlyCollection<string>? jobBuckets = null,
|
2026-09-16 11:34:45 -03:00
|
|
|
IReadOnlyCollection<string>? areas = null,
|
2026-08-03 17:53:24 -03:00
|
|
|
CancellationToken cancellationToken = default);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<VendorDTO> CreateVendorAsync(CreateVendorDTO dto, string userId);
|
|
|
|
|
Task<VendorDTO> UpdateVendorAsync(int id, UpdateVendorDTO dto, string userId);
|
2026-08-19 13:31:16 -03:00
|
|
|
Task DeleteVendorAsync(int id, string userId, bool confirmOpenWorkOrders);
|
2026-04-28 18:55:14 -05:00
|
|
|
Task<bool> VendorExistsAsync(int id);
|
|
|
|
|
Task<int> GetTotalVendorCountAsync();
|
2026-07-23 17:02:40 -03:00
|
|
|
Task<VendorDeactivationImpactDTO> GetDeactivationImpactAsync(int vendorId);
|
|
|
|
|
Task<VendorDTO> UpdateVendorFromWorkOrderAsync(int vendorId, WorkOrderVendorUpdateDTO dto, string userId);
|
2026-07-24 17:35:34 -03:00
|
|
|
Task<IEnumerable<VendorDropdownItemDTO>> GetDropdownAsync(string? trade, string? siteZip, CancellationToken cancellationToken);
|
|
|
|
|
Task<VendorFacetsDTO> GetFacetsAsync(bool? isActive, CancellationToken cancellationToken);
|
|
|
|
|
Task<VendorPortalTokenDTO?> GetPortalTokenAsync(int vendorId, CancellationToken cancellationToken);
|
|
|
|
|
Task<VendorPortalTokenDTO?> RotatePortalTokenAsync(int vendorId, CancellationToken cancellationToken);
|
|
|
|
|
Task<bool> RevokePortalTokenAsync(int vendorId, CancellationToken cancellationToken);
|
2026-04-28 18:55:14 -05:00
|
|
|
}
|
|
|
|
|
}
|