Merge pull request #757 from Tria-plc/freight/feature/user_management_UI

Freight/feature/user management UI
This commit is contained in:
yaschalew10
2026-07-17 12:37:22 +03:00
committed by GitHub
6 changed files with 129 additions and 1 deletions

View File

@@ -20,6 +20,16 @@ export class CreateWagonDto {
// Tare weight and payload capacity are not accepted here: they belong to the
// wagon type and are resolved through wagonTypeId.
/** EXPORT run number — odd, Ethiopia → Djibouti (e.g. 8001). */
@IsOptional()
@IsString()
exportTrainNumber?: string;
/** IMPORT run number — even, Djibouti → Ethiopia (e.g. 8002). */
@IsOptional()
@IsString()
importTrainNumber?: string;
@IsOptional()
@IsEnum(WagonStatus)
status?: WagonStatus;

View File

@@ -43,6 +43,14 @@ export class Wagon extends BaseEntity {
// Tare weight and payload capacity are properties of the wagon TYPE — read them
// through `wagonType`, never off the individual wagon.
/** EXPORT run number — odd, Ethiopia → Djibouti (e.g. 8001). Null until set. */
@Column({ name: 'export_train_number', type: 'varchar', length: 20, nullable: true })
exportTrainNumber!: string | null;
/** IMPORT run number — even, Djibouti → Ethiopia (e.g. 8002). Null until set. */
@Column({ name: 'import_train_number', type: 'varchar', length: 20, nullable: true })
importTrainNumber!: string | null;
@Column({ type: 'varchar', length: 20, default: WagonStatus.Available })
status!: WagonStatusType;

View File

@@ -38,6 +38,8 @@ export class WagonsService {
if (dto.trainId === undefined) wagon.trainId = null;
if (dto.sequenceNumber === undefined) wagon.sequenceNumber = null;
if (dto.currentYardId === undefined) wagon.currentYardId = null;
if (dto.exportTrainNumber === undefined) wagon.exportTrainNumber = null;
if (dto.importTrainNumber === undefined) wagon.importTrainNumber = null;
return this.wagonRepo.save(wagon);
}