Compare commits

...

44 Commits

Author SHA1 Message Date
ihsan 301696661d Merge branch 'develop' of https://github.com/mohamadihsan/topuponline into develop_v1.5.7 2025-03-03 13:59:31 +07:00
ihsan 9fa469fc67 change file rotate log time 2025-03-03 13:57:55 +07:00
lutfi 02fa5cb909 update 2025-01-24 18:12:26 +07:00
lutfi 3dfd2a50d4 update 2025-01-24 17:56:56 +07:00
ihsan d51325cd81 update version info 2025-01-16 15:13:31 +07:00
ihsan 99ebab8591 bug fixed autocomplete transaction 2025-01-16 15:12:30 +07:00
ihsan 92b72dbe7a update log debug 2025-01-16 13:05:13 +07:00
WildanFahri d2e1ff2274 Merge branch 'wildan' of https://github.com/mohamadihsan/topuponline into develop_v1.5.5 2025-01-15 11:43:31 +07:00
WildanFahri 5c67284a51 update logging updateReservationAndLoadingBalance 2025-01-15 11:40:32 +07:00
ihsan b4d700e27d check log 2025-01-15 11:39:28 +07:00
ihsan d18b91edda update 2025-01-15 11:27:47 +07:00
WildanFahri 3b97844c64 Merge branch 'wildan' of https://github.com/mohamadihsan/topuponline into develop_v1.5.5 2025-01-14 19:58:19 +07:00
WildanFahri 1ce4424494 check log insert t_d_load_balance_history 2025-01-14 19:57:37 +07:00
ihsan 6c5e472c4b bug fixed 2025-01-14 19:46:02 +07:00
ihsan 57d7f260d0 add log 2025-01-14 19:25:21 +07:00
ihsan 2834265206 update 2025-01-13 19:34:34 +07:00
ihsan 40ddf02c51 update 2025-01-13 19:29:10 +07:00
WildanFahri ba20dce4d1 add log updateReservationAndLoadingBalance 2025-01-13 19:23:33 +07:00
WildanFahri aec06cb481 add log updateReservationAndLoadingBalance 2025-01-13 18:05:27 +07:00
WildanFahri 7434464106 update 2025-01-07 16:39:51 +07:00
ihsan 01d95ae783 bug fixed 2025-01-07 07:16:06 +07:00
ihsan d690cb2c0b update 2025-01-07 06:43:29 +07:00
ihsan 88f82281dc bug fixed 2025-01-06 17:33:25 +07:00
ihsan 2e5d76d97d bug fixed 2025-01-06 17:27:25 +07:00
ihsan fc9c1a4b73 add description new version 2025-01-06 17:04:24 +07:00
ihsan 7d4ff6c8b3 update version 2025-01-06 17:03:17 +07:00
WildanFahri 8bda43d2b2 update topup6 2025-01-06 16:54:11 +07:00
lutfi 36139073d4 Merge branch 'develop_v1.5.4' of https://github.com/mohamadihsan/topuponline 2025-01-01 14:57:00 +07:00
lutfi 3c8fc4d81d update cash in 2025-01-01 14:52:36 +07:00
ihsan 22ce0b611a add version 2024-12-25 23:19:23 +07:00
ihsan 785e1f2542 add version 2024-12-25 23:18:14 +07:00
ihsan a6c6146933 update 2024-11-05 21:05:25 +07:00
lutfi 0113e6dbb1 update d_disburse 2024-10-25 05:39:27 +07:00
lutfi 8d2f4bcda2 update 2024-10-17 16:12:12 +07:00
lutfi 9aa3428620 update 2024-10-17 15:37:25 +07:00
lutfi e8c73abf2e update 2024-10-17 14:39:05 +07:00
lutfi 6275d8cf86 update 2024-10-17 14:32:46 +07:00
lutfi 8af96b9a5f update 2024-10-17 14:30:20 +07:00
lutfi d9f3516d56 update 2024-10-17 14:29:11 +07:00
lutfi b7dec2613f Merge branch 'develop' of https://github.com/mohamadihsan/topuponline into develop 2024-10-17 14:06:07 +07:00
lutfi d540308d2d update 2024-10-17 12:14:47 +07:00
ihsan 9708f81242 remove validation card production or development 2024-10-16 18:03:22 +07:00
ihsan 35c9fe205c Merge remote-tracking branch 'origin/develop_v1.5.2' into develop 2024-10-11 16:38:51 +07:00
ihsan b206b50968 update card history 2024-10-11 16:38:05 +07:00
13 changed files with 2160 additions and 1937 deletions
+9 -1
View File
@@ -27,7 +27,13 @@ var logger;
const fileRotateTransport = new winston.transports.DailyRotateFile({
filename: `application/logs/%DATE%-onlinetopup.log`,
datePattern: "YYYY-MM-DD",
maxFiles: "90d",
maxFiles: "60d",
});
const fileRotateTransportDebug = new winston.transports.DailyRotateFile({
filename: `application/logs/debug/%DATE%-onlinetopup.log`,
datePattern: "YYYY-MM-DD",
maxFiles: "30d",
});
//
// If we're not in production then log to the `console` with the format:
@@ -54,6 +60,7 @@ if (
defaultMeta: { service: "topuponline-service" },
transports: [
fileRotateTransport,
fileRotateTransportDebug,
//
// - Write all logs with importance level of `error` or less to `error.log`
// - Write all logs with importance level of `info` or less to `onlinetopup.log`
@@ -84,6 +91,7 @@ if (
defaultMeta: { service: "topuponline-service" },
transports: [
fileRotateTransport,
fileRotateTransportDebug,
//
// - Write all logs with importance level of `error` or less to `error.log`
// - Write all logs with importance level of `info` or less to `onlinetopup.log`
@@ -161,6 +161,47 @@ const getLoadBalanceNumberSequence = async (req, res, next) => {
}
next();
};
const getLoadBalanceNumberSequence2 = async (req) => {
// set default load_balance_number_sequence dari partner apapun is null
let load_balance_number_sequence = null;
// cek jika redis is connect
let isRedisReady = await redisClient.isReady;
// jika tidak connect
if (isRedisReady) {
// jika connect maka cari sequence dari reservation number sesuai partner yg merequest
// format value nya harusnya seperti ini = { date: '2023-01-01', sequence: 1 }
// data req.partner_id_token di dapat dari authenticateToken di jwt middleware
let getValue = await redisClient.GET(
'load_balance_number_sequence_' + req.partner_id_token
);
if (getValue) {
// parsing data menjadi json format
let parsedValue = JSON.parse(getValue);
// cek apakah tanggal sequence yang di redis sama dengan hari ini atau bukan
if (parsedValue.date == moment().format('YYYY-MM-DD')) {
// jika tanggal nya sama dengan hari ini maka ambil sequence untuk reservation number yang di generate dari redis
load_balance_number_sequence = parseInt(parsedValue.sequence);
// langsung update sequence walaupun transaksi insert nya belum selesai
// impact menggunakan redis, untuk nomor sequence bisa saja ada yg loncat karena bisa saja ada transaksi insert reservation yang gagal
let setValue = {
date: moment().format('YYYY-MM-DD'),
sequence: parseInt(parsedValue.sequence) + 1,
};
await redisClient.SET(
`load_balance_number_sequence_${req.partner_id_token}`,
JSON.stringify(setValue)
);
}
}
}
return load_balance_number_sequence;
// next();
};
const setLoadBalanceNumberSequence = async (partner_id, sequence) => {
// cek jika redis is connect
@@ -188,4 +229,5 @@ module.exports = {
setReservationNumberSequence,
getLoadBalanceNumberSequence,
setLoadBalanceNumberSequence,
getLoadBalanceNumberSequence2,
};
@@ -261,6 +261,12 @@ const _generateCashIn = async (uniqueCode) => {
item.d_payment,
item.c_invoice_no
);
winston.logger.info(
`SCHEDULER-FB70-${uniqueCode} cashIn reserv ${code} DATA : ${JSON.stringify(
reserv
)}`
);
//TOTAL AMOUNT CASH-IN
let cashInAmount = 0;
@@ -269,6 +275,12 @@ const _generateCashIn = async (uniqueCode) => {
}
dataCahsIn.i_amount = cashInAmount;
winston.logger.info(
`SCHEDULER-FB70-${uniqueCode} cashInAmount ${code} DATA : ${JSON.stringify(
cashInAmount
)}`
);
if(cashInAmount > 0) {
//INSERT CASH-IN
const cashIn = await model.insertCashIn(trx, dataCahsIn);
+5 -3
View File
@@ -299,9 +299,11 @@ const getReserve = async (trx, code, date, invoice) => {
.where('tdpr.c_status', '=', 'S')
.whereNotNull('tdi.c_return_sap')
.whereNotNull('tdrb.c_load_balance_no')
.whereRaw(
`tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
);
.whereNull('tdrb.c_cash_in_no')
// .whereRaw(
// `tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
// );
return res;
};
@@ -91,8 +91,8 @@ const cardHistory = async (req, res) => {
new Date((parseInt(element.slice(0, 8), 16) + 946684800) * 1000)
).format('YYYY-MM-DD HH:mm:ss');
nominal = parseInt(element.slice(8, 16), 16);
mid = element.slice(16, 20);
tid = element.slice(20, 24);
mid = element.slice(16, 20).toUpperCase();
tid = element.slice(20, 24).toUpperCase();
// blok yang menandakan konten untuk reska
checkReskaFormat = element.slice(14, 20);
@@ -198,6 +198,14 @@ const history = async (req, res) => {
// param
let { mid, tid, card_number, start_date, end_date } = req.body;
if (mid) {
mid = mid.toUpperCase();
}
if (tid) {
tid = tid.toUpperCase();
}
// log info
winston.logger.info(
`${uniqueCode} [ REQUEST CARD-HISTORY-FROM-CMS ]: ${JSON.stringify(
@@ -6,6 +6,7 @@ const _sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const moment = require('moment');
const {
setLoadBalanceNumberSequence,
getLoadBalanceNumberSequence2,
} = require('../../middlewares/redis.middleware');
moment.locale('id');
@@ -68,8 +69,9 @@ const generateLoadBalanceNumber = async (data, date, counter) => {
// insert to temp load balance number
let insert = await model.insertLoadBalanceNumber(loadBalanceNumber);
// console.log("DEBUGING insert", insert)
if (insert.rowCount < 1) {
loadBalanceNumber = 'XX';
loadBalanceNumber = 'DUPLICATE';
}
return loadBalanceNumber;
};
@@ -179,7 +181,7 @@ const updateAllTransaction = async (
);
// update reservation and load balance transaction
await model.updateReservationAndLoadingBalance(
const update = await model.updateReservationAndLoadingBalance(
reservationNumber,
data,
dataLoadingBalanceDetail,
@@ -187,33 +189,37 @@ const updateAllTransaction = async (
flag
);
// log debug
winston.logger.debug(`${uniqueCode} inserting log for card history...`);
if (update) {
// log debug
winston.logger.debug(`${uniqueCode} inserting log for card history...`);
// log card history
await model.createLoadBalanceLog({
i_log_name: 21,
d_log: dataLoadingBalance.d_load_balance,
c_card_number: cardNumber,
c_source: 'CMS',
c_location: getPartner ? getPartner.partner_name : null,
m_balance_before: parseInt(dataLoadingBalance.m_balance),
m_amount: parseInt(dataLoadingBalance.i_topup_amount),
m_balance_after: parseInt(balance),
j_new_data: { data: data, detail: dataLoadingBalanceDetail },
j_old_data: null,
c_note: `LOAD BALANCE ${dataLoadingBalance.i_topup_amount} FROM ${
getPartner ? getPartner.partner_name : null
} SUCCESSFULLY`,
c_status: 'S',
d_created: now,
i_create: null,
c_create_username: 'HSM',
c_create_fullname: 'HARDWARE SECURE MODULE',
c_category: 'T',
});
// log card history
await model.createLoadBalanceLog({
i_log_name: 21,
d_log: dataLoadingBalance.d_load_balance,
c_card_number: cardNumber,
c_source: 'CMS',
c_location: getPartner ? getPartner.partner_name : null,
m_balance_before: parseInt(dataLoadingBalance.m_balance),
m_amount: parseInt(dataLoadingBalance.i_topup_amount),
m_balance_after: parseInt(balance),
j_new_data: { data: data, detail: dataLoadingBalanceDetail },
j_old_data: null,
c_note: `LOAD BALANCE ${dataLoadingBalance.i_topup_amount} FROM ${
getPartner ? getPartner.partner_name : null
} SUCCESSFULLY`,
c_status: 'S',
d_created: now,
i_create: null,
c_create_username: 'HSM',
c_create_fullname: 'HARDWARE SECURE MODULE',
c_category: 'T',
});
return true;
return true;
} else {
return false;
}
} else {
// insert new load balance transaction by data on card and update data reservation
@@ -264,7 +270,7 @@ const updateAllTransaction = async (
loadBalanceNoSequence
);
if (newLoadBalanceNumber != 'XX') {
if (newLoadBalanceNumber != 'DUPLICATE') {
// set sequence to redis
// await setLoadBalanceNumberSequence(
// req.partner_id_token,
@@ -287,7 +293,7 @@ const updateAllTransaction = async (
}
maxLoop++;
} while (newLoadBalanceNumber == 'XX');
} while (newLoadBalanceNumber == 'DUPLICATE');
let dataLoadBalance = {
c_load_balance_no: newLoadBalanceNumber,
@@ -458,7 +464,7 @@ const loadingBalanceRequest = async (req, res) => {
let cardBlacklist = await model.getCardBlacklist(card_number);
if (cardBlacklist) {
if(cardBlacklist.c_status == 'B') {
if (cardBlacklist.c_status == 'B') {
result = {
code: '445',
message: 'Card is Blacklisted',
@@ -474,44 +480,44 @@ const loadingBalanceRequest = async (req, res) => {
// );
// jika settingan untuk server adalah production
if (process.env.SERVER_FOR == 'production') {
// jika settingan production maka nomor kartu yang di request harus berawalan angka 1, jika bukan angka 1 maka ditolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // jika settingan production maka nomor kartu yang di request harus berawalan angka 1, jika bukan angka 1 maka ditolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
} else {
// jika settingan bukan production, bisa development atau local maka jika ada nomor kartu berawalan angka 1 maka ditolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan production, bisa development atau local maka jika ada nomor kartu berawalan angka 1 maka ditolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// }
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
@@ -1470,8 +1476,81 @@ const loadingBalanceInsert = async (req, param) => {
// `${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: getting loading balance sequence...`
// );
// Pindah ke bawah (nested if condition)
// if (!loadBalanceNoSequence) {
// // get loading balance
// getLoadBalanceSequence = await model.getLoadBalanceSequence(
// getPartner,
// today
// );
// loadBalanceNoSequence = getLoadBalanceSequence
// ? parseInt(getLoadBalanceSequence.i_load_balance_no_seq) + 1
// : 1;
// }
let maxLoop = 0;
// do {
// // await _sleep(helper.randomNumberInt());
// console.log("DEBUGING loadBalanceNoSequence", loadBalanceNoSequence)
// if (maxLoop > 0) {
// loadBalanceNoSequence++;
// }
// // set sequence to redis
// await setLoadBalanceNumberSequence(
// req.partner_id_token,
// loadBalanceNoSequence
// );
// // log warn
// // winston.logger.warn(
// // `${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: generating load balance number...`
// // );
// loadBalanceNumber = await generateLoadBalanceNumber(
// getPartner,
// moment(today).format('YYMMDD'),
// loadBalanceNoSequence
// );
// // if (loadBalanceNumber != 'XX') {
// // set sequence to redis
// // await setLoadBalanceNumberSequence(
// // req.partner_id_token,
// // loadBalanceNoSequence
// // );
// // }
// // log warn
// winston.logger.debug(
// `${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: load balance number sequence is ${loadBalanceNoSequence}.`
// );
// if (maxLoop > maxLoopParameter) {
// // create log
// winston.logger.error(
// `${uniqueCode} [ RESPONSE LOADING-BALANCE-INSERT ]: 500 internal server error. Server is busy. please try again`
// );
// return {
// code: '500',
// message:
// process.env.NODE_ENV != 'production'
// ? '500 internal server error (max loop) - backend server.'
// : '500 internal server error (max loop) - backend server.',
// data: {},
// };
// }
// maxLoop++;
// } while (loadBalanceNumber == 'XX');
//================== Start nested if condition ====================
loadBalanceNoSequence = await getLoadBalanceNumberSequence2(req);
console.log('DEBUGING loadBalanceNoSequence START', loadBalanceNoSequence);
if (!loadBalanceNoSequence) {
// get loading balance
getLoadBalanceSequence = await model.getLoadBalanceSequence(
getPartner,
today
@@ -1479,65 +1558,130 @@ const loadingBalanceInsert = async (req, param) => {
loadBalanceNoSequence = getLoadBalanceSequence
? parseInt(getLoadBalanceSequence.i_load_balance_no_seq) + 1
: 1;
}
let maxLoop = 0;
do {
// await _sleep(helper.randomNumberInt());
if (maxLoop > 0) {
loadBalanceNoSequence++;
}
// set sequence to redis
await setLoadBalanceNumberSequence(
req.partner_id_token,
loadBalanceNoSequence + 1
);
console.log(
'Masuk kondisi !loadBalanceNoSequence',
loadBalanceNoSequence
);
}
// log warn
// winston.logger.warn(
// `${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: generating load balance number...`
// );
// Percobaan 1
loadBalanceNumber = await generateLoadBalanceNumber(
getPartner,
moment(today).format('YYMMDD'),
loadBalanceNoSequence
);
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT Percobaan 1 ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
console.log('DEBUGING loadBalanceNumber PERCOBAAN 1', loadBalanceNumber);
if (loadBalanceNumber == 'DUPLICATE') {
loadBalanceNoSequence = await getLoadBalanceNumberSequence2(req);
console.log(
'DEBUGING loadBalanceNoSequence PERCOBAAN 2',
loadBalanceNoSequence
);
// Percobaan 2
loadBalanceNumber = await generateLoadBalanceNumber(
getPartner,
moment(today).format('YYMMDD'),
loadBalanceNoSequence
);
// if (loadBalanceNumber != 'XX') {
// set sequence to redis
// await setLoadBalanceNumberSequence(
// req.partner_id_token,
// loadBalanceNoSequence
// );
// }
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: load balance number sequence is ${loadBalanceNoSequence}.`
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT Percobaan 2 ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
if (maxLoop > maxLoopParameter) {
// create log
winston.logger.error(
`${uniqueCode} [ RESPONSE LOADING-BALANCE-INSERT ]: 500 internal server error. Server is busy. please try again`
console.log('DEBUGING loadBalanceNumber PERCOBAAN 2', loadBalanceNumber);
if (loadBalanceNumber == 'DUPLICATE') {
loadBalanceNoSequence = await getLoadBalanceNumberSequence2(req);
console.log(
'DEBUGING loadBalanceNoSequence PERCOBAAN 3',
loadBalanceNoSequence
);
// Percobaan 3
loadBalanceNumber = await generateLoadBalanceNumber(
getPartner,
moment(today).format('YYMMDD'),
loadBalanceNoSequence
);
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT Percobaan 3 ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
console.log(
'DEBUGING loadBalanceNumber PERCOBAAN 3',
loadBalanceNumber
);
if (loadBalanceNumber == 'DUPLICATE') {
loadBalanceNoSequence = await getLoadBalanceNumberSequence2(req);
console.log(
'DEBUGING loadBalanceNoSequence PERCOBAAN 4',
loadBalanceNoSequence
);
// Percobaan 4
loadBalanceNumber = await generateLoadBalanceNumber(
getPartner,
moment(today).format('YYMMDD'),
loadBalanceNoSequence
);
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT Percobaan 4 ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
console.log(
'DEBUGING loadBalanceNumber PERCOBAAN 4',
loadBalanceNumber
);
if (loadBalanceNumber == 'DUPLICATE') {
loadBalanceNoSequence = await getLoadBalanceNumberSequence2(req);
console.log(
'DEBUGING loadBalanceNoSequence PERCOBAAN 5',
loadBalanceNoSequence
);
// Percobaan 5
loadBalanceNumber = await generateLoadBalanceNumber(
getPartner,
moment(today).format('YYMMDD'),
loadBalanceNoSequence
);
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT Percobaan 5 ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
console.log(
'DEBUGING loadBalanceNumber PERCOBAAN 5',
loadBalanceNumber
);
if (loadBalanceNumber == 'DUPLICATE') {
// log warn
winston.logger.debug(
`${uniqueCode} [ PROCESSING LOADING-BALANCE-INSERT ]: load balance number sequence is ${loadBalanceNoSequence}.`
);
// create log
winston.logger.error(
`${uniqueCode} [ RESPONSE LOADING-BALANCE-INSERT ]: 505 internal server error. Server is busy. please try again`
);
return {
code: '500',
message:
process.env.NODE_ENV != 'production'
? '500 internal server error (max loop) - backend server.'
: '500 internal server error (max loop) - backend server.',
data: {},
};
return {
code: '505',
message:
process.env.NODE_ENV != 'production'
? '505 internal server error (max loop) - backend server.'
: '505 Server is busy. please try again.',
data: {},
};
}
}
}
}
}
maxLoop++;
} while (loadBalanceNumber == 'XX');
//================== End nested if condition ====================
let data = {
c_load_balance_no: loadBalanceNumber,
d_load_balance: now,
@@ -1681,7 +1825,6 @@ const loadingBalanceInsert = async (req, param) => {
// balance
// )} [FLAG] : ${JSON.stringify(flag)}`
// );
if (insertLoadingBalance > 0) {
result = {
code: '00',
@@ -1,4 +1,5 @@
const knex = require('../../../infrastructure/database/knex');
const winston = require('../../helpers/winston.logger');
// CHECK CARD NUMBER
const checkCardNumber = (cardNumber) => {
@@ -304,7 +305,7 @@ const insertLoadingBalance = async (
let loadDetail = [];
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id,
i_load_balance: id.i_load_balance,
i_reservation_balance: element.i_reservation_balance,
c_reservation_no: element.c_reservation_no,
i_amount: element.i_amount,
@@ -336,7 +337,7 @@ const insertLoadingBalance = async (
let loadDetail = [];
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id,
i_load_balance: id.i_load_balance,
i_reservation_balance: element.i_reservation_balance,
c_reservation_no: element.c_reservation_no,
i_amount: element.i_amount,
@@ -499,7 +500,7 @@ const insertLoadingBalanceHistoryOnly = async (
let loadDetail = [];
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id,
i_load_balance: id.i_load_balance,
i_reservation_balance: element.i_reservation_balance,
c_reservation_no: element.c_reservation_no,
i_amount: element.i_amount,
@@ -623,17 +624,34 @@ const updateReservationAndLoadingBalance = async (
.where('c_load_balance_no', data.c_load_balance_no)
.then(() => {
// insert load balance history
// winston.logger.debug(
// `${reservationNumber} proses insert t_d_load_balance_history updateReservationAndLoadingBalance`
// );
return knex('trx.t_d_load_balance_history')
.transacting(trx)
.returning('i_load_balance')
.insert(data);
})
.then((history) => {
// winston.logger.debug(
// `${JSON.stringify(history)} history t_d_load_balance_history_detail`
// );
// winston.logger.debug(
// `${JSON.stringify(
// history[0]
// )} id t_d_load_balance_history_detail before parseint`
// );
let id = history[0];
// winston.logger.debug(
// `${id} id t_d_load_balance_history_detail id only`
// );
// winston.logger.debug(
// `${id.i_load_balance} id t_d_load_balance_history_detail id.i_load_balance`
// );
let loadDetail = [];
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id,
i_load_balance: id.i_load_balance,
i_reservation_balance: element.i_reservation_balance,
c_reservation_no: element.c_reservation_no,
i_amount: element.i_amount,
@@ -648,6 +666,11 @@ const updateReservationAndLoadingBalance = async (
});
});
// winston.logger.debug(
// `${reservationNumber} proses insert t_d_load_balance_history_detail updateReservationAndLoadingBalance: ${JSON.stringify(
// loadDetail
// )}`
// );
// insert detail load balance
return knex('trx.t_d_load_balance_history_detail')
.transacting(trx)
@@ -655,6 +678,9 @@ const updateReservationAndLoadingBalance = async (
})
.then(() => {
// update reservation
// winston.logger.debug(
// `${reservationNumber} proses update t_d_reservation_balance updateReservationAndLoadingBalance`
// );
return knex('trx.t_d_reservation_balance')
.transacting(trx)
.update({
@@ -671,16 +697,31 @@ const updateReservationAndLoadingBalance = async (
})
.whereIn('c_reservation_no', reservationNumber);
})
.then(trx.commit)
.catch(trx.rollback);
.then(() => {
// winston.logger.debug(`${reservationNumber} commit transaction`);
trx.commit();
})
.catch((error) => {
winston.logger.debug(
`${reservationNumber} rollback transaction: ${error.message}`
);
trx.rollback(); // Rollback transaction
// throw error; // Rethrow error to outer catch
});
})
.then((result) => {
// winston.logger.debug(
// `${reservationNumber} result success ${JSON.stringify(result)}}`
// );
// console.log(result);
return result.rowCount;
return true;
})
.catch((error) => {
winston.logger.debug(
`${reservationNumber} result error: ${error.message}`
);
// console.log(error.message);
return error.message;
return false;
});
};
@@ -1021,7 +1062,7 @@ const updateReservationAndInsertLoadingBalance = async (
let loadDetail = [];
detailLoadBalance.forEach((element) => {
loadDetail.push({
i_load_balance: id,
i_load_balance: id.i_load_balance,
i_reservation_balance: element.i_reservation_balance,
c_reservation_no: element.c_reservation_no,
i_amount: element.i_reservation_amount,
+16 -33
View File
@@ -245,40 +245,22 @@ const validateBlacklist = async (card_number, uniqueCode) => {
//CHECK LAST BALANCE CTR
const checkLastBalanceCTS = async (card_number, uniqueCode, req) => {
let result = {};
let auth = req.header('Authorization');
token_api = auth.replace('Bearer ', '');
const protocol = req.protocol;
const host = req.headers.host;
const current_url = protocol+'://'+host;
let config = {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token_api
},
};
const dataPost = { 'card_number': card_number }
const url = current_url + `/api/pos/card-lastbalance`;
const resp = await axios.post(url, dataPost, config);
//LOG-INFO
winston.logger.info(
`${uniqueCode} [ card_number ]: ${JSON.stringify(card_number)}`
);
if(resp.data.data == undefined || resp.data.data.detail.last_balance == undefined) {
result = {
code: '446',
message: 'Card number not exist in CTS to get last balance',
data: {
status: false,
detail: {
last_balance: last_balance
}
}
};
//LOG-INFO
winston.logger.info(
`${uniqueCode} [ RESPONSE GET LAST-BALANCE FROM CTS ]: ${JSON.stringify(result)}`
);
return result;
let last_balance = 0;
let getLastBalanceFromCardHistory = await model.getLastBalanceFromCardHistory(card_number);
//LOG-INFO
winston.logger.info(
`${uniqueCode} [ getLastBalanceFromCardHistory ]: ${JSON.stringify(getLastBalanceFromCardHistory)}`
);
if (getLastBalanceFromCardHistory) {
last_balance = getLastBalanceFromCardHistory.m_balance_after;
}
result = {
@@ -287,7 +269,7 @@ const checkLastBalanceCTS = async (card_number, uniqueCode, req) => {
data: {
status: true,
detail: {
last_balance: resp.data.data.detail.last_balance
last_balance: last_balance
}
}
};
@@ -297,6 +279,7 @@ const checkLastBalanceCTS = async (card_number, uniqueCode, req) => {
`${uniqueCode} [ RESPONSE GET LAST-BALANCE FROM CTS ]: ${JSON.stringify(result)}`
);
return result;
};
//VALIDATE CARD PRODUCT
@@ -10,11 +10,20 @@ const validate = (method) => {
switch (method) {
case 'callbackOy':
return [
body('partner_trx_id').not().isEmpty().withMessage('Partner Trx Id is required'),
body('partner_trx_id')
.not()
.isEmpty()
.withMessage('Partner Trx Id is required'),
body('trx_id').not().isEmpty().withMessage('Trx Id is required'),
body('amount').not().isEmpty().withMessage('Amount is required'),
body('recipient_bank').not().isEmpty().withMessage('Recipient Bank is required'),
body('recipient_account').not().isEmpty().withMessage('Recipient Account is required'),
body('recipient_bank')
.not()
.isEmpty()
.withMessage('Recipient Bank is required'),
body('recipient_account')
.not()
.isEmpty()
.withMessage('Recipient Account is required'),
];
default:
break;
@@ -29,7 +38,18 @@ const callbackOy = async (req, res) => {
let result = {};
// param
let { status, amount, recipient_name, recipient_bank, recipient_account, trx_id, partner_trx_id, timestamp, created_date, last_updated_date } = req.body;
let {
status,
amount,
recipient_name,
recipient_bank,
recipient_account,
trx_id,
partner_trx_id,
timestamp,
created_date,
last_updated_date,
} = req.body;
// log info
winston.logger.info(
@@ -52,17 +72,23 @@ const callbackOy = async (req, res) => {
return res.status(200).json(result);
}
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
winston.logger.warn(
`${uniqueCode} [ RESPONSE REFUND-KMT ]: ${JSON.stringify(result)}`
);
let recipient_bank_code = recipient_bank.toLowerCase();
let recipient_bank_code = recipient_bank.toUpperCase();
// check trx_id yang di request match
let checkRequest = await model.checkRedeem(partner_trx_id, trx_id, amount, recipient_bank_code, recipient_account);
let checkRequest = await model.checkRedeem(
partner_trx_id,
trx_id,
amount,
recipient_bank_code,
recipient_account
);
if (!checkRequest) {
result = {
code: '400',
@@ -89,56 +115,67 @@ const callbackOy = async (req, res) => {
`${uniqueCode} [ checkRequest ]: ${JSON.stringify(checkRequest)}`
);
if(status.code != '000') {
if (status.code != '000') {
result = {
code: '400',
message: status.message,
data: {
trx_id: trx_id,
partner_trx_id: partner_trx_id,
amount: amount,
recipient_bank: recipient_bank_code,
amount: amount,
recipient_bank: recipient_bank_code,
recipient_account: recipient_account,
},
};
}
const unixTimeZero = Date.parse(last_updated_date);
const date_reimbursement = moment(unixTimeZero).format("YYYY-MM-DD HH:mm:ss")
const date_reimbursement = moment(last_updated_date, 'DD-MM-YYYY HH:mm:ss').format(
'YYYY-MM-DD HH:mm:ss'
);
winston.logger.warn(
`${uniqueCode} [ log date_reimbusement ]: ${JSON.stringify(date_reimbursement)}`
);
//Update Card Replacement
await model.updateReplacementComplete(checkRequest.i_card_replacement, checkRequest.c_request_no, date_reimbursement);
await model.updateReplacementComplete(
checkRequest.i_card_replacement,
checkRequest.c_request_no,
date_reimbursement
);
/*
//Notif Email
let urlCMS = '';
if (process.env.SERVER_FOR == 'production') {
urlCMS = 'https://cms.kci.id';
} else if(process.env.SERVER_FOR == 'development') {
urlCMS = 'http://10.20.14.18';
urlCMS = 'https://cms.kci.id';
} else if (process.env.SERVER_FOR == 'development') {
urlCMS = 'http://10.20.14.69';
} else {
urlCMS = 'http://localhost:8000';
}
let axios = require('axios');
const url = urlCMS + '/api/redeem/notifemail'
console.log('urlCMS', url)
const url = urlCMS + '/api/redeem/notifemail';
console.log('urlCMS', url);
// let resp = await axios.post(url, body, config);
const responseMail = await axios({
method: 'post',
url: url,
headers: {
'Content-Type': 'application/json'
},
'Content-Type': 'application/json',
},
data: {
i_card_replacement: checkRequest.i_card_replacement?.trim(),
c_request_no: checkRequest.c_request_no?.trim(),
c_card_no: checkRequest.c_card_no?.trim(),
status: 'complete'
}
status: 'complete',
},
});
console.log('urlCMS', url)
*/
// console.log('urlCMS', url)
result = {
code: '00',
@@ -146,10 +183,10 @@ const callbackOy = async (req, res) => {
data: {
trx_id: trx_id,
partner_trx_id: partner_trx_id,
amount: amount,
recipient_bank: recipient_bank,
amount: amount,
recipient_bank: recipient_bank,
recipient_account: recipient_account,
last_updated_date: last_updated_date
last_updated_date: last_updated_date,
},
};
@@ -178,5 +215,5 @@ const callbackOy = async (req, res) => {
module.exports = {
validate,
callbackOy
callbackOy,
};
@@ -32,6 +32,13 @@ const updateReplacementComplete = (i_replacement, request_no, date_disburse) =>
let result = knex("trx.t_d_card_replacement")
.where("i_card_replacement", i_replacement)
.where("c_request_no", request_no)
// .update({
// c_status: "A",
// c_status_name: "COMPLETED",
// d_disburse: date_disburse,
// c_response_code: "000",
// c_response_message: "Success"
// });
.update({
c_status: "A",
c_status_name: "COMPLETED",
@@ -162,42 +162,42 @@ const checkReservation = async (req, res) => {
}
// jika settingan diperuntukan untuk production
if (process.env.SERVER_FOR == 'production') {
// kartu yang di request bukan kartu production maka akan di tolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // kartu yang di request bukan kartu production maka akan di tolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
// result
// )}`
// );
// // log warn
// // winston.logger.warn(
// // `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
// // result
// // )}`
// // );
return res.status(200).json(result);
}
} else {
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// // log warn
// // winston.logger.warn(
// // `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
// // result
// // )}`
// // );
// return res.status(200).json(result);
// }
// }
// log debug
// proses pengecekkan data partner berdasarkan mid dan tid yang di request, apakah terdaftar di sistem CMS atau tidak
@@ -368,44 +368,44 @@ const reservationValidate = async (req, res) => {
}
// jika settingan diperuntukan untuk production
if (process.env.SERVER_FOR == 'production') {
// kartu yang di request bukan kartu production maka akan di tolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // kartu yang di request bukan kartu production maka akan di tolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
} else {
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// }
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
@@ -813,44 +813,44 @@ const reservationValidateV2 = async (req, res) => {
// );
// jika settingan diperuntukan untuk production
if (process.env.SERVER_FOR == 'production') {
// kartu yang di request bukan kartu production maka akan di tolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // kartu yang di request bukan kartu production maka akan di tolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
} else {
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
result
)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
// result
// )}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// }
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
@@ -1307,40 +1307,40 @@ const reservation = async (req, res) => {
}
// jika settingan diperuntukan untuk production
if (process.env.SERVER_FOR == 'production') {
// kartu yang di request bukan kartu production maka akan di tolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // kartu yang di request bukan kartu production maka akan di tolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
// );
return res.status(200).json(result);
}
} else {
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// }
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
@@ -2122,40 +2122,40 @@ const reservationV2 = async (req, res) => {
// );
// jika settingan diperuntukan untuk production
if (process.env.SERVER_FOR == 'production') {
// kartu yang di request bukan kartu production maka akan di tolak
if (card_number.substring(0, 1) != '1') {
result = {
code: '400',
message: "It's not production card number.",
data: {},
};
// if (process.env.SERVER_FOR == 'production') {
// // kartu yang di request bukan kartu production maka akan di tolak
// if (card_number.substring(0, 1) != '1') {
// result = {
// code: '400',
// message: "It's not production card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
// );
return res.status(200).json(result);
}
} else {
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
if (card_number.substring(0, 1) == '1') {
result = {
code: '400',
message:
"It's production card number. Please use the development card number.",
data: {},
};
// return res.status(200).json(result);
// }
// } else {
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
// if (card_number.substring(0, 1) == '1') {
// result = {
// code: '400',
// message:
// "It's production card number. Please use the development card number.",
// data: {},
// };
// log warn
winston.logger.warn(
`${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
);
// // log warn
// winston.logger.warn(
// `${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
// );
return res.status(200).json(result);
}
}
// return res.status(200).json(result);
// }
// }
// time
let now = moment().format('YYYY-MM-DD HH:mm:ss');
@@ -2653,6 +2653,8 @@ const reservationV2 = async (req, res) => {
// `${uniqueCode} [ PROCESSING RESERVATION-V2 ] inserting reservation transaction...`
// );
// (belum) ada issue disini, jadi ada case reservation number nya sama, terus error query harusnya ada handle response message nya, yg sekarang malah masuk ke blok reservation saved successfully.
// insert transaction
let insert = await model.insertReservation(data);
+1522 -1584
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1,7 +1,7 @@
{
"name": "topuponline",
"version": "1.0.0",
"description": "",
"version": "1.5.7",
"description": "change file rotate log from 90 days to 60 days",
"main": "index.js",
"scripts": {
"start": "nodemon index",
@@ -22,7 +22,7 @@
},
"homepage": "https://github.com/mohamadihsan/topuponline#readme",
"dependencies": {
"axios": "^0.27.2",
"axios": "^1.7.7",
"bcrypt": "^5.0.1",
"body-parser": "^1.19.0",
"check-internet-connected": "^2.0.6",
@@ -32,8 +32,8 @@
"express": "^4.17.1",
"express-validator": "^6.10.0",
"express-winston": "^4.2.0",
"jsonwebtoken": "^8.5.1",
"knex": "^0.95.4",
"jsonwebtoken": "^9.0.2",
"knex": "^3.1.0",
"moment": "^2.29.3",
"node-cron": "^3.0.1",
"pg": "^8.6.0",
@@ -41,12 +41,12 @@
"prom-client": "^14.2.0",
"redis": "^4.6.5",
"response-time": "^2.3.2",
"sticky-session": "^1.1.2",
"sticky-session": "^0.1.0",
"winston": "^3.7.2",
"winston-daily-rotate-file": "^4.7.1",
"winston-loki": "^6.0.6",
"ws": "^8.5.0",
"xml2js": "^0.4.23"
"xml2js": "^0.6.2"
},
"devDependencies": {
"jest": "^29.0.2",