mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 14:08:11 +00:00
Project Initialization
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Freight } from '@edr/types';
|
||||
import { IsEnum, IsNumber, IsString, IsUUID, Min } from 'class-validator';
|
||||
|
||||
export class CreateConsignmentDto {
|
||||
@IsUUID()
|
||||
bookingId!: string;
|
||||
|
||||
@IsString()
|
||||
trackingNumber!: string;
|
||||
|
||||
@IsEnum(Freight.CargoType)
|
||||
cargoType!: Freight.CargoType;
|
||||
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
weightKg!: number;
|
||||
|
||||
@IsString()
|
||||
originStation!: string;
|
||||
|
||||
@IsString()
|
||||
destinationStation!: string;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Freight } from '@edr/types';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsInt, IsOptional, IsUUID, Min } from 'class-validator';
|
||||
|
||||
export class FilterConsignmentDto {
|
||||
@IsOptional()
|
||||
@IsEnum(Freight.ConsignmentStatus)
|
||||
status?: Freight.ConsignmentStatus;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
bookingId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
page?: number = 1;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
pageSize?: number = 20;
|
||||
}
|
||||
Reference in New Issue
Block a user