From e7670be8341b02c5c7ee4d745fbafd9fc909c540 Mon Sep 17 00:00:00 2001 From: Kallesh B S Date: Fri, 21 Mar 2025 12:02:50 +0530 Subject: [PATCH] updated api according doc --- src/oracle/homePageData.service.ts | 4 +- src/oracle/manageFee.service.ts | 231 ++++++++++++++++------------- src/oracle/oracle.controller.ts | 69 ++++++--- src/oracle/oracle.dto.ts | 24 +++ src/oracle/oracle.service.ts | 68 +++++++-- src/oracle/paramTable.service.ts | 12 +- 6 files changed, 262 insertions(+), 146 deletions(-) diff --git a/src/oracle/homePageData.service.ts b/src/oracle/homePageData.service.ts index 5aa7203..590b258 100644 --- a/src/oracle/homePageData.service.ts +++ b/src/oracle/homePageData.service.ts @@ -284,7 +284,7 @@ export class HomePageDataService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -372,7 +372,7 @@ export class HomePageDataService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } diff --git a/src/oracle/manageFee.service.ts b/src/oracle/manageFee.service.ts index 7285883..7cea275 100644 --- a/src/oracle/manageFee.service.ts +++ b/src/oracle/manageFee.service.ts @@ -12,7 +12,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -71,14 +71,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATEBONDRATE(body: CreateBondRateDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -146,13 +146,13 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATECARGORATE(body: CreateCargoRateDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -215,14 +215,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATECFFEE(body: CreateCfFeeDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -290,14 +290,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATECSFEE(body: CreateCsFeeDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -355,13 +355,13 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATEEFFEE(body: CreateEfFeeDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -434,14 +434,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } async CREATEFEECOMM(body: CreateFeeCommDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -494,7 +494,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -505,7 +505,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -553,7 +553,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } @@ -562,7 +562,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -610,7 +610,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } @@ -619,7 +619,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -667,7 +667,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } @@ -675,7 +675,7 @@ export class ManageFeeService { async UPDATECFFEE(body: UpdateCfFeeDTO) { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -723,7 +723,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } @@ -732,7 +732,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -780,7 +780,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } @@ -790,7 +790,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -838,7 +838,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -846,7 +846,7 @@ export class ManageFeeService { let connection; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -863,19 +863,19 @@ export class ManageFeeService { END;`, { P_FEECOMMID: { - val:body.p_fees_comm.P_FEECOMMID, + val: body.p_fees_comm.P_FEECOMMID, type: oracledb.DB_TYPE_NUMBER }, P_RATE: { - val:Number(body.p_fees_comm.P_RATE)|0, + val: Number(body.p_fees_comm.P_RATE) | 0, type: oracledb.DB_TYPE_NUMBER }, P_EFFDATE: { - val:body.p_fees_comm.P_EFFDATE, + val: body.p_fees_comm.P_EFFDATE, type: oracledb.DB_TYPE_NVARCHAR }, P_USERID: { - val:body.p_fees_comm.P_USERID, + val: body.p_fees_comm.P_USERID, type: oracledb.DB_TYPE_NVARCHAR }, P_CURSOR: { @@ -891,28 +891,28 @@ export class ManageFeeService { if (result.outBinds && result.outBinds.P_CURSOR) { let fres = await result.outBinds.P_CURSOR.getRows(); - console.log("pcursor: ",fres); - - return fres + console.log("pcursor: ", fres); + + return fres } - else{ + else { console.log("No cursor returned...."); - return {error:"No cursor found"} + return { error: "No cursor found" } } } catch (err) { console.error('Error fetching users: ', err); - return{error:err.message} - // throw new Error('Error fetching users'); + return { error: err.message } + // return {error: err.message} } finally { } } // get - async GETBASICFEERATES(P_SPID: Number) { + async GETBASICFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -920,13 +920,18 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETBASICFEERATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETBASICFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -938,15 +943,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -956,14 +961,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETBONDRATES(P_SPID: Number) { + async GETBONDRATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -971,13 +976,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETBONDRATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETBONDRATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -989,15 +998,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1007,14 +1016,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETCARGORATES(P_SPID: Number) { + async GETCARGORATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -1022,13 +1031,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETCARGORATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETCARGORATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -1040,15 +1053,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1058,14 +1071,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETCFFEERATES(P_SPID: Number) { + async GETCFFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -1073,13 +1086,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETCFFEERATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETCFFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -1091,15 +1108,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1109,14 +1126,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETCSFEERATES(P_SPID: Number) { + async GETCSFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -1124,13 +1141,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETCSFEERATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETCSFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -1142,15 +1163,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1160,14 +1181,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETEFFEERATES(P_SPID: Number) { + async GETEFFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -1175,13 +1196,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETEFFEERATES(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETEFFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -1193,15 +1218,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1211,14 +1236,14 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } - async GETFEECOMM(P_SPID: Number) { + async GETFEECOMM(P_SPID: Number, P_ACTIVE_INACTIVE: string) { let connection; let rows = []; try { - + connection = await this.oracleDBService.getConnection() if (!connection) { throw new Error('No DB Connected') @@ -1226,13 +1251,17 @@ export class ManageFeeService { const result = await connection.execute( `BEGIN - MANAGEFEE_SETUP_PKG.GETFEECOMM(:P_SPID,:p_cursor); - END;`, + MANAGEFEE_SETUP_PKG.GETFEECOMM(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor); + END;`, { P_SPID: { val: P_SPID, type: oracledb.DB_TYPE_NUMBER, }, + P_ACTIVE_INACTIVE: { + val: P_ACTIVE_INACTIVE, + type: oracledb.DB_TYPE_NVARCHAR, + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -1244,15 +1273,15 @@ export class ManageFeeService { ); if (result.outBinds && result.outBinds.p_cursor) { - const cursor = result.outBinds.p_cursor; + const cursor = result.outBinds.p_cursor; let rowsBatch; do { - rowsBatch = await cursor.getRows(100); - rows = rows.concat(rowsBatch); + rowsBatch = await cursor.getRows(100); + rows = rows.concat(rowsBatch); } while (rowsBatch.length > 0); - + await cursor.close(); } else { throw new Error('No cursor returned from the stored procedure'); @@ -1262,7 +1291,7 @@ export class ManageFeeService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } } \ No newline at end of file diff --git a/src/oracle/oracle.controller.ts b/src/oracle/oracle.controller.ts index 9c29357..7f18391 100644 --- a/src/oracle/oracle.controller.ts +++ b/src/oracle/oracle.controller.ts @@ -16,15 +16,15 @@ export class OracleController { ) { } // HomePageData - @ApiTags('HomePageData - Oracle') + @ApiTags('HomePage - Oracle') @Get('/GetHomePageData/:id') GetHomePageData(@Param('id', ParseIntPipe) id: number) { return this.homePageDataService.GetHomePageData(id); } - @ApiTags('GetCarnetSummaryData - Oracle') - @Get('/GetCarnetSummaryData/:id') - GetCarnetSummaryData(@Param('id') id: string) { + @ApiTags('HomePage - Oracle') + @Get('/GetCarnetSummaryData/:userid') + GetCarnetSummaryData(@Param('userid') id: string) { return this.homePageDataService.GetCarnetSummaryData(id); } @@ -67,7 +67,9 @@ export class OracleController { body.p_bondsurety, body.p_cargopolicyno, body.p_cargosurety, - body.p_user_id + body.p_user_id, + body.P_NOTES, + body.P_FILEIDS ) } @@ -89,7 +91,9 @@ export class OracleController { body.p_bondsurety, body.p_cargopolicyno, body.p_cargosurety, - body.p_user_id + body.p_user_id, + body.P_NOTES, + body.P_FILEIDS ) } @@ -116,6 +120,7 @@ export class OracleController { body.p_defcontactflag, body.p_firstname, body.p_lastname, + body.P_MIDDLEINITIAL, body.p_title, body.p_phoneno, body.p_mobileno, @@ -138,6 +143,7 @@ export class OracleController { body.p_spcontactid, body.p_firstname, body.p_lastname, + body.P_MIDDLEINITIAL, body.p_title, body.p_phoneno, body.p_mobileno, @@ -328,45 +334,66 @@ export class OracleController { } @ApiTags('Manage Fee - Oracle') - @Get('/GetBasicFeeRates/:id') - GetBasicFeeRates(@Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETBASICFEERATES(id) + @Get('/GetBasicFeeRates/:P_SPID/:P_ACTIVE_INACTIVE') + GetBasicFeeRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETBASICFEERATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetBondRates/:id') - GetBondRates( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETBONDRATES(id) + GetBondRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETBONDRATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetCargoRates/:id') - GetCargoRates( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETCARGORATES(id) + GetCargoRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETCARGORATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetCfFeeRates/:id') - GetCfFeeRates( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETCFFEERATES(id) + GetCfFeeRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETCFFEERATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetCsFeeRates/:id') - GetCsFeeRates( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETCSFEERATES(id) + GetCsFeeRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETCSFEERATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetEfFeeRates/:id') - GetEfFeeRates( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETEFFEERATES(id) + GetEfFeeRates( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETEFFEERATES(P_SPID,P_ACTIVE_INACTIVE) } @ApiTags('Manage Fee - Oracle') @Get('/GetFeeComm/:id') - GetFeeComm( @Param('id', ParseIntPipe) id: number) { - return this.manageFeeService.GETFEECOMM(id) + GetFeeComm( + @Param('P_SPID', ParseIntPipe) P_SPID: number, + @Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string + ) { + return this.manageFeeService.GETFEECOMM(P_SPID,P_ACTIVE_INACTIVE) } } diff --git a/src/oracle/oracle.dto.ts b/src/oracle/oracle.dto.ts index 4b917b1..c1bcee1 100644 --- a/src/oracle/oracle.dto.ts +++ b/src/oracle/oracle.dto.ts @@ -82,6 +82,14 @@ export class InsertNewServiceProviderDTO { @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 { @@ -144,6 +152,14 @@ export class UpdateServiceProviderDTO { @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 { @@ -168,6 +184,10 @@ export class InsertSPContactsDTO { @IsString() p_lastname: string; + @ApiProperty({ required: false }) + @IsString() + P_MIDDLEINITIAL: string; + @ApiProperty({ required: true }) @IsString() p_title: string; @@ -206,6 +226,10 @@ export class UpdateSPContactsDTO { @IsString() p_lastname: string; + @ApiProperty({ required: false }) + @IsString() + P_MIDDLEINITIAL: string; + @ApiProperty({ required: true }) @IsString() p_title: string; diff --git a/src/oracle/oracle.service.ts b/src/oracle/oracle.service.ts index ec7aa61..ed015e8 100644 --- a/src/oracle/oracle.service.ts +++ b/src/oracle/oracle.service.ts @@ -46,7 +46,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -88,7 +88,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -137,7 +137,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -158,6 +158,8 @@ export class OracleService { p_cargopolicyno: String, p_cargosurety: String, p_user_id: String, + P_NOTES: string, + P_FILEIDS: string ) { let connection; @@ -185,6 +187,8 @@ export class OracleService { :p_cargopolicyno, :p_cargosurety, :p_user_id, + :P_NOTES, + :P_FILEIDS, :p_cursor); END;`, { p_name: { @@ -243,6 +247,14 @@ export class OracleService { val: p_user_id, type: oracledb.DB_TYPE_VARCHAR }, + P_NOTES: { + val: P_NOTES, + type: oracledb.DB_TYPE_VARCHAR + }, + P_FILEIDS: { + val: P_FILEIDS, + type: oracledb.DB_TYPE_VARCHAR + }, p_cursor: { type: oracledb.CURSOR, @@ -260,7 +272,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -280,7 +292,9 @@ export class OracleService { p_bondsurety: String, p_cargopolicyno: String, p_cargosurety: String, - p_user_id: String + p_user_id: String, + P_NOTES: string, + P_FILEIDS: string ) { let connection; @@ -309,6 +323,8 @@ export class OracleService { :p_cargopolicyno, :p_cargosurety, :p_user_id, + :P_NOTES, + :P_FILEIDS, :p_cursor); END;`, { p_spid: { @@ -371,6 +387,14 @@ export class OracleService { val: p_user_id, type: oracledb.DB_TYPE_VARCHAR }, + P_NOTES: { + val: P_NOTES, + type: oracledb.DB_TYPE_VARCHAR + }, + P_FILEIDS: { + val: P_FILEIDS, + type: oracledb.DB_TYPE_VARCHAR + }, p_cursor: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT @@ -388,7 +412,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -438,7 +462,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -494,7 +518,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -506,6 +530,7 @@ export class OracleService { p_defcontactflag: string, p_firstname: string, p_lastname: string, + P_MIDDLEINITIAL: string, p_title: string, p_phoneno: string, p_mobileno: string, @@ -528,6 +553,7 @@ export class OracleService { :p_defcontactflag, :p_firstname, :p_lastname, + :P_MIDDLEINITIAL, :p_title, :p_phoneno, :p_mobileno, @@ -552,6 +578,10 @@ export class OracleService { val: p_lastname, type: oracledb.DB_TYPE_VARCHAR }, + P_MIDDLEINITIAL: { + val: P_MIDDLEINITIAL, + type: oracledb.DB_TYPE_VARCHAR + }, p_title: { val: p_title, type: oracledb.DB_TYPE_VARCHAR @@ -593,7 +623,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -625,7 +655,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -634,6 +664,7 @@ export class OracleService { p_spcontactid: number, p_firstname: string, p_lastname: string, + P_MIDDLEINITIAL: string, p_title: string, p_phoneno: string, p_mobileno: string, @@ -655,6 +686,7 @@ export class OracleService { :p_spcontactid, :p_firstname, :p_lastname, + :P_MIDDLEINITIAL, :p_title, :p_phoneno, :p_mobileno, @@ -675,6 +707,10 @@ export class OracleService { val: p_lastname, type: oracledb.DB_TYPE_VARCHAR }, + P_MIDDLEINITIAL: { + val: P_MIDDLEINITIAL, + type: oracledb.DB_TYPE_VARCHAR + }, p_title: { val: p_title, type: oracledb.DB_TYPE_VARCHAR @@ -716,7 +752,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -747,7 +783,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -801,7 +837,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -852,7 +888,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -922,7 +958,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -974,7 +1010,7 @@ export class OracleService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } } diff --git a/src/oracle/paramTable.service.ts b/src/oracle/paramTable.service.ts index c298813..0135628 100644 --- a/src/oracle/paramTable.service.ts +++ b/src/oracle/paramTable.service.ts @@ -62,7 +62,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -106,7 +106,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -210,7 +210,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -297,7 +297,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -334,7 +334,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } @@ -371,7 +371,7 @@ export class ParamTableService { } catch (err) { console.error('Error fetching users: ', err); - throw new Error('Error fetching users'); + return {error: err.message} } finally { } } } \ No newline at end of file