add CUSTOMS type to priority configs and update related logic

This commit is contained in:
Marshal
2026-07-07 16:42:57 +00:00
parent f300600bfa
commit b57840c907
26 changed files with 352 additions and 120 deletions

View File

@@ -2,9 +2,12 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsIn, IsInt, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
export class CreatePriorityConfigDto {
@ApiProperty({ description: 'Config type: WAGON or CURRENCY', enum: ['WAGON', 'CURRENCY'] })
@IsIn(['WAGON', 'CURRENCY'])
type!: 'WAGON' | 'CURRENCY';
@ApiProperty({
description: 'Config type: WAGON, CURRENCY, or CUSTOMS',
enum: ['WAGON', 'CURRENCY', 'CUSTOMS'],
})
@IsIn(['WAGON', 'CURRENCY', 'CUSTOMS'])
type!: 'WAGON' | 'CURRENCY' | 'CUSTOMS';
@ApiProperty({ description: 'Human-readable label', maxLength: 100 })
@IsString()
@@ -12,7 +15,8 @@ export class CreatePriorityConfigDto {
label!: string;
@ApiPropertyOptional({
description: 'Currency code (e.g., USD, ETB). Required for type=CURRENCY, must be null for type=WAGON',
description:
'Currency code (e.g., USD, ETB). Required for type=CURRENCY, must be null for type=WAGON and type=CUSTOMS',
maxLength: 5,
})
@IsOptional()