new API EstimatedFees added in carnet-Application with access modification for some client API for user client
This commit is contained in:
parent
d90c79fd67
commit
812d493679
@ -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')
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user