mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 07:13:12 +00:00
* feat(vendors): add company roster management * fix(security): remove request-controlled write guards * fix(vendors): synchronize roster company fields * fix(vendors): source facets from companies
122 lines
4.5 KiB
C#
122 lines
4.5 KiB
C#
namespace SeaHaven.Services.DTOs
|
|
{
|
|
public class VendorDTO
|
|
{
|
|
public int Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public int? CompanyId { get; set; }
|
|
public string? ContactName { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Phone { get; set; }
|
|
public string? CompanyPhone { get; set; }
|
|
public string? PreferredContact { get; set; }
|
|
public string? Address { get; set; }
|
|
public string? City { get; set; }
|
|
public string? State { get; set; }
|
|
public string? Zipcode { get; set; }
|
|
public string? TradeSpecialties { get; set; }
|
|
public string? GoogleMapsUrl { get; set; }
|
|
public string? Notes { get; set; }
|
|
public int TotalJobs { get; set; }
|
|
public bool IsActive { get; set; }
|
|
}
|
|
|
|
// SH-198 vendor directory row. Id is the nullable vendor id (null for company-only
|
|
// rows that have zero technicians); CompanyId is always populated.
|
|
public class VendorDirectoryItemDTO
|
|
{
|
|
public int? Id { get; set; }
|
|
public int? CompanyId { get; set; }
|
|
public string? CompanyName { get; set; }
|
|
public string? ContactName { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Phone { get; set; }
|
|
public string? CompanyPhone { get; set; }
|
|
public string? PreferredContact { get; set; }
|
|
public string? Address { get; set; }
|
|
public string? City { get; set; }
|
|
public string? State { get; set; }
|
|
public string? Zipcode { get; set; }
|
|
public string? TradeSpecialties { get; set; }
|
|
public string? GoogleMapsUrl { get; set; }
|
|
public string? Notes { get; set; }
|
|
public int TotalJobs { get; set; }
|
|
public bool IsActive { get; set; }
|
|
}
|
|
|
|
public class CreateVendorDTO
|
|
{
|
|
public required string Name { get; set; }
|
|
public int? CompanyId { get; set; }
|
|
public string? ContactName { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Phone { get; set; }
|
|
public string? CompanyPhone { get; set; }
|
|
public string? PreferredContact { get; set; }
|
|
public string? Address { get; set; }
|
|
public string? City { get; set; }
|
|
public string? State { get; set; }
|
|
public string? Zipcode { get; set; }
|
|
public string? TradeSpecialties { get; set; }
|
|
public string? GoogleMapsUrl { get; set; }
|
|
public string? Notes { get; set; }
|
|
public bool IsActive { get; set; } = true;
|
|
}
|
|
|
|
public class UpdateVendorDTO
|
|
{
|
|
public string? Name { get; set; }
|
|
public int? CompanyId { get; set; }
|
|
public string? ContactName { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Phone { get; set; }
|
|
public string? CompanyPhone { get; set; }
|
|
public string? PreferredContact { get; set; }
|
|
public string? Address { get; set; }
|
|
public string? City { get; set; }
|
|
public string? State { get; set; }
|
|
public string? Zipcode { get; set; }
|
|
public string? TradeSpecialties { get; set; }
|
|
public string? GoogleMapsUrl { get; set; }
|
|
public string? Notes { get; set; }
|
|
public bool? IsActive { get; set; }
|
|
}
|
|
|
|
public class VendorDeactivationImpactDTO
|
|
{
|
|
public int VendorId { get; set; }
|
|
public bool CanDeactivate { get; set; }
|
|
public List<LinkedWorkOrderDTO> OpenWorkOrders { get; set; } = new();
|
|
}
|
|
|
|
public class LinkedWorkOrderDTO
|
|
{
|
|
public int WorkOrderId { get; set; }
|
|
public string? WorkOrderNumber { get; set; }
|
|
public string? WorkOrderTitle { get; set; }
|
|
public string? Status { get; set; }
|
|
public DateTime? ScheduledDate { get; set; }
|
|
public int? DispatchId { get; set; }
|
|
}
|
|
|
|
public class WorkOrderVendorUpdateDTO
|
|
{
|
|
public int WorkOrderId { get; set; }
|
|
public string? ContactName { get; set; }
|
|
public string? PreferredContact { get; set; }
|
|
public string? Phone { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Notes { get; set; }
|
|
}
|
|
|
|
public class VendorDeactivationBlockedException : InvalidOperationException
|
|
{
|
|
public List<LinkedWorkOrderDTO> OpenWorkOrders { get; }
|
|
|
|
public VendorDeactivationBlockedException(string message, List<LinkedWorkOrderDTO> openWorkOrders)
|
|
: base(message)
|
|
{
|
|
OpenWorkOrders = openWorkOrders;
|
|
}
|
|
}
|
|
}
|