mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 23:06:28 +00:00
update
This commit is contained in:
@@ -57,8 +57,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
uniqueCode = await helper.getUniqueCode();
|
||||
|
||||
// param
|
||||
let { mid, tid, card_number, uid, balance, balance_before, flag } =
|
||||
req.body;
|
||||
let { mid, tid, card_number, uid, balance, flag } = req.body;
|
||||
|
||||
// log info
|
||||
winston.logger.info(
|
||||
@@ -171,11 +170,22 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
mid,
|
||||
tid,
|
||||
balance,
|
||||
balance_before,
|
||||
uniqueCode
|
||||
);
|
||||
|
||||
if (insertUpdate) {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} updating flag to server...`);
|
||||
|
||||
// update flag from Server
|
||||
await model.updateFlag(
|
||||
now,
|
||||
card_number,
|
||||
uid.toUpperCase(),
|
||||
balance,
|
||||
flag
|
||||
);
|
||||
|
||||
result = {
|
||||
code: "01",
|
||||
message: "your card number has been cleared successfully",
|
||||
@@ -421,7 +431,6 @@ const loadingBalance = async (req, res) => {
|
||||
write_status,
|
||||
uid,
|
||||
balance,
|
||||
balance_before,
|
||||
flag,
|
||||
unique_code,
|
||||
} = req.body;
|
||||
@@ -620,6 +629,7 @@ const loadingBalance = async (req, res) => {
|
||||
c_tid: getPartner ? getPartner.tid : null,
|
||||
c_card_number: card_number,
|
||||
i_topup_amount: amount,
|
||||
m_balance: balance,
|
||||
c_return_sap: null,
|
||||
i_load_balance_no_seq: loadBalanceNoSequence,
|
||||
c_idm: uid,
|
||||
@@ -726,7 +736,7 @@ const loadingBalance = async (req, res) => {
|
||||
c_card_number: card_number,
|
||||
c_source: "CMS - HSM",
|
||||
c_location: null,
|
||||
m_balance_before: balance_before,
|
||||
m_balance_before: balance - amount > 0 ? balance - amount : 0,
|
||||
m_amount: amount,
|
||||
m_balance_after: balance,
|
||||
j_new_data: { data: data, detail: detail },
|
||||
@@ -859,7 +869,6 @@ const updateReservationAndLoadingBalance = async (
|
||||
mid,
|
||||
tid,
|
||||
balance,
|
||||
balance_before,
|
||||
uniqueCode
|
||||
) => {
|
||||
try {
|
||||
@@ -955,6 +964,7 @@ const updateReservationAndLoadingBalance = async (
|
||||
c_tid: getPartner ? getPartner.tid : null,
|
||||
c_card_number: dataReservation.c_card_number,
|
||||
i_topup_amount: dataLoadingBalance.i_topup_amount,
|
||||
m_balance: dataLoadingBalance.m_balance,
|
||||
c_return_sap: null,
|
||||
i_load_balance_no_seq: loadBalanceNoSequence,
|
||||
c_status: "A",
|
||||
@@ -996,7 +1006,7 @@ const updateReservationAndLoadingBalance = async (
|
||||
c_card_number: dataReservation.c_card_number,
|
||||
c_source: "CMS - HSM",
|
||||
c_location: null,
|
||||
m_balance_before: balance_before,
|
||||
m_balance_before: dataLoadingBalance.m_balance,
|
||||
m_amount: dataLoadingBalance.i_topup_amount,
|
||||
m_balance_after: balance,
|
||||
j_new_data: { data: data, detail: dataLoadingBalanceDetail },
|
||||
|
||||
Reference in New Issue
Block a user