mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-05 03:43:39 +00:00
45 lines
840 B
TypeScript
45 lines
840 B
TypeScript
import { Type } from "class-transformer";
|
|
import {
|
|
IsArray,
|
|
IsEnum,
|
|
IsOptional,
|
|
IsString,
|
|
MaxLength,
|
|
ValidateNested,
|
|
} from "class-validator";
|
|
|
|
import { CreateFileUploadFieldDto } from "./create-file-upload-field.dto";
|
|
|
|
export enum FileUploadEntityDto {
|
|
Customer = "customer",
|
|
Booking = "booking",
|
|
Consignment = "consignment",
|
|
Shipment = "shipment",
|
|
Invoice = "invoice",
|
|
Train = "train",
|
|
Other = "other",
|
|
}
|
|
|
|
export class CreateFileUploadSettingDto {
|
|
@IsString()
|
|
@MaxLength(128)
|
|
code!: string;
|
|
|
|
@IsString()
|
|
@MaxLength(256)
|
|
label!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsEnum(FileUploadEntityDto)
|
|
entity!: FileUploadEntityDto;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => CreateFileUploadFieldDto)
|
|
fields?: CreateFileUploadFieldDto[];
|
|
}
|