2026-06-29 17:22:31 -03:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
|
|
|
{
|
|
|
|
|
public class Dispatch : FullAuditEntity
|
|
|
|
|
{
|
2026-04-17 15:16:28 -04:00
|
|
|
public int? WorkOrderId { get; set; }
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
[ForeignKey(nameof(WorkOrderId))]
|
|
|
|
|
public virtual WorkOrder? WorkOrder { get; set; }
|
|
|
|
|
|
|
|
|
|
public int VendorId { get; set; }
|
|
|
|
|
[ForeignKey(nameof(VendorId))]
|
|
|
|
|
public virtual Vendor? Vendor { get; set; }
|
|
|
|
|
|
2026-04-17 14:01:03 -04:00
|
|
|
public string? DispatchNumber { get; set; }
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
public string? PONumber { get; set; }
|
|
|
|
|
public decimal? NTEAmount { get; set; }
|
|
|
|
|
public string? Description { get; set; }
|
|
|
|
|
public string? Status { get; set; }
|
2026-04-17 11:47:00 -04:00
|
|
|
public DateTime? ScheduledDate { get; set; }
|
2026-07-23 19:18:06 -03:00
|
|
|
public DateTime? EstimatedArrivalAt { get; set; }
|
|
|
|
|
public bool EtaManualOverride { get; set; }
|
|
|
|
|
public string InvoiceStatus { get; set; } = "Not Submitted";
|
|
|
|
|
public string PaymentStatus { get; set; } = "Unavailable";
|
|
|
|
|
public string? InvoiceNumber { get; set; }
|
|
|
|
|
public DateTime? CommercialStatusUpdatedAt { get; set; }
|
2026-04-17 14:01:03 -04:00
|
|
|
public DateTime? CompletedDate { get; set; }
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
public DateTime? DispatchedAt { get; set; }
|
2026-04-17 15:16:28 -04:00
|
|
|
public DateTime? AcknowledgedAt { get; set; }
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
public bool EmailSent { get; set; }
|
|
|
|
|
public string? ReplyToAddress { get; set; }
|
2026-04-17 15:16:28 -04:00
|
|
|
public string? AcceptToken { get; set; }
|
2026-04-17 16:03:34 -04:00
|
|
|
public string? VerifiedBy { get; set; }
|
|
|
|
|
public DateTime? VerifiedAt { get; set; }
|
2026-06-29 17:22:31 -03:00
|
|
|
|
2026-07-17 10:37:23 -03:00
|
|
|
/// <summary>Tech/crew phone for this dispatch (overrides Vendor.Phone on board).</summary>
|
|
|
|
|
[MaxLength(50)]
|
|
|
|
|
public string? TechPhone { get; set; }
|
|
|
|
|
/// <summary>Instructions for the vendor for this appointment/dispatch.</summary>
|
|
|
|
|
[MaxLength(2000)]
|
|
|
|
|
public string? VendorNotes { get; set; }
|
|
|
|
|
|
2026-06-29 17:22:31 -03:00
|
|
|
[Timestamp]
|
|
|
|
|
public byte[]? RowVersion { get; set; }
|
|
|
|
|
|
2026-04-17 14:01:03 -04:00
|
|
|
public ICollection<Comments>? Comments { get; set; }
|
2026-04-17 15:16:28 -04:00
|
|
|
public ICollection<DispatchWorkOrder>? DispatchWorkOrders { get; set; }
|
2026-04-17 15:28:52 -04:00
|
|
|
public ICollection<DispatchChecklistItem>? ChecklistItems { get; set; }
|
2026-04-17 15:51:20 -04:00
|
|
|
public ICollection<DispatchSignoff>? Signoffs { get; set; }
|
2026-07-23 19:18:06 -03:00
|
|
|
public ICollection<VendorCompletionDocument>? CompletionDocuments { get; set; }
|
Add vendor dispatch workflow backend
- Create Vendor model with company info, trade specialties, active flag
- Create Dispatch model (doubles as Vendor PO) with PO number, NTE, status, reply-to address
- VendorController: CRUD, paginated list, dropdown endpoint with trade filtering
- DispatchToVendor endpoint: multi-vendor dispatch, auto-generated PO numbers (VPO-00001),
HTML email with full WO details via SendGrid, reply-to wo-{number}@int.seahaven.com
- GetDispatches endpoint for listing dispatches by WO
- Include dispatches in GetWorkorderById response
- SendMessage.SendDispatchEmail with reply-to support
- Audit log entry for each dispatch
2026-04-17 11:37:35 -04:00
|
|
|
}
|
|
|
|
|
}
|