add GL operations for customs risk assignment, duty advising, and incident reporting

This commit is contained in:
Marshal
2026-06-28 16:09:45 +00:00
parent 7c744352d1
commit e1d54746c2
31 changed files with 1879 additions and 29 deletions

View File

@@ -0,0 +1,77 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsIn,
IsNumber,
IsOptional,
IsPositive,
IsString,
IsUUID,
MinLength,
} from 'class-validator';
import { CUSTOMS_RISK_LEVELS } from '../entities/clearance-milestone.entity';
import { INCIDENT_TYPES } from '../entities/clearance-incident.entity';
export class AssignRiskDto {
@ApiProperty({ enum: CUSTOMS_RISK_LEVELS })
@IsIn(CUSTOMS_RISK_LEVELS as unknown as string[])
riskLevel!: (typeof CUSTOMS_RISK_LEVELS)[number];
@ApiPropertyOptional()
@IsOptional()
@IsString()
note?: string;
}
export class AdviseDutyDto {
@ApiProperty({ description: 'Duty & tax amount advised to the customer' })
@Type(() => Number)
@IsNumber()
@IsPositive()
amount!: number;
@ApiProperty({ example: 'ETB' })
@IsString()
@MinLength(1)
currency!: string;
@ApiPropertyOptional({ description: 'Customs declaration serial number' })
@IsOptional()
@IsString()
declarationSerial?: string;
@ApiPropertyOptional()
@IsOptional()
@IsString()
note?: string;
}
export class AssignStationDto {
@ApiProperty({ description: 'Origin-station yard the shipment is routed to' })
@IsUUID()
stationYardId!: string;
@ApiPropertyOptional({ description: 'GL staff user bound to this shipment' })
@IsOptional()
@IsUUID()
staffId?: string;
}
export class ReportIncidentDto {
@ApiProperty({ enum: INCIDENT_TYPES })
@IsIn(INCIDENT_TYPES as unknown as string[])
incidentType!: (typeof INCIDENT_TYPES)[number];
@ApiProperty({ description: 'Mandatory free-text narrative of the anomaly' })
@IsString()
@MinLength(1)
description!: string;
}
export class CompleteMilestoneDto {
@ApiPropertyOptional()
@IsOptional()
@IsString()
note?: string;
}