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 Comments : FullAuditEntity
|
|
|
|
|
|
{
|
|
|
|
|
|
public string? Commenttext { 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? Commenter { get; set; }
|
|
|
|
|
|
public string? RecordType { get; set; }
|
2026-04-16 18:09:57 -04:00
|
|
|
|
public string? CommentType { 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? ExternalCommentId { get; set; }
|
2026-07-24 22:13:25 -03:00
|
|
|
|
public string? ExternalSource { get; set; }
|
|
|
|
|
|
public DateTimeOffset? ExternalUpdatedAt { get; set; }
|
|
|
|
|
|
public string? ExternalVersionHash { get; set; }
|
|
|
|
|
|
public string? ExternalSourceEmailS3Key { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
public string? Documents { get; set; }
|
|
|
|
|
|
public string? UserId { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(UserId))]
|
|
|
|
|
|
public virtual ApplicationUser? ApplicationUser { get; set; }
|
|
|
|
|
|
public int? WorkerOrderId { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(WorkerOrderId))]
|
|
|
|
|
|
public virtual WorkOrder? WorkOrder { get; set; }
|
2026-04-17 14:01:03 -04:00
|
|
|
|
public int? DispatchId { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(DispatchId))]
|
|
|
|
|
|
public virtual Dispatch? Dispatch { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|