using Data.SeaHavenIndustries.Enums;
using SeaHaven.Services.Helpers;
namespace SeaHaven.Services.DTOs
{
///
/// 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.
///
public class WorkOrderBoardCreateRequestDto
{
public string? WoNumber { get; set; }
public WorkOrderType WorkOrderType { get; set; }
///
/// Manual Add-On override when unscheduled. Ignored when ScheduledDate or TargetWeek is set
/// (server computes from cutoff).
///
public bool? IsAddOn { get; set; }
public string? SiteCode { get; set; }
///
/// Optional display customer name. Ignored when stamping AccountId
/// (board create resolves from Location.AccountId).
///
public string? Customer { get; set; }
public string? Description { get; set; }
/// Legacy alias for primary service; prefer .
public string? Trade { get; set; }
/// Primary service label; persisted as Trade / board pm.
public string? PrimaryService { get; set; }
public int? ServiceId { get; set; }
public List? ExtraServices { get; set; }
public string? ServiceNotes { get; set; }
/// Per-WO Aveta compliance. Omit or false = not required.
public bool? AvetaRequired { get; set; }
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; }
/// Optional create-time lifecycle. When omitted, server defaults to Incomplete.
public LifecycleStatus? LifecycleStatus { get; set; }
public int? VendorId { get; set; }
public DateTime? ApptDate { get; set; }
public string? ApptTime { get; set; }
public int? PocContactId { get; set; }
public string? PocName { get; set; }
public string? PocPhone { get; set; }
public string? PocNotes { get; set; }
public List? AdditionalContacts { get; set; }
public string? TechPhone { get; set; }
public string? VendorNotes { get; set; }
/// Severity 1–5 for Emergency/Reactive. Ignored for other types.
public int? Severity { get; set; }
}
/// Advanced search / filter query for the board.
public class WorkOrderAdvancedSearchQueryDto
{
public int Page { get; set; } = 0;
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; }
///
/// 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.
///
public bool UnscheduledOnly { get; set; }
public List? Sites { get; set; }
public List? Types { get; set; }
/// When true, include past-due (isPastDue) rows. Combined with Types via OR.
public bool Overdue { get; set; }
public List? Dispatchers { get; set; }
public List? Statuses { get; set; }
public List? PmTypes { get; set; }
public List? VendorIds { get; set; }
public List? DocStatuses { get; set; }
public List? Severities { get; set; }
public bool Rescheduled { get; set; }
public bool CarriedOver { get; set; }
public bool AddOn { get; set; }
/// When true, only rows with AvetaRequired.
public bool AvetaOnly { get; set; }
public List? FlagColors { get; set; }
public bool InternalOnly { get; set; }
public bool HasUplift { get; set; }
public List? UpliftStatuses { get; set; }
public bool MyWorkOrders { get; set; }
public string? SortBy { get; set; }
public string? SortDir { get; set; }
}
}