mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 08:23:12 +00:00
fix(work-orders): copy persisted severity onto GET detail
EOF
This commit is contained in:
parent
7a0b91bcd6
commit
9a0d3fb74c
2 changed files with 24 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue