shoc-backend/SeaHaven.DataServices/Interfaces/IVendorCompanyRosterDataService.cs
Alexandre Brandizzi 8515676f4d feat(vendors): add admin-assigned vendor company Area
Seed an organization-wide Area catalogue (East, Central, West, California)
with stable ids, add a nullable AreaId to VendorCompany, allow only Admins
to change it through the roster endpoints, expose areas facet metadata and
an areas[n] company-directory filter with the __unassigned__ sentinel.
2026-09-16 11:34:45 -03:00

39 lines
1.9 KiB
C#

using SeaHaven.DataServices.Models;
namespace SeaHaven.DataServices.Interfaces
{
public interface IVendorCompanyRosterDataService
{
// SH-278: true only for an existing, non-archived Area in the catalogue.
Task<bool> IsActiveAreaAsync(int areaId, CancellationToken cancellationToken);
// Loads the company roster from either a vendor row id and/or a company id,
// returning the company plus all non-deleted technician rows.
Task<VendorCompanyRosterReadModel?> GetRosterAsync(
int? vendorId,
int? companyId,
CancellationToken cancellationToken);
// Reconciles the company roster (add/update/soft-delete/rename) and updates the
// company Notes in a single SaveChangesAsync. A technician omitted from the
// snapshot is soft-deleted only when it has no open linked work orders; otherwise
// the whole save fails (VendorRosterConflictException) and nothing is persisted.
Task<VendorCompanyRosterReadModel> SaveRosterAsync(
VendorCompanyRosterWriteModel roster,
CancellationToken cancellationToken);
// Creates a new company together with its initial technicians (which may be zero)
// in a single SaveChangesAsync.
Task<VendorCompanyRosterReadModel> CreateRosterAsync(
VendorCompanyRosterWriteModel roster,
CancellationToken cancellationToken);
// Additive update (SH-250): inserts the submitted technicians and applies only
// the company fields present in CompanyFields (null = unchanged). Technicians
// absent from the payload are never removed, soft-deleted or deactivated, so no
// open-work-order check is needed. Persists in a single SaveChangesAsync.
Task<VendorCompanyRosterReadModel> AddTechniciansAsync(
VendorCompanyRosterAddWriteModel roster,
CancellationToken cancellationToken);
}
}