fix(work-orders): copy persisted severity onto GET detail

EOF
This commit is contained in:
Arthur Bassi 2026-09-07 12:02:23 -03:00
parent 7a0b91bcd6
commit 9a0d3fb74c
2 changed files with 24 additions and 0 deletions

View file

@ -130,6 +130,7 @@ namespace SeaHaven.Services.Implementation
ExtraServices = ParseExtraServices(extended?.ExtraServices) ?? row.ExtraServices,
DocStatus = row.DocStatus,
FlagColor = row.FlagColor,
Severity = row.Severity,
PrimaryDispatchId = row.PrimaryDispatchId,
RowVersion = row.RowVersion,
DispatchRowVersion = row.DispatchRowVersion,

View file

@ -216,6 +216,29 @@ public class WorkOrderDetailServiceTests
Assert.Equal(1500m, detail.Info.UpliftSummary.Amount);
}
[Fact]
public async Task GetDetail_SurfacesSeverityFromBoardRow()
{
var (context, service) = CreateSut();
context.workOrders.Add(new WorkOrder
{
Id = 1,
InternalWONumber = "10000000001",
LifecycleStatus = LifecycleStatus.Scheduled,
WorkOrderType = WorkOrderType.Emergency,
Severity = "2",
ScheduledDate = DateTime.UtcNow.AddDays(1),
SiteCode = "BK5",
RowVersion = new byte[] { 1, 0, 0, 0, 0, 0, 0, 1 }
});
await context.SaveChangesAsync();
var detail = await service.GetDetailAsync(1, WorkOrderAccountTestHelpers.OrgWideAdmin());
Assert.NotNull(detail);
Assert.Equal(2, detail!.Info.Severity);
}
[Fact]
public async Task GetDetail_InactivePrimaryDispatch_OmitsVendorAndMapsStatus()
{