2024-09-28 14:58:36 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
|
|
|
|
{
|
|
|
|
|
|
public class WorkOrder : FullAuditEntity
|
|
|
|
|
|
{
|
2026-04-16 18:42:58 -04:00
|
|
|
|
public string? InternalWONumber { get; set; }
|
Add DynamoDB sync bridge for workorder-ingest pipeline
- Add ExternalWorkOrderId, Customer, SiteCode, Building, Severity,
DateReported, ScheduledStart, SourceEmailS3Key to WorkOrder model
- Add Commenter, RecordType, ExternalCommentId to Comments model
- Add AWSSDK.DynamoDBv2 package
- Create SyncController with endpoints:
- POST /api/Sync/WorkOrders — scans DynamoDB WorkOrders table, upserts into SQL
- POST /api/Sync/Comments — scans DynamoDB WorkOrderComments, creates Comments
- POST /api/Sync/All — runs both
- Auto-creates Locations from site_code/building/address during sync
- Maps DynamoDB status values to SHOC status strings
- Maps severity to SHOC priority format (Sev N)
- Deduplicates on ExternalWorkOrderId / ExternalCommentId
2026-04-16 17:29:52 -04:00
|
|
|
|
public string? ExternalWorkOrderId { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
public string? WorkerOrderNumber { get; set; }
|
|
|
|
|
|
public string? WorkerOrderTitle { get; set; }
|
|
|
|
|
|
public string? Description { get; set; }
|
Add DynamoDB sync bridge for workorder-ingest pipeline
- Add ExternalWorkOrderId, Customer, SiteCode, Building, Severity,
DateReported, ScheduledStart, SourceEmailS3Key to WorkOrder model
- Add Commenter, RecordType, ExternalCommentId to Comments model
- Add AWSSDK.DynamoDBv2 package
- Create SyncController with endpoints:
- POST /api/Sync/WorkOrders — scans DynamoDB WorkOrders table, upserts into SQL
- POST /api/Sync/Comments — scans DynamoDB WorkOrderComments, creates Comments
- POST /api/Sync/All — runs both
- Auto-creates Locations from site_code/building/address during sync
- Maps DynamoDB status values to SHOC status strings
- Maps severity to SHOC priority format (Sev N)
- Deduplicates on ExternalWorkOrderId / ExternalCommentId
2026-04-16 17:29:52 -04:00
|
|
|
|
public string? Customer { get; set; }
|
|
|
|
|
|
public string? SiteCode { get; set; }
|
|
|
|
|
|
public string? Building { get; set; }
|
|
|
|
|
|
public string? Severity { get; set; }
|
|
|
|
|
|
public DateTime? DateReported { get; set; }
|
|
|
|
|
|
public DateTime? ScheduledStart { get; set; }
|
|
|
|
|
|
public string? SourceEmailS3Key { get; set; }
|
Add configurable dropdowns, new WO fields, and seed data
- Create DropdownOption model with Category, Value, ParentValue for Trade/SubTrade/Problem
- Add DropdownOptionsController with CRUD + ByCategory endpoint with parent filtering
- Add Problem, Trade, SubTrade, VendorNTE, ScheduledDate, CompletedDate, Source to WorkOrder
- Update EditWorkorder_DTO and GetWorkorderById with new fields
- Audit log tracks changes to all new fields
- Seed default Trades (10), SubTrades (20), and Problems (11) on startup
2026-04-17 10:40:38 -04:00
|
|
|
|
public string? Problem { get; set; }
|
|
|
|
|
|
public string? Trade { get; set; }
|
|
|
|
|
|
public string? SubTrade { get; set; }
|
|
|
|
|
|
public decimal? VendorNTE { get; set; }
|
|
|
|
|
|
public DateTime? ScheduledDate { get; set; }
|
|
|
|
|
|
public DateTime? CompletedDate { get; set; }
|
|
|
|
|
|
public string? Source { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
public bool? istemplate { get; set; }
|
|
|
|
|
|
public string? PO { get; set; }
|
|
|
|
|
|
public string? TT { get; set; }
|
|
|
|
|
|
//public int? ContactId { get; set; }
|
|
|
|
|
|
//[ForeignKey(nameof(ContactId))]
|
|
|
|
|
|
//public virtual Contacts? POC { get; set; }
|
|
|
|
|
|
public string? AssignTo { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(AssignTo))]
|
|
|
|
|
|
public virtual ApplicationUser? AssignToUser { get; set; }
|
|
|
|
|
|
public DateTime? DueDate { get; set; }
|
|
|
|
|
|
public string? Priority { get; set; }
|
|
|
|
|
|
public string? Status { get; set; }
|
|
|
|
|
|
public int? LocationId { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(LocationId))]
|
|
|
|
|
|
public virtual Locations? Locations { get; set; }
|
|
|
|
|
|
//public int? CategoryId { get; set; }
|
|
|
|
|
|
//[ForeignKey(nameof(CategoryId))]
|
|
|
|
|
|
//public virtual Category? Category { get; set; }
|
|
|
|
|
|
public string? Attachments { get; set; }
|
|
|
|
|
|
public string? BeforPhotoIssue { get; set; }
|
|
|
|
|
|
public string? BeforPhotoAttachment { get; set; }
|
|
|
|
|
|
public string? AfterPhotoIssue { get; set; }
|
|
|
|
|
|
public string? AfterPhotoAttachment { get; set; }
|
|
|
|
|
|
public string? SignOffName { get; set; }
|
|
|
|
|
|
public string? SignOffAttachment { get; set; }
|
|
|
|
|
|
public string? SignOffSignature { get; set; }
|
|
|
|
|
|
public ICollection<Comments>? Comments { get; set; }
|
|
|
|
|
|
public ICollection<Quotes>? Quotes { get; set; }
|
|
|
|
|
|
public ICollection<WorkOrderContacts>? WorkOrderContacts { get; set; }
|
|
|
|
|
|
public ICollection<WorkOrderAttachments>? workOrderAttachments { get; set; }
|
|
|
|
|
|
public ICollection<WorkOrderCategories>? WorkOrderCategories { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|