From 0e59a652b095a6bdd93e24844c6f7ac35f1872d4 Mon Sep 17 00:00:00 2001 From: Kallesh B S Date: Tue, 19 Aug 2025 17:27:14 +0530 Subject: [PATCH] 19-08-2025 api modifications --- .../carnet-application-property.dto.ts | 12 ++++++------ src/dto/carnet-application/carnet-application.dto.ts | 8 ++++---- .../carnet-application/carnet-application.service.ts | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dto/carnet-application/carnet-application-property.dto.ts b/src/dto/carnet-application/carnet-application-property.dto.ts index 5bfdd0e..4779b27 100644 --- a/src/dto/carnet-application/carnet-application-property.dto.ts +++ b/src/dto/carnet-application/carnet-application-property.dto.ts @@ -67,17 +67,17 @@ export class APPLICATIONNAME_DTO { } export class GOODS_PORT_DTO { - @ApiProperty({ required: true }) + @ApiProperty({ required: true, type: String, nullable: true }) @IsString({ message: 'Property P_GOODSPORT must be a string' }) @IsDefined({ message: 'Property P_GOODSPORT is required' }) - P_GOODSPORT: string; + P_GOODSPORT: string | null = null; } export class GOODS_COUNTRY_DTO { - @ApiProperty({ required: true }) + @ApiProperty({ required: true, type: String, nullable: true }) @IsString({ message: 'Property P_GOODSCOUNTRY must be a string' }) @IsDefined({ message: 'Property P_GOODSCOUNTRY is required' }) - P_GOODSCOUNTRY: string; + P_GOODSCOUNTRY: string | null = null; } export class REASON_CODE_DTO { @@ -97,7 +97,7 @@ export class EXTENSION_PERIOD_DTO { @IsNumber({}, { message: 'Property P_EXTENSIONPERIOD must be a number' }) @Transform(({ value }) => Number(value)) @IsDefined({ message: 'Property P_EXTENSIONPERIOD is required' }) - P_EXTENSIONPERIOD: number; + P_EXTENSIONPERIOD: number = 0; } export class ORDERTYPE_DTO { @@ -330,7 +330,7 @@ export class USSETS_DTO { @Transform(({ value }) => Number(value)) @IsNumber({}, { message: 'Property P_USSETS must be a number' }) @IsDefined({ message: 'Property P_USSETS is required' }) - P_USSETS: number; + P_USSETS: number = 0; } export enum VOT { diff --git a/src/dto/carnet-application/carnet-application.dto.ts b/src/dto/carnet-application/carnet-application.dto.ts index f69ffbf..75ab649 100644 --- a/src/dto/carnet-application/carnet-application.dto.ts +++ b/src/dto/carnet-application/carnet-application.dto.ts @@ -60,10 +60,10 @@ export class SaveExtensionApplicationDTO extends (IntersectionType( USERID_DTO, SPID_DTO, HEADERID_DTO, - GOODS_PORT_DTO, - GOODS_COUNTRY_DTO, + PartialType(GOODS_PORT_DTO), + PartialType(GOODS_COUNTRY_DTO), REASON_CODE_DTO, - EXTENSION_PERIOD_DTO + PartialType(EXTENSION_PERIOD_DTO) )) { } export class PrintCarnetDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO, PRINTGL_DTO)) { } @@ -98,7 +98,7 @@ export class DeleteGenerallistItemsDTO extends IntersectionType( ) { } export class AddCountriesDTO extends IntersectionType( - HEADERID_DTO, USSETS_DTO, COUNTRYTABLE_DTO, USERID_DTO + HEADERID_DTO, PartialType(USSETS_DTO), COUNTRYTABLE_DTO, USERID_DTO ) { } export class UpdateShippingDetailsDTO extends IntersectionType( diff --git a/src/oracle/carnet-application/carnet-application.service.ts b/src/oracle/carnet-application/carnet-application.service.ts index d4d390e..2368d95 100644 --- a/src/oracle/carnet-application/carnet-application.service.ts +++ b/src/oracle/carnet-application/carnet-application.service.ts @@ -965,7 +965,7 @@ export class CarnetApplicationService { } // return { statusCode: 200, message: "Extended successfully", ...fres[0] }; - return fres; + return fres.length > 0 ? fres[0] : []; } catch (error) { handleError(error, CarnetApplicationService.name) } finally {