2026-06-30 10:09:48 -03:00
|
|
|
|
using Data.SeaHavenIndustries.Enums;
|
2026-07-07 11:26:13 -03:00
|
|
|
|
using SeaHaven.Services.Helpers;
|
2026-06-30 10:09:48 -03:00
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.Services.DTOs
|
|
|
|
|
|
{
|
|
|
|
|
|
public class WorkOrderBoardQueryDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public DateOnly WeekStart { get; set; }
|
|
|
|
|
|
public DateOnly? WeekEnd { get; set; }
|
|
|
|
|
|
public List<string>? Dispatchers { get; set; }
|
|
|
|
|
|
public bool MyWorkOrders { get; set; }
|
|
|
|
|
|
public List<WorkOrderType>? Types { get; set; }
|
2026-07-24 18:12:03 -03:00
|
|
|
|
/// <summary>When true, include past-due (isPastDue) rows. Combined with Types via OR.</summary>
|
|
|
|
|
|
public bool Overdue { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public string? Search { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-24 18:29:18 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Scheduled-in-week counts for GET /board. <see cref="Total"/> is the week
|
|
|
|
|
|
/// match before the bar search filter; <see cref="Returned"/> is after it.
|
|
|
|
|
|
/// Undated work orders are not included.
|
|
|
|
|
|
/// </summary>
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public class WorkOrderBoardCountsDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Returned { get; set; }
|
|
|
|
|
|
public int Total { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-13 14:49:56 -03:00
|
|
|
|
public class WorkOrderUpliftSummaryDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool HasUplift { get; set; }
|
|
|
|
|
|
public int PendingCount { get; set; }
|
|
|
|
|
|
public string? PrimaryStatus { get; set; }
|
|
|
|
|
|
public decimal? Amount { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-10 15:46:25 -03:00
|
|
|
|
public class WorkOrderFrozenSiteDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? Code { get; set; }
|
|
|
|
|
|
public string? Label { get; set; }
|
|
|
|
|
|
public string? Address { get; set; }
|
|
|
|
|
|
public string? City { get; set; }
|
|
|
|
|
|
public string? State { get; set; }
|
|
|
|
|
|
public string? Zip { get; set; }
|
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
|
public string? Email { get; set; }
|
|
|
|
|
|
public string? Maps { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderFrozenCompanyDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
public string? ContactName { get; set; }
|
|
|
|
|
|
public string? Address { get; set; }
|
|
|
|
|
|
public string? City { get; set; }
|
|
|
|
|
|
public string? State { get; set; }
|
|
|
|
|
|
public string? Zip { get; set; }
|
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
|
public string? Email { get; set; }
|
|
|
|
|
|
public string? Maps { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderFrozenPocDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<WorkOrderFrozenPocContactDto> Contacts { get; set; } = new();
|
|
|
|
|
|
public string? Notes { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderFrozenPocContactDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
public string? Phone { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public class WorkOrderBoardRowDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
public string? WoNumber { get; set; }
|
|
|
|
|
|
public int RescheduleCount { get; set; }
|
|
|
|
|
|
public int CarriedOver { get; set; }
|
2026-07-30 12:20:07 -03:00
|
|
|
|
public bool IsAddOn { get; set; }
|
2026-08-24 15:14:31 -03:00
|
|
|
|
public bool AvetaRequired { get; set; }
|
2026-08-25 15:10:45 -03:00
|
|
|
|
public bool HasAvetaDocument { get; set; }
|
2026-08-24 15:14:31 -03:00
|
|
|
|
public DateOnly? OriginalDate { get; set; }
|
|
|
|
|
|
public DateOnly? OriginalWeek { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public WorkOrderType? WorkOrderType { get; set; }
|
2026-09-16 18:02:57 -03:00
|
|
|
|
public int? ServiceId { get; set; }
|
|
|
|
|
|
public string? ServiceNameSnapshot { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public bool IsPastDue { get; set; }
|
|
|
|
|
|
public string? SiteCode { get; set; }
|
|
|
|
|
|
public string? LocationName { get; set; }
|
|
|
|
|
|
public string? PocName { get; set; }
|
|
|
|
|
|
public string? PocPhone { get; set; }
|
|
|
|
|
|
public string? PocNotes { get; set; }
|
2026-09-18 14:30:54 -03:00
|
|
|
|
/// <summary>SH-190: a manual WO-level POC override is present (locked away from the Site).</summary>
|
|
|
|
|
|
public bool PocCustomized { get; set; }
|
2026-08-13 16:11:36 -03:00
|
|
|
|
public List<WorkOrderAdditionalContactDto>? AdditionalContacts { get; set; }
|
2026-09-10 15:46:25 -03:00
|
|
|
|
public WorkOrderFrozenSiteDto? FrozenSite { get; set; }
|
|
|
|
|
|
public WorkOrderFrozenCompanyDto? FrozenCompany { get; set; }
|
|
|
|
|
|
public WorkOrderFrozenPocDto? FrozenPoc { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public LifecycleStatus? LifecycleStatus { get; set; }
|
|
|
|
|
|
public string? LifecycleStatusLabel { get; set; }
|
|
|
|
|
|
public string? LegacyStatus { get; set; }
|
|
|
|
|
|
public string? DispatcherId { get; set; }
|
|
|
|
|
|
public string? DispatcherName { get; set; }
|
|
|
|
|
|
public string? Initials { get; set; }
|
|
|
|
|
|
public string? Color { get; set; }
|
|
|
|
|
|
public DateTime? DueDate { get; set; }
|
|
|
|
|
|
public DateTime? ScheduledDate { get; set; }
|
|
|
|
|
|
public DateOnly? TargetWeek { get; set; }
|
|
|
|
|
|
public bool? ScheduleWeekOnly { get; set; }
|
|
|
|
|
|
public string? DayGroup { get; set; }
|
|
|
|
|
|
public int? VendorId { get; set; }
|
|
|
|
|
|
public string? VendorName { get; set; }
|
2026-08-20 13:22:12 -03:00
|
|
|
|
/// <summary>
|
2026-08-20 13:43:42 -03:00
|
|
|
|
/// Primary dispatch status. Inactive statuses are not a live company assignment.
|
2026-08-20 13:22:12 -03:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string? PrimaryDispatchStatus { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public string? TechName { get; set; }
|
|
|
|
|
|
public string? TechPhone { get; set; }
|
|
|
|
|
|
public DateTime? ApptDate { get; set; }
|
|
|
|
|
|
public string? ApptTime { get; set; }
|
|
|
|
|
|
public string? Pm { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
public string? ServiceNotes { get; set; }
|
|
|
|
|
|
public List<string>? ExtraServices { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public DocStatus? DocStatus { get; set; }
|
2026-09-08 21:10:52 -03:00
|
|
|
|
/// <summary>Live photo/video/document count for the board CompDoc cell (excludes soft-deleted).</summary>
|
|
|
|
|
|
public int MediaCount { get; set; }
|
2026-07-31 11:58:22 -03:00
|
|
|
|
public DateTime? CompletedDate { get; set; }
|
2026-07-21 09:42:10 -03:00
|
|
|
|
/// <summary>Board flag color (#RRGGBB). Null = no flag. Distinct from Color (dispatcher avatar).</summary>
|
|
|
|
|
|
public string? FlagColor { get; set; }
|
2026-09-07 11:46:13 -03:00
|
|
|
|
/// <summary>Severity 1–5 for Emergency/Reactive. Null when unset or not applicable.</summary>
|
|
|
|
|
|
public int? Severity { get; set; }
|
2026-07-07 11:26:13 -03:00
|
|
|
|
public int? PrimaryDispatchId { get; set; }
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public byte[]? RowVersion { get; set; }
|
2026-07-07 11:26:13 -03:00
|
|
|
|
public byte[]? DispatchRowVersion { get; set; }
|
2026-08-12 09:43:10 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Count of uplift requests with status Pending across all dispatches tied to this work order (SH-188).
|
|
|
|
|
|
/// Authoritative completion-gate signal for the board/search/detail row contract.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int PendingUpliftCount { get; set; }
|
2026-08-13 14:49:56 -03:00
|
|
|
|
/// <summary>SH-196: board/search uplift column contract.</summary>
|
|
|
|
|
|
public WorkOrderUpliftSummaryDto? UpliftSummary { get; set; }
|
2026-07-07 11:26:13 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderBoardPatchRequestDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Field { get; set; } = "";
|
|
|
|
|
|
public string? Value { get; set; }
|
|
|
|
|
|
public string? WorkOrderVersion { get; set; }
|
|
|
|
|
|
public string? DispatchVersion { get; set; }
|
|
|
|
|
|
public int? PrimaryDispatchId { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderBoardConflictDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Message { get; set; } = "The record was modified by another user. Refresh and retry.";
|
|
|
|
|
|
public WorkOrderBoardRowDto? CurrentState { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderBoardValidationErrorDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Code { get; set; } = "";
|
|
|
|
|
|
public string Message { get; set; } = "";
|
2026-06-30 10:09:48 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class WorkOrderBoardResponseDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public DateOnly WeekStart { get; set; }
|
|
|
|
|
|
public DateOnly WeekEnd { get; set; }
|
|
|
|
|
|
public WorkOrderBoardCountsDto Counts { get; set; } = new();
|
2026-08-24 18:29:18 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Always empty on the weekly board. Undated rows are served by GET /board/search.
|
|
|
|
|
|
/// Kept so existing clients can keep reading the field.
|
|
|
|
|
|
/// </summary>
|
2026-06-30 10:09:48 -03:00
|
|
|
|
public List<WorkOrderBoardRowDto> Unscheduled { get; set; } = new();
|
|
|
|
|
|
public List<WorkOrderBoardRowDto> Scheduled { get; set; } = new();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class DispatcherLookupDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Id { get; set; } = "";
|
|
|
|
|
|
public string Name { get; set; } = "";
|
|
|
|
|
|
public string? Initials { get; set; }
|
|
|
|
|
|
public string? Color { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|