implement empty-container return service: add return quantity handling, update related DTOs, services, and UI components

This commit is contained in:
Marshal
2026-07-15 22:48:04 +00:00
parent fc44eee25e
commit 234a74e812
20 changed files with 324 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import {
NotFoundException,
} from '@nestjs/common';
import { DataSource, EntityManager, ILike, In } from 'typeorm';
import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
import { Locomotive } from '../locomotives/entities/locomotive.entity';
import { Yard } from '../rule-engine/entities/yard.entity';
@@ -343,7 +344,7 @@ export class TrainBuilderService {
await this.dataSource.transaction(async (manager) => {
const train = await this.getEditableTrain(manager, id);
const patch: Partial<Train> = {};
const patch: QueryDeepPartialEntity<Train> = {};
if (dto.trainName !== undefined) {
patch.trainName = dto.trainName.trim() || null;
}