mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 11:56:27 +00:00
Merge branch 'develop_v1.4.4' into develop
This commit is contained in:
@@ -249,6 +249,12 @@ const updateAllTransaction = async (
|
||||
loadBalanceNoSequence++;
|
||||
}
|
||||
|
||||
// set sequence to redis
|
||||
await setLoadBalanceNumberSequence(
|
||||
req.partner_id_token,
|
||||
loadBalanceNoSequence
|
||||
);
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(`${uniqueCode} generating load balance number...`);
|
||||
|
||||
@@ -260,10 +266,10 @@ const updateAllTransaction = async (
|
||||
|
||||
if (newLoadBalanceNumber != 'XX') {
|
||||
// set sequence to redis
|
||||
await setLoadBalanceNumberSequence(
|
||||
req.partner_id_token,
|
||||
loadBalanceNoSequence
|
||||
);
|
||||
// await setLoadBalanceNumberSequence(
|
||||
// req.partner_id_token,
|
||||
// loadBalanceNoSequence
|
||||
// );
|
||||
}
|
||||
|
||||
// log warn
|
||||
@@ -274,7 +280,7 @@ const updateAllTransaction = async (
|
||||
if (maxLoop > maxLoopParameter) {
|
||||
// create log
|
||||
winston.logger.error(
|
||||
`500 internal server error. Server is busy. please try again`
|
||||
`${uniqueCode} 500 internal server error. Server is busy. please try again`
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -325,26 +331,26 @@ const updateAllTransaction = async (
|
||||
await model.createDetailLoadBalanceFromReservation(reservationNumber);
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} detail load balance with reservation no : ${JSON.stringify(
|
||||
reservationNumber
|
||||
)}`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${uniqueCode} detail load balance with reservation no : ${JSON.stringify(
|
||||
// reservationNumber
|
||||
// )}`
|
||||
// );
|
||||
|
||||
if (detailLoadBalance.length > 0) {
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} AAAAAAAAAAAAAAAAAA1111 [DATA] : ${JSON.stringify(
|
||||
reservationNumber
|
||||
)} [LB] : ${JSON.stringify(dataLoadBalance)} [LBD] : ${JSON.stringify(
|
||||
detailLoadBalance
|
||||
)} [NOW] : ${JSON.stringify(now)} [FLAG] : ${JSON.stringify(flag)}`
|
||||
);
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} AAAAAAAAAAAAAAAAAA1111 [DATA] : ${JSON.stringify(
|
||||
// reservationNumber
|
||||
// )} [LB] : ${JSON.stringify(dataLoadBalance)} [LBD] : ${JSON.stringify(
|
||||
// detailLoadBalance
|
||||
// )} [NOW] : ${JSON.stringify(now)} [FLAG] : ${JSON.stringify(flag)}`
|
||||
// );
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} updating reservation and insert new load balance transaction...`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${uniqueCode} updating reservation and insert new load balance transaction...`
|
||||
// );
|
||||
|
||||
// update reservation and load balance transaction
|
||||
let updateReservationAndInsertLoadingBalance =
|
||||
@@ -357,11 +363,11 @@ const updateAllTransaction = async (
|
||||
);
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} status insert new load balance and update reservation : ${JSON.stringify(
|
||||
updateReservationAndInsertLoadingBalance
|
||||
)}`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${uniqueCode} status insert new load balance and update reservation : ${JSON.stringify(
|
||||
// updateReservationAndInsertLoadingBalance
|
||||
// )}`
|
||||
// );
|
||||
|
||||
// if (updateReservationAndInsertLoadingBalance > 0) {
|
||||
// // log debug
|
||||
@@ -883,7 +889,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
|
||||
if (getBIRegulationStatus.c_value == 'A') {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking topup partial status...`);
|
||||
// winston.logger.debug(`${uniqueCode} checking topup partial status...`);
|
||||
|
||||
// check topup partial status
|
||||
let getTopupPartialStatus = await model.getTopupPartialStatus();
|
||||
@@ -1451,6 +1457,12 @@ const loadingBalanceInsert = async (req, param) => {
|
||||
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...`
|
||||
@@ -1464,10 +1476,10 @@ const loadingBalanceInsert = async (req, param) => {
|
||||
|
||||
if (loadBalanceNumber != 'XX') {
|
||||
// set sequence to redis
|
||||
await setLoadBalanceNumberSequence(
|
||||
req.partner_id_token,
|
||||
loadBalanceNoSequence
|
||||
);
|
||||
// await setLoadBalanceNumberSequence(
|
||||
// req.partner_id_token,
|
||||
// loadBalanceNoSequence
|
||||
// );
|
||||
}
|
||||
|
||||
// log warn
|
||||
@@ -1478,14 +1490,14 @@ const loadingBalanceInsert = async (req, param) => {
|
||||
if (maxLoop > maxLoopParameter) {
|
||||
// create log
|
||||
winston.logger.error(
|
||||
`[ RESPONSE LOADING-BALANCE-INSERT ]: 500 internal server error. Server is busy. please try again`
|
||||
`${uniqueCode} [ RESPONSE LOADING-BALANCE-INSERT ]: 500 internal server error. Server is busy. please try again`
|
||||
);
|
||||
|
||||
return {
|
||||
code: '500',
|
||||
message:
|
||||
process.env.NODE_ENV != 'production'
|
||||
? error.message
|
||||
? '500 internal server error (max loop) - backend server.'
|
||||
: '500 internal server error (max loop) - backend server.',
|
||||
data: {},
|
||||
};
|
||||
@@ -1624,19 +1636,19 @@ const loadingBalanceInsert = async (req, param) => {
|
||||
);
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} [DATA] : ${JSON.stringify(
|
||||
data
|
||||
)} [DETAIL] : ${JSON.stringify(detail)} [RSV] : ${JSON.stringify(
|
||||
reservation_number
|
||||
)} [NOW] : ${JSON.stringify(now)} [WRITE STATUS] : ${JSON.stringify(
|
||||
write_status
|
||||
)} [CARD NUMBER] : ${JSON.stringify(
|
||||
card_number
|
||||
)} [UID] : ${JSON.stringify(uid)} [BALANCE] : ${JSON.stringify(
|
||||
balance
|
||||
)} [FLAG] : ${JSON.stringify(flag)}`
|
||||
);
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} [DATA] : ${JSON.stringify(
|
||||
// data
|
||||
// )} [DETAIL] : ${JSON.stringify(detail)} [RSV] : ${JSON.stringify(
|
||||
// reservation_number
|
||||
// )} [NOW] : ${JSON.stringify(now)} [WRITE STATUS] : ${JSON.stringify(
|
||||
// write_status
|
||||
// )} [CARD NUMBER] : ${JSON.stringify(
|
||||
// card_number
|
||||
// )} [UID] : ${JSON.stringify(uid)} [BALANCE] : ${JSON.stringify(
|
||||
// balance
|
||||
// )} [FLAG] : ${JSON.stringify(flag)}`
|
||||
// );
|
||||
|
||||
if (insertLoadingBalance > 0) {
|
||||
result = {
|
||||
|
||||
Reference in New Issue
Block a user