Refactor wagon specifications to rely on wagon type; remove tare weight and max payload from wagon entity and related components

This commit is contained in:
Marshal
2026-07-09 07:42:02 +00:00
parent cd8fb2b321
commit 61ec67cc2e
13 changed files with 99 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
import { WagonStatus } from '@edr/types';
import { IsString, IsUUID, IsOptional, IsInt, Min, IsNumber, IsEnum } from 'class-validator';
import { IsString, IsUUID, IsOptional, IsInt, Min, IsEnum } from 'class-validator';
export class CreateWagonDto {
@IsString()
@@ -17,13 +17,8 @@ export class CreateWagonDto {
@Min(1)
sequenceNumber?: number;
@IsNumber()
@Min(0)
tareWeight!: number;
@IsNumber()
@Min(0)
maxPayloadWeight!: number;
// Tare weight and payload capacity are not accepted here: they belong to the
// wagon type and are resolved through wagonTypeId.
@IsOptional()
@IsEnum(WagonStatus)