mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 23:46:28 +00:00
update const to let and winston to console log
This commit is contained in:
@@ -410,7 +410,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
);
|
||||
|
||||
// check validator
|
||||
const err = validationResult(req, res);
|
||||
let err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
result = {
|
||||
code: '400',
|
||||
@@ -587,15 +587,15 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
);
|
||||
|
||||
// cek disini apakah sebelumnya topup
|
||||
const cardHistory = await model.checkCardHistory(card_number);
|
||||
let cardHistory = await model.checkCardHistory(card_number);
|
||||
|
||||
if (cardHistory.length > 0) {
|
||||
if (cardHistory.i_log_name == 21 && cardHistory.c_source == 'CMS') {
|
||||
if (getReservationPending.length > 0) {
|
||||
// insert semua reserve balance ke fraud
|
||||
const dataFraud = [];
|
||||
const rsv = [];
|
||||
for (const item of getReservationPending) {
|
||||
let dataFraud = [];
|
||||
let rsv = [];
|
||||
for (let item of getReservationPending) {
|
||||
rsv.push(item.c_reservation_no);
|
||||
dataFraud.push({
|
||||
c_card_number: item.c_card_number,
|
||||
@@ -609,7 +609,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} INSERT TO trx.t_d_froud ${JSON.stringify(dataFraud)}`
|
||||
);
|
||||
const fraud = await model.insertFraud(dataFraud);
|
||||
let fraud = await model.insertFraud(dataFraud);
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} RESERVE NUMBER FROM trx.t_d_froud ${JSON.stringify(
|
||||
@@ -840,7 +840,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
);
|
||||
|
||||
// get BI regulation status
|
||||
const getBIRegulationStatus = await model.getBIRegulationStatus();
|
||||
let getBIRegulationStatus = await model.getBIRegulationStatus();
|
||||
|
||||
// check value global parameter
|
||||
if (!getBIRegulationStatus) {
|
||||
@@ -864,7 +864,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
winston.logger.debug(`${uniqueCode} checking topup partial status...`);
|
||||
|
||||
// check topup partial status
|
||||
const getTopupPartialStatus = await model.getTopupPartialStatus();
|
||||
let getTopupPartialStatus = await model.getTopupPartialStatus();
|
||||
|
||||
// check value global parameter
|
||||
if (!getTopupPartialStatus) {
|
||||
@@ -889,7 +889,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
);
|
||||
|
||||
// get max saldo on the card
|
||||
const getMaxAmountOnTheCard = await model.getMaxAmountOnTheCard();
|
||||
let getMaxAmountOnTheCard = await model.getMaxAmountOnTheCard();
|
||||
|
||||
// check value global parameter
|
||||
if (!getMaxAmountOnTheCard) {
|
||||
@@ -1003,7 +1003,7 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
}
|
||||
|
||||
// validate max topup per month
|
||||
const getMaxTopupPerMonth = await model.getMaxTopupPerMonth();
|
||||
let getMaxTopupPerMonth = await model.getMaxTopupPerMonth();
|
||||
|
||||
// check value global parameter
|
||||
if (!getMaxTopupPerMonth) {
|
||||
|
||||
Reference in New Issue
Block a user