feat: added transactions record keeping feature

This commit is contained in:
2025-09-08 20:04:55 +05:30
parent 05068634fe
commit f675f1561a
9 changed files with 120 additions and 6 deletions

View File

@@ -1,7 +1,11 @@
const axios = require('axios');
const { logger } = require('../util/logger');
const {
recordInterBankTransaction,
} = require('../services/recordkeeping.service');
async function send(
customerNo,
fromAccount,
toAccount,
amount,
@@ -20,7 +24,6 @@ async function send(
stTransferAmount: amount,
stRemarks: remarks,
};
logger.info(reqData, 'request data to be sent to IMPS server');
const response = await axios.post(
'http://localhost:6768/kccb/api/IMPS/Producer',
reqData,
@@ -30,7 +33,17 @@ async function send(
},
}
);
logger.info(response, 'response from IMPS');
await recordInterBankTransaction(
customerNo,
'imps',
fromAccount,
toAccount,
ifscCode,
amount,
'',
'',
response.data
);
return response.data;
} catch (error) {
logger.error(error, 'error from IMPS');

View File

@@ -1,6 +1,10 @@
const axios = require('axios');
const {
recordInterBankTransaction,
} = require('../services/recordkeeping.service');
async function send(
customerNo,
fromAccount,
toAccount,
amount,
@@ -8,6 +12,7 @@ async function send(
beneficiaryName,
remitterName
) {
const commission = 0;
try {
const response = await axios.post(
'http://localhost:8690/kccb/Neftfundtransfer',
@@ -15,7 +20,7 @@ async function send(
stFromAcc: fromAccount,
stToAcc: toAccount,
stTranAmt: amount,
stCommission: 0,
stCommission: commission,
stIfscCode: ifscCode,
stFullName: remitterName,
stBeneName: beneficiaryName,
@@ -24,6 +29,18 @@ async function send(
stAddress3: '',
}
);
await recordInterBankTransaction(
customerNo,
'neft',
fromAccount,
toAccount,
ifscCode,
amount,
commission,
beneficiaryName,
remitterName,
response.data.status
);
return response.data;
} catch (error) {
throw new Error(

View File

@@ -1,6 +1,10 @@
const axios = require('axios');
const {
recordInterBankTransaction,
} = require('../services/recordkeeping.service');
async function send(
customerNo,
fromAccount,
toAccount,
amount,
@@ -8,6 +12,7 @@ async function send(
beneficiaryName,
remitterName
) {
const commission = 0;
try {
const response = await axios.post(
'http://localhost:8690/kccb/Rtgsfundtransfer',
@@ -15,7 +20,7 @@ async function send(
stFromAcc: fromAccount,
stToAcc: toAccount,
stTranAmt: amount,
stCommission: 0,
stCommission: commission,
stIfscCode: ifscCode,
stFullName: remitterName,
stBeneName: beneficiaryName,
@@ -24,6 +29,18 @@ async function send(
stAddress3: '',
}
);
await recordInterBankTransaction(
customerNo,
'rtgs',
fromAccount,
toAccount,
ifscCode,
amount,
commission,
beneficiaryName,
remitterName,
response.data.status
);
return response.data;
} catch (error) {
throw new Error(

View File

@@ -1,11 +1,14 @@
const axios = require('axios');
const {
recordIntraBankTransaction,
} = require('../services/recordkeeping.service');
async function transfer(
fromAccountNo,
toAccountNo,
toAccountType,
amount,
// narration = 'transfer from mobile'
customerNo,
narration = ''
) {
try {
@@ -19,6 +22,14 @@ async function transfer(
narration,
}
);
await recordIntraBankTransaction(
customerNo,
fromAccountNo,
toAccountNo,
toAccountType,
amount,
response.data.status
);
return response.data;
} catch (error) {
throw new Error(