2026-07-08 10:17:31 -03:00
|
|
|
|
using Data.SeaHavenIndustries.Enums;
|
2026-07-08 14:58:59 -03:00
|
|
|
|
using SeaHaven.Services.Helpers;
|
2026-07-08 10:17:31 -03:00
|
|
|
|
|
|
|
|
|
|
namespace SeaHaven.Services.DTOs
|
|
|
|
|
|
{
|
2026-07-17 10:37:23 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Payload for creating a board work order (SHOC create wizard).
|
|
|
|
|
|
/// FE follow-up: extend WorkOrderBoardCreatePayload + mapper with PrimaryService,
|
|
|
|
|
|
/// ExtraServices, ServiceNotes, PocName, PocPhone, VendorNotes, TechPhone; stop embedding
|
|
|
|
|
|
/// POC/vendor/service notes in description (pocNotes already exists). Prefer structured
|
|
|
|
|
|
/// fields; keep Trade+Description temporarily for legacy clients.
|
|
|
|
|
|
/// </summary>
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public class WorkOrderBoardCreateRequestDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? WoNumber { get; set; }
|
|
|
|
|
|
public WorkOrderType WorkOrderType { get; set; }
|
2026-07-30 12:20:07 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Manual Add-On override when unscheduled. Ignored when ScheduledDate or TargetWeek is set
|
|
|
|
|
|
/// (server computes from cutoff).
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool? IsAddOn { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public string? SiteCode { get; set; }
|
2026-08-11 10:45:37 -03:00
|
|
|
|
/// <summary>
|
2026-08-26 09:12:48 -03:00
|
|
|
|
/// Optional display customer name. Ignored when stamping AccountId
|
|
|
|
|
|
/// (board create resolves from Location.AccountId).
|
2026-08-11 10:45:37 -03:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string? Customer { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public string? Description { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
/// <summary>Legacy alias for primary service; prefer <see cref="PrimaryService"/>.</summary>
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public string? Trade { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
/// <summary>Primary service label; persisted as Trade / board pm.</summary>
|
|
|
|
|
|
public string? PrimaryService { get; set; }
|
2026-09-16 18:02:57 -03:00
|
|
|
|
public int? ServiceId { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
public List<string>? ExtraServices { get; set; }
|
|
|
|
|
|
public string? ServiceNotes { get; set; }
|
2026-08-24 15:14:31 -03:00
|
|
|
|
/// <summary>Per-WO Aveta compliance. Omit or false = not required.</summary>
|
|
|
|
|
|
public bool? AvetaRequired { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public int? LocationId { get; set; }
|
|
|
|
|
|
public DateTime? DueDate { get; set; }
|
|
|
|
|
|
public string? AssignTo { get; set; }
|
|
|
|
|
|
public DateTime? ScheduledDate { get; set; }
|
|
|
|
|
|
public DateOnly? TargetWeek { get; set; }
|
|
|
|
|
|
public bool? ScheduleWeekOnly { get; set; }
|
|
|
|
|
|
public DocStatus? DocStatus { get; set; }
|
2026-09-03 13:36:22 -03:00
|
|
|
|
/// <summary>Optional create-time lifecycle. When omitted, server defaults to Incomplete.</summary>
|
|
|
|
|
|
public LifecycleStatus? LifecycleStatus { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public int? VendorId { get; set; }
|
|
|
|
|
|
public DateTime? ApptDate { get; set; }
|
|
|
|
|
|
public string? ApptTime { get; set; }
|
|
|
|
|
|
public int? PocContactId { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
public string? PocName { get; set; }
|
|
|
|
|
|
public string? PocPhone { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
public string? PocNotes { get; set; }
|
2026-08-13 16:11:36 -03:00
|
|
|
|
public List<WorkOrderAdditionalContactDto>? AdditionalContacts { get; set; }
|
2026-07-17 10:37:23 -03:00
|
|
|
|
public string? TechPhone { get; set; }
|
|
|
|
|
|
public string? VendorNotes { get; set; }
|
2026-09-07 11:46:13 -03:00
|
|
|
|
/// <summary>Severity 1–5 for Emergency/Reactive. Ignored for other types.</summary>
|
|
|
|
|
|
public int? Severity { get; set; }
|
2026-07-08 10:17:31 -03:00
|
|
|
|
}
|
2026-07-08 14:58:59 -03:00
|
|
|
|
|
2026-09-18 14:30:54 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// SH-379: replaces the work-order-level POC override (PocName/PocPhone/PocNotes).
|
|
|
|
|
|
/// Blank name and phone clear the override so the work order follows the Site's
|
|
|
|
|
|
/// live contact again. An edit equal to a live Site contact does not lock (SH-190).
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class WorkOrderPocUpdateRequestDto
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? PocName { get; set; }
|
|
|
|
|
|
public string? PocPhone { get; set; }
|
|
|
|
|
|
public string? PocNotes { get; set; }
|
|
|
|
|
|
/// <summary>Base64 row version, same concurrency token as the board patch.</summary>
|
|
|
|
|
|
public string? WorkOrderVersion { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-08 14:58:59 -03:00
|
|
|
|
/// <summary>Advanced search / filter query for the board.</summary>
|
|
|
|
|
|
public class WorkOrderAdvancedSearchQueryDto
|
|
|
|
|
|
{
|
2026-07-24 18:12:03 -03:00
|
|
|
|
public int Page { get; set; } = 0;
|
2026-07-08 14:58:59 -03:00
|
|
|
|
public int PageSize { get; set; } = 50;
|
|
|
|
|
|
public string? Search { get; set; }
|
|
|
|
|
|
public WorkOrderAdvancedSearchDatePreset? DatePreset { get; set; }
|
|
|
|
|
|
public DateOnly? DateFrom { get; set; }
|
|
|
|
|
|
public DateOnly? DateTo { get; set; }
|
2026-09-15 16:46:40 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// When true, only unscheduled rows (ScheduledDate is null) are returned.
|
|
|
|
|
|
/// Takes precedence over DatePreset/DateFrom/DateTo for the scheduled-date
|
|
|
|
|
|
/// filter; every other facet still applies.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool UnscheduledOnly { get; set; }
|
2026-09-24 20:51:44 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// When true, rows with no date (no Schedule On) are returned alongside
|
|
|
|
|
|
/// the in-range rows. Sent for searches with no date range selected; an
|
2026-09-25 01:41:49 -03:00
|
|
|
|
/// explicit range leaves it unset or false so the range strictly narrows
|
|
|
|
|
|
/// (SH-391). When it is omitted, clients that predate the flag keep their
|
|
|
|
|
|
/// undated rows: see <see cref="WorkOrderSearchDateRangeResolver.ResolveIncludeDateless"/>.
|
2026-09-24 20:51:44 -03:00
|
|
|
|
/// </summary>
|
2026-09-25 01:41:49 -03:00
|
|
|
|
public bool? IncludeDateless { get; set; }
|
2026-07-08 14:58:59 -03:00
|
|
|
|
public List<string>? Sites { get; set; }
|
2026-09-16 21:27:05 -03:00
|
|
|
|
public List<string>? Regions { get; set; }
|
2026-07-08 14:58:59 -03:00
|
|
|
|
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-07-08 14:58:59 -03:00
|
|
|
|
public List<string>? Dispatchers { get; set; }
|
|
|
|
|
|
public List<LifecycleStatus>? Statuses { get; set; }
|
|
|
|
|
|
public List<string>? PmTypes { get; set; }
|
|
|
|
|
|
public List<int>? VendorIds { get; set; }
|
|
|
|
|
|
public List<DocStatus>? DocStatuses { get; set; }
|
2026-08-13 16:34:21 -03:00
|
|
|
|
public List<int>? Severities { get; set; }
|
|
|
|
|
|
public bool Rescheduled { get; set; }
|
|
|
|
|
|
public bool CarriedOver { get; set; }
|
|
|
|
|
|
public bool AddOn { get; set; }
|
2026-08-24 15:14:31 -03:00
|
|
|
|
/// <summary>When true, only rows with AvetaRequired.</summary>
|
|
|
|
|
|
public bool AvetaOnly { get; set; }
|
2026-08-13 16:34:21 -03:00
|
|
|
|
public List<string>? FlagColors { get; set; }
|
|
|
|
|
|
public bool InternalOnly { get; set; }
|
|
|
|
|
|
public bool HasUplift { get; set; }
|
|
|
|
|
|
public List<string>? UpliftStatuses { get; set; }
|
2026-07-08 14:58:59 -03:00
|
|
|
|
public bool MyWorkOrders { get; set; }
|
|
|
|
|
|
public string? SortBy { get; set; }
|
|
|
|
|
|
public string? SortDir { get; set; }
|
|
|
|
|
|
}
|
2026-07-08 10:17:31 -03:00
|
|
|
|
}
|