new API EstimatedFees added in carnet-Application with access modification for some client API for user client

This commit is contained in:
Kallesh B S 2025-07-16 14:20:27 +05:30
parent d90c79fd67
commit 812d493679
2 changed files with 40 additions and 0 deletions

View File

@ -78,6 +78,11 @@ export class CarnetApplicationController {
return this.carnetApplicationService.UpdateShippingDetails(body);
}
@Get('EstimatedFees/:P_SPID/:P_USERID/:P_HEADERID')
EstimatedFees(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.EstimatedFees(body);
}
// processing [ PROCESSINGCENTER_PKG ]
@Patch('ProcessOriginalCarnet')

View File

@ -688,6 +688,41 @@ export class CarnetApplicationService {
}
}
async EstimatedFees(body: GetCarnetControlCenterDTO) {
let connection;
try {
connection = await this.oracleDBService.getConnection();
const result = await connection.execute(
`BEGIN
CARNETCONTROLCENTER_PKG.GetHolderstoEdit(
:P_SPID, :P_USERID , :P_HEADERID, :P_CURSOR
);
END;`,
{
P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER },
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
P_HEADERID: { val: body.P_HEADERID, type: oracledb.DB_TYPE_NUMBER },
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
},
{ outFormat: oracledb.OUT_FORMAT_OBJECT }
);
const outBinds = result.outBinds;
if (!outBinds?.P_CURSOR) {
this.logger.error('One or more expected cursors are missing from stored procedure output.');
throw new InternalServerException("Incomplete data received from the database.");
}
return await fetchCursor(outBinds.P_CURSOR, CarnetApplicationService.name);
} catch (error) {
handleError(error, CarnetApplicationService.name)
} finally {
await closeOracleDbConnection(connection, CarnetApplicationService.name)
}
}
// processing [ PROCESSINGCENTER_PKG ]
async ProcessOriginalCarnet(body: CarnetProcessingCenterDTO) {