This commit is contained in:
Marshal
2026-07-14 13:10:00 +00:00
parent 6d0cf50b4d
commit b5a97d344a
36 changed files with 1101 additions and 355 deletions

View File

@@ -4,6 +4,7 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
import { Yard } from '../../rule-engine/entities/yard.entity';
import { Wagon } from './wagon.entity';
import { WagonTransferRequest } from './wagon-transfer-request.entity';
/**
* Ledger of every physical wagon relocation between yards — one row per move.
@@ -51,6 +52,14 @@ export class WagonMovement extends BaseEntity {
@Column({ name: 'moved_by_user_id', type: 'uuid', nullable: true })
movedByUserId?: string | null;
/** The transfer request this move fulfilled, when it came from one. */
@Column({ name: 'transfer_request_id', type: 'uuid', nullable: true })
transferRequestId?: string | null;
@ManyToOne(() => WagonTransferRequest, { nullable: true })
@JoinColumn({ name: 'transfer_request_id' })
transferRequest?: WagonTransferRequest | null;
@Column({ name: 'occurred_at', type: 'timestamptz' })
occurredAt!: Date;