import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { ArrayNotEmpty, IsArray, IsDefined, IsEmail, IsIn, IsInt, IsNumber, IsObject, IsOptional, IsString, Length, Max, Min, min, ValidateNested } from 'class-validator'; export class InsertRegionsDto { @ApiProperty() @IsString() p_region: string; @ApiProperty() @IsString() p_name: string; } export class UpdateRegionDto { @ApiProperty({ required: true }) @IsNumber() p_regionID: number; @ApiProperty({ required: true }) @IsString() p_name: string; } // export class GetSelectedServiceProviderDTO { // @IsNumber() // p_spid: number; // } export class InsertNewServiceProviderDTO { @ApiProperty({ required: true }) @IsString() p_name: string; @ApiProperty({ required: true }) @IsString() p_lookupcode: string; @ApiProperty({ required: true }) @IsString() p_address1: string; @ApiProperty({ required: false }) @IsString() p_address2: string; @ApiProperty({ required: true }) @IsString() p_city: string; @ApiProperty({ required: true }) @IsString() p_state: string; @ApiProperty({ required: true }) @IsString() p_zip: string; @ApiProperty({ required: true }) @IsString() p_country: string; @ApiProperty({ required: true }) @IsString() p_issuingregion: string; @ApiProperty({ required: true }) @IsString() p_replacementregion: string; @ApiProperty({ required: true }) @IsString() p_bondsurety: string; @ApiProperty({ required: true }) @IsString() p_cargopolicyno: string; @ApiProperty({ required: true }) @IsString() p_cargosurety: string; @ApiProperty({ required: true }) @IsString() p_user_id: string; @ApiProperty({ required: false }) @IsString() P_NOTES: string; @ApiProperty({ required: false }) @IsString() P_FILEIDS: string; } export class UpdateServiceProviderDTO { @ApiProperty({ required: true }) @IsNumber() p_spid: number; @ApiProperty({ required: true }) @IsString() p_name: string; @ApiProperty({ required: true }) @IsString() p_lookupcode: string; @ApiProperty({ required: true }) @IsString() p_address1: string; @ApiProperty({ required: false }) @IsString() p_address2: string; @ApiProperty({ required: true }) @IsString() p_city: string; @ApiProperty({ required: true }) @IsString() p_state: string; @ApiProperty({ required: true }) @IsString() p_zip: string; @ApiProperty({ required: true }) @IsString() p_country: string; @ApiProperty({ required: true }) @IsString() p_issuingregion: string; @ApiProperty({ required: true }) @IsString() p_replacementregion: string; @ApiProperty({ required: true }) @IsString() p_bondsurety: string; @ApiProperty({ required: true }) @IsString() p_cargopolicyno: string; @ApiProperty({ required: true }) @IsString() p_cargosurety: string; @ApiProperty({ required: true }) @IsString() p_user_id: string; @ApiProperty({ required: false }) @IsString() P_NOTES: string; @ApiProperty({ required: false }) @IsString() P_FILEIDS: string; } // export class GetSPcontactsDTO { // @IsNumber() // p_SPid: number; // } export class InsertSPContactsDTO { @ApiProperty({ required: true }) @IsNumber() p_spid: number; @ApiProperty({ required: true }) @IsString() p_defcontactflag: string; @ApiProperty({ required: true }) @IsString() p_firstname: string; @ApiProperty({ required: true }) @IsString() p_lastname: string; @ApiProperty({ required: false }) @IsString() P_MIDDLEINITIAL: string; @ApiProperty({ required: true }) @IsString() p_title: string; @ApiProperty({ required: true }) @IsString() p_phoneno: string; @ApiProperty({ required: true }) @IsString() p_mobileno: string; @ApiProperty({ required: true }) @IsString() p_faxno: string; @ApiProperty({ required: true }) @IsEmail() p_emailaddress: string; @ApiProperty({ required: true }) @IsString() p_user_id: string; } export class UpdateSPContactsDTO { @ApiProperty({ required: true }) @IsNumber() p_spcontactid: number; @ApiProperty({ required: true }) @IsString() p_firstname: string; @ApiProperty({ required: true }) @IsString() p_lastname: string; @ApiProperty({ required: false }) @IsString() P_MIDDLEINITIAL: string; @ApiProperty({ required: true }) @IsString() p_title: string; @ApiProperty({ required: true }) @IsString() p_phoneno: string; @ApiProperty({ required: true }) @IsString() p_mobileno: string; @ApiProperty({ required: true }) @IsString() p_faxno: string; @ApiProperty({ required: true }) @IsEmail() p_emailaddress: string; @ApiProperty({ required: true }) @IsString() p_user_id: string; } export class CreateCarnetSequenceDTO { @ApiProperty({ required: true }) @IsNumber() p_spid: number; @ApiProperty({ required: true }) @IsNumber() p_regionid: number; @ApiProperty({ required: true }) @IsNumber() p_startnumber: number; @ApiProperty({ required: true }) @IsNumber() p_endnumber: number; @ApiProperty({ required: true }) @IsString() p_carnettype: string; } export class CreateTableRecordDTO { @ApiProperty({ required: true }) @IsString() P_USERID: string; @ApiProperty({ required: true }) @IsString() P_TABLEFULLDESC: string; } export class CreateParamRecordDTO { @ApiProperty({ required: false }) @IsOptional() @IsNumber() P_SPID?: number; @ApiProperty({ required: true }) @IsString() P_PARAMTYPE: string; @ApiProperty({ required: true }) @IsString() P_PARAMDESC: string; @ApiProperty({ required: true }) @IsString() P_PARAMVALUE: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE1?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE2?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE3?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE4?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE5?: string; @ApiProperty({ required: true }) @IsNumber() P_SORTSEQ: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateParamRecordDTO { @ApiProperty({ required: false }) @IsOptional() @IsNumber() P_SPID?: number; @ApiProperty({ required: true }) @IsNumber() P_PARAMID: number; @ApiProperty({ required: true }) @IsString() P_PARAMDESC: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE1?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE2?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE3?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE4?: string; @ApiProperty({ required: false }) @IsOptional() @IsString() P_ADDLPARAMVALUE5?: string; @ApiProperty({ required: true }) @IsNumber() P_SORTSEQ: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateBasicFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsNumber() P_STARTCARNETVALUE: number; @ApiProperty({ required: true }) @IsNumber() P_ENDCARNETVALUE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsNumber() P_FEES: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateBondRateDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsString() P_HOLDERTYPE: string; @ApiProperty({ required: true }) @IsString() P_USCIBMEMBERFLAG: string; @ApiProperty({ required: true }) @IsString() P_SPCLCOMMODITY: string; @ApiProperty({ required: true }) @IsString() P_SPCLCOUNTRY: string; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateCargoRateDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsString() P_CARNETTYPE: string; @ApiProperty({ required: true }) @IsNumber() P_STARTSETS: number; @ApiProperty({ required: true }) @IsNumber() P_ENDSETS: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateCfFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsNumber() P_STARTSETS: number; @ApiProperty({ required: true }) @IsNumber() P_ENDSETS: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_CUSTOMERTYPE: string; @ApiProperty({ required: true }) @IsString() P_CARNETTYPE: string; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateCsFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsString() P_CUSTOMERTYPE: string; @ApiProperty({ required: true }) @IsString() P_CARNETTYPE: string; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateEfFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsString() P_CUSTOMERTYPE: string; @ApiProperty({ required: true }) @IsString() P_DELIVERYTYPE: string; @ApiProperty({ required: true }) @IsNumber() P_STARTTIME: number; @ApiProperty({ required: true }) @IsNumber() P_ENDTIME: number; @ApiProperty({ required: true }) @IsString() P_TIMEZONE: string; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsNumber() P_FEES: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class CreateFeeCommDTO { @ApiProperty({ required: true }) @IsNumber() P_SPID: number; @ApiProperty({ required: true }) @IsNumber() P_PARAMID: number; @ApiProperty({ required: true }) @IsNumber() P_COMMRATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateBasicFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_BASICFEESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_FEES: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateBondRateDTO { @ApiProperty({ required: true }) @IsNumber() P_BONDRATESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateCargoRateDTO { @ApiProperty({ required: true }) @IsNumber() P_CARGORATESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateCfFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_CFFEESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateCsFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_CSFEESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } export class UpdateEfFeeDTO { @ApiProperty({ required: true }) @IsNumber() P_EFFEESETUPID: number; @ApiProperty({ required: true }) @IsNumber() P_FEES: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } // Existing UpdateFeeCommDTO export class UpdateFeeCommDTO { @ApiProperty({ required: true }) @IsNumber() P_FEECOMMID: number; @ApiProperty({ required: true }) @IsNumber() P_RATE: number; @ApiProperty({ required: true }) @IsString() P_EFFDATE: string; @ApiProperty({ required: true }) @IsString() P_USERID: string; } // New UpdateFeeCommBodyDTO export class UpdateFeeCommBodyDTO { @ApiProperty({ type: UpdateFeeCommDTO, required: true }) // Correctly reference UpdateFeeCommDTO p_fees_comm: UpdateFeeCommDTO; // No need for @IsObject() } export class ActivateOrInactivateParamRecordDTO { @ApiProperty({ required: true }) @IsNumber() P_PARAMID: number; @ApiProperty({ required: true }) @IsString() P_USERID: string; } // Homepage export class p_gltableDTO { @ApiProperty({ required: true }) @Max(999999999, { message: "Property ItemNo must not exceed 999999999" }) @Min(0, { message: "Property ItemNo must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property ItemNo must be a number" }) @IsDefined({ message: "Property ItemNo is required" }) ItemNo: number; @ApiProperty({ required: true }) @Length(0, 1000, { message: "Property ItemDescription must be between 1 and 1000 characters" }) @IsString({ message: "Property ItemDescription should be string" }) @IsDefined({ message: "Property ItemDescription is required" }) ItemDescription: string; @ApiProperty({ required: true }) @IsNumber({},{ message: "Property ItemValue should be number" }) @IsDefined({ message: "Property ItemValue is required" }) ItemValue: number; @ApiProperty({ required: true }) @Max(99999999999, { message: "Property Noofpieces must not exceed 99999999999" }) @Min(0, { message: "Property Noofpieces must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property Noofpieces must be a number" }) @IsDefined({ message: "Property Noofpieces is required" }) Noofpieces: number; @ApiProperty({ required: false }) @IsNumber() @IsOptional() ItemWeight?: number; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property ItemWeightUOM must be between 0 and 10 characters" }) @IsString() @IsOptional() ItemWeightUOM?: string; @ApiProperty({ required: true }) @Length(0, 2, { message: "Property GoodsOriginCountry must be between 0 and 2 characters" }) @IsString({ message: "Property GoodsOriginCountry should be string" }) @IsDefined({ message: "Property name is required" }) GoodsOriginCountry: string; } export class p_countrytableDTO { @ApiProperty({ required: true }) @Length(0, 1, { message: "Property VisitTransitInd must be 0 to 1 characters" }) @IsString() @IsDefined({ message: "Property VisitTransitInd is required" }) VisitTransitInd: string; @ApiProperty({ required: true }) @Length(0, 2, { message: "Property CountryCode must be between 0 to 2 characters" }) @IsString() @IsDefined({ message: "Property CountryCode is required" }) CountryCode: string; @ApiProperty({ required: true }) @Max(999, { message: "Property NoOfTimesEntLeave must not exceed 999" }) @Min(0, { message: "Property NoOfTimesEntLeave must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property NoOfTimesEntLeave must be a number" }) @IsDefined({ message: "Property NoOfTimesEntLeave is required" }) NoOfTimesEntLeave: number; } export class SaveCarnetApplicationDTO { @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_spid must not exceed 999999999" }) @Min(0, { message: "Property p_spid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_spid must be a number" }) p_spid: number; @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_clientid must not exceed 999999999" }) @Min(0, { message: "Property p_clientid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_clientid must be a number" }) p_clientid: number; @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_locationid must not exceed 999999999" }) @Min(0, { message: "Property p_locationid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_locationid must be a number" }) p_locationid: number; @ApiProperty({ required: true }) @Length(0, 50, { message: "Property p_userid must be between 0 to 50 characters" }) @IsString() p_userid: string; @ApiProperty({ required: false }) @Max(999999999, { message: "Property p_headerid must not exceed 999999999" }) @Min(0, { message: "Property p_headerid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_headerid must be a number" }) @IsOptional() p_headerid?: number; @ApiProperty({ required: true }) @Length(0, 50, { message: "Property p_applicationname must be between 0 to 50 characters" }) @IsString() p_applicationname: string; @ApiProperty({ required: false }) @Max(999999999, { message: "Property p_holderid must not exceed 999999999" }) @Min(0, { message: "Property p_holderid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_holderid must be a number" }) @IsOptional() p_holderid?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_commercialsampleflag must be between 0 to 1 characters" }) @IsString() @IsOptional() p_commercialsampleflag?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_profequipmentflag must be between 0 to 1 characters" }) @IsString() @IsOptional() p_profequipmentflag?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_exhibitionsfairflag must be between 0 to 1 characters" }) @IsString() @IsOptional() p_exhibitionsfairflag?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_autoflag must be between 0 to 1 characters" }) @IsString() @IsOptional() p_autoflag?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_horseflag must be between 0 to 1 characters" }) @IsString() @IsOptional() p_horseflag?: number; @ApiProperty({ required: false }) @Length(0, 200, { message: "Property p_authrep must be between 0 to 200 characters" }) @IsString() @IsOptional() p_authrep?: string; @ApiProperty({ required: false, type: () => [p_gltableDTO] }) @Type(() => p_gltableDTO) @ValidateNested({ each: true }) @IsArray() // @ArrayNotEmpty({message:"Property gltable should not be empty"}) @IsOptional() p_gltable?: p_gltableDTO[]; @ApiProperty({ required: false }) @Max(99999, { message: "Property p_ussets must not exceed 99999" }) @Min(0, { message: "Property p_ussets must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_ussets must be a number" }) @IsOptional() p_ussets?: number; @ApiProperty({ required: false, type: () => [p_countrytableDTO] }) @ValidateNested({ each: true }) @IsArray() @Type(() => p_countrytableDTO) @IsOptional() p_countrytable?: p_countrytableDTO[]; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_shiptotype must be between 0 to 10 characters" }) @IsString() @IsOptional() p_shiptotype?: string; @ApiProperty({ required: false }) @Max(999999999, { message: "Property p_shipaddrid must not exceed 999999999" }) @Min(0, { message: "Property p_shipaddrid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_shipaddrid must be a number" }) @IsOptional() p_shipaddrid?: number; @ApiProperty({ required: false }) @Length(0, 1, { message: "Property p_formofsecurity must be between 0 to 1 characters" }) @IsString() @IsOptional() p_formofsecurity?: string; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_insprotection must be between 0 to 10 characters" }) @IsString() @IsOptional() p_insprotection?: string; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_ldiprotection must be between 0 to 10 characters" }) @IsString() @IsOptional() p_ldiprotection?: string; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_deliverytype must be between 0 to 10 characters" }) @IsString() @IsOptional() p_deliverytype?: string; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_deliverymethod must be between 0 to 10 characters" }) @IsString() @IsOptional() p_deliverymethod?: string; @ApiProperty({ required: false }) @Length(0, 10, { message: "Property p_paymentmethod must be between 0 to 10 characters" }) @IsString() @IsOptional() p_paymentmethod?: string; @ApiProperty({ required: false }) @Length(0, 20, { message: "Property p_custcourierno must be between 0 to 20 characters" }) @IsString() @IsOptional() p_custcourierno?: number; @ApiProperty({ required: false }) @Length(0, 20, { message: "Property p_refno must be between 0 to 20 characters" }) @IsString() @IsOptional() p_refno?: string; @ApiProperty({ required: false }) @Length(0, 2000, { message: "Property p_notes must be between 0 to 2000 characters" }) @IsString() @IsOptional() p_notes?: string; } export class TransmitApplicationtoProcessDTO { @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_spid must not exceed 999999999" }) @Min(0, { message: "Property p_spid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_spid must be a number" }) @IsDefined({message:"Property p_spid is required"}) p_spid: number; @ApiProperty({ required: true }) @Length(0, 50, { message: "Property p_userid must be between 0 to 50 characters" }) @IsString() @IsDefined({message:"Property p_userid is required"}) p_userid: string; @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_spid must not exceed 999999999" }) @Min(0, { message: "Property p_spid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_headerid must be a number" }) @IsDefined({message:"Property p_headerid is required"}) p_headerid: number; } export class GetCarnetDetailsbyCarnetStatusDTO { @ApiProperty({ required: true }) @Max(999999999, { message: "Property p_spid must not exceed 999999999" }) @Min(0, { message: "Property p_spid must be at least 0 or more" }) @IsInt() @IsNumber({}, { message: "Property p_spid must be a number" }) @IsDefined({message:"Property p_spid is required"}) p_spid: number; @ApiProperty({ required: true }) @Length(0, 50, { message: "Property p_userid must be between 0 to 50 characters" }) @IsString({ message: "Property p_userid must be string" }) @IsDefined({message:"Property p_userid is required"}) p_userid: string; @ApiProperty({ required: true }) @Length(0, 20, { message: "Property p_CarnetStatus must be between 0 to 20 characters" }) @IsString() @IsDefined({message:"Property p_CarnetStatus is required"}) p_CarnetStatus: string; } //-------------------------------- export class UserDTO { @ApiProperty({ required: true }) @IsNumber() id: number; @ApiProperty({ required: true }) @IsDefined({ message: "Property name is required" }) @IsString({ message: "property name is required" }) name: string; } export class TestDTO { @ApiProperty({ required: true }) @IsNumber() ItemNo: number; @ApiProperty({ required: true, type: () => [UserDTO] }) @Type(() => UserDTO) @ValidateNested({ each: true }) @IsArray() user: UserDTO[]; }