2025-05-06 13:04:00 +05:30

191 lines
6.4 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import {
IsDefined,
IsInt,
IsNumber,
IsOptional,
IsString,
Min,
} from 'class-validator';
export class InsertNewServiceProviderDTO {
@ApiProperty({ required: true })
@IsString({ message: 'Property p_name must be a string' })
@IsDefined({ message: 'Property p_name is required' })
p_name: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_lookupcode must be a string' })
@IsDefined({ message: 'Property p_lookupcode is required' })
p_lookupcode: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_address1 must be a string' })
@IsDefined({ message: 'Property p_address1 is required' })
p_address1: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property p_address2 must be a string' })
@IsOptional()
p_address2?: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_city must be a string' })
@IsDefined({ message: 'Property p_city is required' })
p_city: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_state must be a string' })
@IsDefined({ message: 'Property p_state is required' })
p_state: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_country must be a string' })
@IsDefined({ message: 'Property p_country is required' })
p_country: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_zip must be a string' })
@IsDefined({ message: 'Property p_zip is required' })
p_zip: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_issuingregion must be a string' })
@IsDefined({ message: 'Property p_issuingregion is required' })
p_issuingregion: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_replacementregion must be a string' })
@IsDefined({ message: 'Property p_replacementregion is required' })
p_replacementregion: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_bondsurety must be a string' })
@IsDefined({ message: 'Property p_bondsurety is required' })
p_bondsurety: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_cargopolicyno must be a string' })
@IsDefined({ message: 'Property p_cargopolicyno is required' })
p_cargopolicyno: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_cargosurety must be a string' })
@IsDefined({ message: 'Property p_cargosurety is required' })
p_cargosurety: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_user_id must be a string' })
@IsDefined({ message: 'Property p_user_id is required' })
p_user_id: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property P_NOTES must be a string' })
@IsOptional()
P_NOTES?: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property P_FILEIDS must be a string' })
@IsOptional()
P_FILEIDS?: string;
}
export class UpdateServiceProviderDTO {
@ApiProperty({ required: true })
@IsNumber({}, { message: 'Property p_spid must be a number' })
@IsDefined({ message: 'Property p_spid is required' })
p_spid: number;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_name must be a string' })
@IsDefined({ message: 'Property p_name is required' })
p_name: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_lookupcode must be a string' })
@IsDefined({ message: 'Property p_lookupcode is required' })
p_lookupcode: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_address1 must be a string' })
@IsDefined({ message: 'Property p_address1 is required' })
p_address1: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property p_address2 must be a string' })
@IsOptional()
p_address2?: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_city must be a string' })
@IsDefined({ message: 'Property p_city is required' })
p_city: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_state must be a string' })
@IsDefined({ message: 'Property p_state is required' })
p_state: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_country must be a string' })
@IsDefined({ message: 'Property p_country is required' })
p_country: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_issuingregion must be a string' })
@IsDefined({ message: 'Property p_issuingregion is required' })
p_issuingregion: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_replacementregion must be a string' })
@IsDefined({ message: 'Property p_replacementregion is required' })
p_replacementregion: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_bondsurety must be a string' })
@IsDefined({ message: 'Property p_bondsurety is required' })
p_bondsurety: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_cargopolicyno must be a string' })
@IsDefined({ message: 'Property p_cargopolicyno is required' })
p_cargopolicyno: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_cargosurety must be a string' })
@IsDefined({ message: 'Property p_cargosurety is required' })
p_cargosurety: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_zip must be a string' })
@IsDefined({ message: 'Property p_zip is required' })
p_zip: string;
@ApiProperty({ required: true })
@IsString({ message: 'Property p_user_id must be a string' })
@IsDefined({ message: 'Property p_user_id is required' })
p_user_id: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property P_NOTES must be a string' })
@IsOptional()
P_NOTES?: string;
@ApiProperty({ required: false })
@IsString({ message: 'Property P_FILEIDS must be a string' })
@IsOptional()
P_FILEIDS?: string;
}
export class getSelectedServiceproviderDTO {
@ApiProperty({ required: true })
@Min(0, { message: 'Property p_spid must be at least 0' })
@IsInt({ message: 'Property p_SPid must be a whole number' })
@Transform(({ value }) => Number(value))
@IsNumber({}, { message: 'Property p_spid must be a number' })
@IsDefined({ message: 'Property p_spid is required' })
p_spid: number;
}