mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 10:43:13 +00:00
fix(work-orders): honor edited service labels
This commit is contained in:
parent
33f517620b
commit
65b04687bc
2 changed files with 19 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ namespace SeaHaven.Services.Implementation
|
|||
TechPhone = row.TechPhone,
|
||||
ApptDate = row.DispatchApptDate ?? row.ScheduledDate,
|
||||
ApptTime = WorkOrderDerivedFields.FormatApptTime(apptStart, apptEnd),
|
||||
Pm = row.ServiceNameSnapshot ?? row.Trade ?? row.Problem,
|
||||
Pm = row.Trade ?? row.ServiceNameSnapshot ?? row.Problem,
|
||||
ServiceNotes = row.ServiceNotes,
|
||||
ExtraServices = ParseExtraServices(row.ExtraServices),
|
||||
AdditionalContacts = MapAdditionalContacts(row),
|
||||
|
|
|
|||
|
|
@ -1043,6 +1043,24 @@ public class WorkOrderBoardServiceTests
|
|||
Assert.Equal("09:00", dto.ApptTime);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MapRawRow_PmEditTakesPrecedenceOverServiceSnapshot()
|
||||
{
|
||||
var row = RawRow(
|
||||
scheduledDate: new DateTime(2026, 6, 23),
|
||||
scheduledStart: null,
|
||||
scheduledEnd: null,
|
||||
dispatchApptDate: null) with
|
||||
{
|
||||
Trade = "Updated service label",
|
||||
ServiceNameSnapshot = "Original service label"
|
||||
};
|
||||
|
||||
var dto = WorkOrderBoardService.MapRawRow(row, DateTime.UtcNow);
|
||||
|
||||
Assert.Equal("Updated service label", dto.Pm);
|
||||
}
|
||||
|
||||
private static WorkOrderBoardRawRow RawRow(
|
||||
DateTime? scheduledDate,
|
||||
DateTime? scheduledStart,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue