mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-06 19:22:12 +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,
|
TechPhone = row.TechPhone,
|
||||||
ApptDate = row.DispatchApptDate ?? row.ScheduledDate,
|
ApptDate = row.DispatchApptDate ?? row.ScheduledDate,
|
||||||
ApptTime = WorkOrderDerivedFields.FormatApptTime(apptStart, apptEnd),
|
ApptTime = WorkOrderDerivedFields.FormatApptTime(apptStart, apptEnd),
|
||||||
Pm = row.ServiceNameSnapshot ?? row.Trade ?? row.Problem,
|
Pm = row.Trade ?? row.ServiceNameSnapshot ?? row.Problem,
|
||||||
ServiceNotes = row.ServiceNotes,
|
ServiceNotes = row.ServiceNotes,
|
||||||
ExtraServices = ParseExtraServices(row.ExtraServices),
|
ExtraServices = ParseExtraServices(row.ExtraServices),
|
||||||
AdditionalContacts = MapAdditionalContacts(row),
|
AdditionalContacts = MapAdditionalContacts(row),
|
||||||
|
|
|
||||||
|
|
@ -1043,6 +1043,24 @@ public class WorkOrderBoardServiceTests
|
||||||
Assert.Equal("09:00", dto.ApptTime);
|
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(
|
private static WorkOrderBoardRawRow RawRow(
|
||||||
DateTime? scheduledDate,
|
DateTime? scheduledDate,
|
||||||
DateTime? scheduledStart,
|
DateTime? scheduledStart,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue