mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-01 06:23:16 +00:00
PATCH /api/vendor-company-roster/{companyId} inserts the submitted
technicians and optionally updates company fields. Technicians absent
from the payload are never removed or deactivated, so the Add Vendor
flow can no longer soft-delete an existing roster via the full-snapshot
PUT. Stale rowVersion still 409s; unknown company 404s. POST (create)
and PUT (reconcile) behaviour is unchanged.
36 lines
1.8 KiB
C#
36 lines
1.8 KiB
C#
using SeaHaven.DataServices.Models;
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
{
|
|
public interface IVendorCompanyRosterDataService
|
|
{
|
|
// 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);
|
|
}
|
|
}
|