fix issues

This commit is contained in:
Marshal
2026-07-09 20:26:14 +00:00
parent 1d77cc9219
commit e4429592d3
29 changed files with 1143 additions and 147 deletions

View File

@@ -2514,6 +2514,12 @@ export class TrainSchedulingService {
if (dto.sequenceNo === finalSeq) {
await this.arriveSchedule(scheduleId);
} else {
// Mid-corridor auto-unload: bookings destined for this yard alight the
// moment the train is recorded here — the yard operator no longer has to
// unload each one by hand. The final station is covered by
// arriveSchedule's bulk fallback above.
await this.bookingJourneyService.autoUnloadAtYard(scheduleId, station.yardId);
}
return this.getScheduleCheckpoints(scheduleId);
@@ -4518,6 +4524,11 @@ export class TrainSchedulingService {
capacityTons: roundTons(Number(wagon.capacityTons)),
lengthMeters: roundTons(Number(wagon.lengthMeters)),
assignedWeightTons: roundTons(Number(wagon.assignedWeightTons)),
// Empty-wagon weight — the pull limit hauls tare + cargo, so the
// frontend needs it to show the gross train weight.
tareWeightTons: wagon.wagonType
? roundTons(Number(wagon.wagonType.tareWeightTons))
: null,
status: wagon.status,
physicalWagonId: wagon.physicalWagonId ?? null,
physicalWagonNumber: wagon.physicalWagon?.wagonNumber ?? null,