This commit is contained in:
2023-03-03 16:10:17 +07:00
parent a2a9a8c72f
commit 56cbc627a2
@@ -508,23 +508,48 @@ const loadingBalanceRequest = async (req, res) => {
);
// update status to in progress
await model.updateStatusReservation(reservationNumberTemp, now, flag);
result = {
code: '00',
message: 'reservation exists',
data: {
amount: amountTopup,
total_reservation: totalReservation,
reservation_number: reservationNumber,
},
};
// log info
winston.logger.info(
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(result)}`
let updateStatusReservation = await model.updateStatusReservation(
reservationNumberTemp,
now,
flag
);
if (updateStatusReservation) {
result = {
code: '00',
message: 'reservation exists',
data: {
amount: amountTopup,
total_reservation: totalReservation,
reservation_number: reservationNumber,
},
};
// log info
winston.logger.info(
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
result
)}`
);
} else {
result = {
code: '434',
message: '[434] Failed, please try again later',
data: {
amount: amountTopup,
total_reservation: totalReservation,
reservation_number: reservationNumber,
},
};
// log info
winston.logger.info(
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
result
)}`
);
}
return res.json(result);
} catch (error) {
// create log