;
+ // Intercity (Marshalling 2) only: couples/switches logged at the stop
+ // this document is printed at (see ScheduleWagonAdjustmentLog). Origin
+ // import/export docs never pass this, so they render no such box.
+ consistChangesAtStop?: ScheduleWagonAdjustmentLog[];
},
): string {
const esc = (value: unknown) =>
@@ -3844,6 +3859,24 @@ export class TrainSchedulingService {
${opts?.positionLabel ? `Current position${esc(opts.positionLabel)}
` : ''}
+ ${
+ opts?.consistChangesAtStop?.length
+ ? `
+ Consist changed at this stop:
+ ${(() => {
+ const coupled = opts.consistChangesAtStop.filter((row) => row.action === 'ADD');
+ const switched = opts.consistChangesAtStop.filter((row) => row.action === 'SWITCH');
+ return [
+ coupled.length ? `Coupled: ${esc(coupled.map((row) => row.wagonNumber).join(', '))}` : '',
+ switched.length ? `Uncoupled — replaced: ${esc(switched.map((row) => row.wagonNumber).join(', '))}` : '',
+ ]
+ .filter(Boolean)
+ .join(' | ');
+ })()}
+
`
+ : ''
+ }
+