updated api according doc

This commit is contained in:
Kallesh B S 2025-03-21 12:02:50 +05:30
parent 3e0b4e5b97
commit e7670be834
6 changed files with 262 additions and 146 deletions

View File

@ -284,7 +284,7 @@ export class HomePageDataService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -372,7 +372,7 @@ export class HomePageDataService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }

View File

@ -12,7 +12,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -71,14 +71,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATEBONDRATE(body: CreateBondRateDTO) { async CREATEBONDRATE(body: CreateBondRateDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -146,13 +146,13 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATECARGORATE(body: CreateCargoRateDTO) { async CREATECARGORATE(body: CreateCargoRateDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -215,14 +215,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATECFFEE(body: CreateCfFeeDTO) { async CREATECFFEE(body: CreateCfFeeDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -290,14 +290,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATECSFEE(body: CreateCsFeeDTO) { async CREATECSFEE(body: CreateCsFeeDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -355,13 +355,13 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATEEFFEE(body: CreateEfFeeDTO) { async CREATEEFFEE(body: CreateEfFeeDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -434,14 +434,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async CREATEFEECOMM(body: CreateFeeCommDTO) { async CREATEFEECOMM(body: CreateFeeCommDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -494,7 +494,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -505,7 +505,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -553,7 +553,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
@ -562,7 +562,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -610,7 +610,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
@ -619,7 +619,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -667,7 +667,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
@ -675,7 +675,7 @@ export class ManageFeeService {
async UPDATECFFEE(body: UpdateCfFeeDTO) { async UPDATECFFEE(body: UpdateCfFeeDTO) {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -723,7 +723,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
@ -732,7 +732,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -780,7 +780,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
@ -790,7 +790,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -838,7 +838,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -846,7 +846,7 @@ export class ManageFeeService {
let connection; let connection;
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -863,19 +863,19 @@ export class ManageFeeService {
END;`, END;`,
{ {
P_FEECOMMID: { P_FEECOMMID: {
val:body.p_fees_comm.P_FEECOMMID, val: body.p_fees_comm.P_FEECOMMID,
type: oracledb.DB_TYPE_NUMBER type: oracledb.DB_TYPE_NUMBER
}, },
P_RATE: { 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 type: oracledb.DB_TYPE_NUMBER
}, },
P_EFFDATE: { P_EFFDATE: {
val:body.p_fees_comm.P_EFFDATE, val: body.p_fees_comm.P_EFFDATE,
type: oracledb.DB_TYPE_NVARCHAR type: oracledb.DB_TYPE_NVARCHAR
}, },
P_USERID: { P_USERID: {
val:body.p_fees_comm.P_USERID, val: body.p_fees_comm.P_USERID,
type: oracledb.DB_TYPE_NVARCHAR type: oracledb.DB_TYPE_NVARCHAR
}, },
P_CURSOR: { P_CURSOR: {
@ -891,28 +891,28 @@ export class ManageFeeService {
if (result.outBinds && result.outBinds.P_CURSOR) { if (result.outBinds && result.outBinds.P_CURSOR) {
let fres = await result.outBinds.P_CURSOR.getRows(); let fres = await result.outBinds.P_CURSOR.getRows();
console.log("pcursor: ",fres); console.log("pcursor: ", fres);
return fres return fres
} }
else{ else {
console.log("No cursor returned...."); console.log("No cursor returned....");
return {error:"No cursor found"} return { error: "No cursor found" }
} }
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
return{error:err.message} return { error: err.message }
// throw new Error('Error fetching users'); // return {error: err.message}
} finally { } } finally { }
} }
// get // get
async GETBASICFEERATES(P_SPID: Number) { async GETBASICFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -920,13 +920,18 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETBASICFEERATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETBASICFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -938,15 +943,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -956,14 +961,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETBONDRATES(P_SPID: Number) { async GETBONDRATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -971,13 +976,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETBONDRATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETBONDRATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -989,15 +998,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1007,14 +1016,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETCARGORATES(P_SPID: Number) { async GETCARGORATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -1022,13 +1031,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETCARGORATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETCARGORATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -1040,15 +1053,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1058,14 +1071,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETCFFEERATES(P_SPID: Number) { async GETCFFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -1073,13 +1086,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETCFFEERATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETCFFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -1091,15 +1108,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1109,14 +1126,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETCSFEERATES(P_SPID: Number) { async GETCSFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -1124,13 +1141,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETCSFEERATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETCSFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -1142,15 +1163,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1160,14 +1181,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETEFFEERATES(P_SPID: Number) { async GETEFFEERATES(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -1175,13 +1196,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETEFFEERATES(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETEFFEERATES(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -1193,15 +1218,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1211,14 +1236,14 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
async GETFEECOMM(P_SPID: Number) { async GETFEECOMM(P_SPID: Number, P_ACTIVE_INACTIVE: string) {
let connection; let connection;
let rows = []; let rows = [];
try { try {
connection = await this.oracleDBService.getConnection() connection = await this.oracleDBService.getConnection()
if (!connection) { if (!connection) {
throw new Error('No DB Connected') throw new Error('No DB Connected')
@ -1226,13 +1251,17 @@ export class ManageFeeService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEFEE_SETUP_PKG.GETFEECOMM(:P_SPID,:p_cursor); MANAGEFEE_SETUP_PKG.GETFEECOMM(:P_SPID,:P_ACTIVE_INACTIVE,:p_cursor);
END;`, END;`,
{ {
P_SPID: { P_SPID: {
val: P_SPID, val: P_SPID,
type: oracledb.DB_TYPE_NUMBER, type: oracledb.DB_TYPE_NUMBER,
}, },
P_ACTIVE_INACTIVE: {
val: P_ACTIVE_INACTIVE,
type: oracledb.DB_TYPE_NVARCHAR,
},
p_cursor: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -1244,15 +1273,15 @@ export class ManageFeeService {
); );
if (result.outBinds && result.outBinds.p_cursor) { if (result.outBinds && result.outBinds.p_cursor) {
const cursor = result.outBinds.p_cursor; const cursor = result.outBinds.p_cursor;
let rowsBatch; let rowsBatch;
do { do {
rowsBatch = await cursor.getRows(100); rowsBatch = await cursor.getRows(100);
rows = rows.concat(rowsBatch); rows = rows.concat(rowsBatch);
} while (rowsBatch.length > 0); } while (rowsBatch.length > 0);
await cursor.close(); await cursor.close();
} else { } else {
throw new Error('No cursor returned from the stored procedure'); throw new Error('No cursor returned from the stored procedure');
@ -1262,7 +1291,7 @@ export class ManageFeeService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
} }

View File

@ -16,15 +16,15 @@ export class OracleController {
) { } ) { }
// HomePageData // HomePageData
@ApiTags('HomePageData - Oracle') @ApiTags('HomePage - Oracle')
@Get('/GetHomePageData/:id') @Get('/GetHomePageData/:id')
GetHomePageData(@Param('id', ParseIntPipe) id: number) { GetHomePageData(@Param('id', ParseIntPipe) id: number) {
return this.homePageDataService.GetHomePageData(id); return this.homePageDataService.GetHomePageData(id);
} }
@ApiTags('GetCarnetSummaryData - Oracle') @ApiTags('HomePage - Oracle')
@Get('/GetCarnetSummaryData/:id') @Get('/GetCarnetSummaryData/:userid')
GetCarnetSummaryData(@Param('id') id: string) { GetCarnetSummaryData(@Param('userid') id: string) {
return this.homePageDataService.GetCarnetSummaryData(id); return this.homePageDataService.GetCarnetSummaryData(id);
} }
@ -67,7 +67,9 @@ export class OracleController {
body.p_bondsurety, body.p_bondsurety,
body.p_cargopolicyno, body.p_cargopolicyno,
body.p_cargosurety, 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_bondsurety,
body.p_cargopolicyno, body.p_cargopolicyno,
body.p_cargosurety, 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_defcontactflag,
body.p_firstname, body.p_firstname,
body.p_lastname, body.p_lastname,
body.P_MIDDLEINITIAL,
body.p_title, body.p_title,
body.p_phoneno, body.p_phoneno,
body.p_mobileno, body.p_mobileno,
@ -138,6 +143,7 @@ export class OracleController {
body.p_spcontactid, body.p_spcontactid,
body.p_firstname, body.p_firstname,
body.p_lastname, body.p_lastname,
body.P_MIDDLEINITIAL,
body.p_title, body.p_title,
body.p_phoneno, body.p_phoneno,
body.p_mobileno, body.p_mobileno,
@ -328,45 +334,66 @@ export class OracleController {
} }
@ApiTags('Manage Fee - Oracle') @ApiTags('Manage Fee - Oracle')
@Get('/GetBasicFeeRates/:id') @Get('/GetBasicFeeRates/:P_SPID/:P_ACTIVE_INACTIVE')
GetBasicFeeRates(@Param('id', ParseIntPipe) id: number) { GetBasicFeeRates(
return this.manageFeeService.GETBASICFEERATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetBondRates/:id') @Get('/GetBondRates/:id')
GetBondRates( @Param('id', ParseIntPipe) id: number) { GetBondRates(
return this.manageFeeService.GETBONDRATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetCargoRates/:id') @Get('/GetCargoRates/:id')
GetCargoRates( @Param('id', ParseIntPipe) id: number) { GetCargoRates(
return this.manageFeeService.GETCARGORATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetCfFeeRates/:id') @Get('/GetCfFeeRates/:id')
GetCfFeeRates( @Param('id', ParseIntPipe) id: number) { GetCfFeeRates(
return this.manageFeeService.GETCFFEERATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetCsFeeRates/:id') @Get('/GetCsFeeRates/:id')
GetCsFeeRates( @Param('id', ParseIntPipe) id: number) { GetCsFeeRates(
return this.manageFeeService.GETCSFEERATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetEfFeeRates/:id') @Get('/GetEfFeeRates/:id')
GetEfFeeRates( @Param('id', ParseIntPipe) id: number) { GetEfFeeRates(
return this.manageFeeService.GETEFFEERATES(id) @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') @ApiTags('Manage Fee - Oracle')
@Get('/GetFeeComm/:id') @Get('/GetFeeComm/:id')
GetFeeComm( @Param('id', ParseIntPipe) id: number) { GetFeeComm(
return this.manageFeeService.GETFEECOMM(id) @Param('P_SPID', ParseIntPipe) P_SPID: number,
@Param('P_ACTIVE_INACTIVE',) P_ACTIVE_INACTIVE:string
) {
return this.manageFeeService.GETFEECOMM(P_SPID,P_ACTIVE_INACTIVE)
} }
} }

View File

@ -82,6 +82,14 @@ export class InsertNewServiceProviderDTO {
@ApiProperty({ required: true }) @ApiProperty({ required: true })
@IsString() @IsString()
p_user_id: string; p_user_id: string;
@ApiProperty({ required: false })
@IsString()
P_NOTES: string;
@ApiProperty({ required: false })
@IsString()
P_FILEIDS: string;
} }
export class UpdateServiceProviderDTO { export class UpdateServiceProviderDTO {
@ -144,6 +152,14 @@ export class UpdateServiceProviderDTO {
@ApiProperty({ required: true }) @ApiProperty({ required: true })
@IsString() @IsString()
p_user_id: string; p_user_id: string;
@ApiProperty({ required: false })
@IsString()
P_NOTES: string;
@ApiProperty({ required: false })
@IsString()
P_FILEIDS: string;
} }
// export class GetSPcontactsDTO { // export class GetSPcontactsDTO {
@ -168,6 +184,10 @@ export class InsertSPContactsDTO {
@IsString() @IsString()
p_lastname: string; p_lastname: string;
@ApiProperty({ required: false })
@IsString()
P_MIDDLEINITIAL: string;
@ApiProperty({ required: true }) @ApiProperty({ required: true })
@IsString() @IsString()
p_title: string; p_title: string;
@ -206,6 +226,10 @@ export class UpdateSPContactsDTO {
@IsString() @IsString()
p_lastname: string; p_lastname: string;
@ApiProperty({ required: false })
@IsString()
P_MIDDLEINITIAL: string;
@ApiProperty({ required: true }) @ApiProperty({ required: true })
@IsString() @IsString()
p_title: string; p_title: string;

View File

@ -46,7 +46,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -88,7 +88,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -137,7 +137,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -158,6 +158,8 @@ export class OracleService {
p_cargopolicyno: String, p_cargopolicyno: String,
p_cargosurety: String, p_cargosurety: String,
p_user_id: String, p_user_id: String,
P_NOTES: string,
P_FILEIDS: string
) { ) {
let connection; let connection;
@ -185,6 +187,8 @@ export class OracleService {
:p_cargopolicyno, :p_cargopolicyno,
:p_cargosurety, :p_cargosurety,
:p_user_id, :p_user_id,
:P_NOTES,
:P_FILEIDS,
:p_cursor); :p_cursor);
END;`, { END;`, {
p_name: { p_name: {
@ -243,6 +247,14 @@ export class OracleService {
val: p_user_id, val: p_user_id,
type: oracledb.DB_TYPE_VARCHAR 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: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
@ -260,7 +272,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -280,7 +292,9 @@ export class OracleService {
p_bondsurety: String, p_bondsurety: String,
p_cargopolicyno: String, p_cargopolicyno: String,
p_cargosurety: String, p_cargosurety: String,
p_user_id: String p_user_id: String,
P_NOTES: string,
P_FILEIDS: string
) { ) {
let connection; let connection;
@ -309,6 +323,8 @@ export class OracleService {
:p_cargopolicyno, :p_cargopolicyno,
:p_cargosurety, :p_cargosurety,
:p_user_id, :p_user_id,
:P_NOTES,
:P_FILEIDS,
:p_cursor); :p_cursor);
END;`, { END;`, {
p_spid: { p_spid: {
@ -371,6 +387,14 @@ export class OracleService {
val: p_user_id, val: p_user_id,
type: oracledb.DB_TYPE_VARCHAR 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: { p_cursor: {
type: oracledb.CURSOR, type: oracledb.CURSOR,
dir: oracledb.BIND_OUT dir: oracledb.BIND_OUT
@ -388,7 +412,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -438,7 +462,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -494,7 +518,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -506,6 +530,7 @@ export class OracleService {
p_defcontactflag: string, p_defcontactflag: string,
p_firstname: string, p_firstname: string,
p_lastname: string, p_lastname: string,
P_MIDDLEINITIAL: string,
p_title: string, p_title: string,
p_phoneno: string, p_phoneno: string,
p_mobileno: string, p_mobileno: string,
@ -528,6 +553,7 @@ export class OracleService {
:p_defcontactflag, :p_defcontactflag,
:p_firstname, :p_firstname,
:p_lastname, :p_lastname,
:P_MIDDLEINITIAL,
:p_title, :p_title,
:p_phoneno, :p_phoneno,
:p_mobileno, :p_mobileno,
@ -552,6 +578,10 @@ export class OracleService {
val: p_lastname, val: p_lastname,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
}, },
P_MIDDLEINITIAL: {
val: P_MIDDLEINITIAL,
type: oracledb.DB_TYPE_VARCHAR
},
p_title: { p_title: {
val: p_title, val: p_title,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
@ -593,7 +623,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -625,7 +655,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -634,6 +664,7 @@ export class OracleService {
p_spcontactid: number, p_spcontactid: number,
p_firstname: string, p_firstname: string,
p_lastname: string, p_lastname: string,
P_MIDDLEINITIAL: string,
p_title: string, p_title: string,
p_phoneno: string, p_phoneno: string,
p_mobileno: string, p_mobileno: string,
@ -655,6 +686,7 @@ export class OracleService {
:p_spcontactid, :p_spcontactid,
:p_firstname, :p_firstname,
:p_lastname, :p_lastname,
:P_MIDDLEINITIAL,
:p_title, :p_title,
:p_phoneno, :p_phoneno,
:p_mobileno, :p_mobileno,
@ -675,6 +707,10 @@ export class OracleService {
val: p_lastname, val: p_lastname,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
}, },
P_MIDDLEINITIAL: {
val: P_MIDDLEINITIAL,
type: oracledb.DB_TYPE_VARCHAR
},
p_title: { p_title: {
val: p_title, val: p_title,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
@ -716,7 +752,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -747,7 +783,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -801,7 +837,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -852,7 +888,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -922,7 +958,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -974,7 +1010,7 @@ export class OracleService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
} }

View File

@ -62,7 +62,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -106,7 +106,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -210,7 +210,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -297,7 +297,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -334,7 +334,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
@ -371,7 +371,7 @@ export class ParamTableService {
} catch (err) { } catch (err) {
console.error('Error fetching users: ', err); console.error('Error fetching users: ', err);
throw new Error('Error fetching users'); return {error: err.message}
} finally { } } finally { }
} }
} }