mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 20:26:28 +00:00
add paramter checking card product
This commit is contained in:
@@ -108,27 +108,35 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// // log debug
|
||||
// winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
// get reservation expiration date by parameter
|
||||
let getCheckByCardProductStatusValue =
|
||||
await model.getCheckByCardProductStatusValue();
|
||||
let checkByCardProductStatusValue =
|
||||
getCheckByCardProductStatusValue.c_value;
|
||||
|
||||
// // check card number
|
||||
// let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
// if (!checkCardNumber) {
|
||||
// result = {
|
||||
// code: "413",
|
||||
// message: "card number is not registered",
|
||||
// data: {},
|
||||
// };
|
||||
if (checkByCardProductStatusValue == "A") {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
|
||||
// // log warn
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
// result
|
||||
// )}`
|
||||
// );
|
||||
// check card number
|
||||
let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
if (!checkCardNumber) {
|
||||
result = {
|
||||
code: "413",
|
||||
message: "card number is not registered",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// return res.status(200).json(result);
|
||||
// }
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
result
|
||||
)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
|
||||
@@ -51,6 +51,16 @@ const getIssuer = (id) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
// GET CHECKING CARD PRODUCT FROM GLOBAL PARAMETER
|
||||
const getCheckByCardProductStatusValue = () => {
|
||||
let result = knex("t_m_global_parameter")
|
||||
.select("c_value")
|
||||
.where("c_code", "HSM_CHECK_BY_CARD_PRODUCT_STAT")
|
||||
.where("c_status", "A")
|
||||
.first();
|
||||
return result;
|
||||
};
|
||||
|
||||
// GET RESERVATION PENDING
|
||||
const getReservationPending = (cardNumber, time, flag) => {
|
||||
let result = knex("trx.t_d_reservation_balance")
|
||||
@@ -716,6 +726,7 @@ module.exports = {
|
||||
checkCardNumber,
|
||||
getPartner,
|
||||
getIssuer,
|
||||
getCheckByCardProductStatusValue,
|
||||
getReservationPending,
|
||||
getReservationPendingWithFlagCounter,
|
||||
getReservationPendingWithFlag,
|
||||
|
||||
@@ -205,25 +205,41 @@ const reservationValidate = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// // log debug
|
||||
// winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} getting checking card number by card product CMS status on parameter...`
|
||||
);
|
||||
|
||||
// // check card number
|
||||
// let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
// if (!checkCardNumber) {
|
||||
// result = {
|
||||
// code: "413",
|
||||
// message: "card number is not registered",
|
||||
// data: {},
|
||||
// };
|
||||
// get reservation expiration date by parameter
|
||||
let getCheckByCardProductStatusValue =
|
||||
await model.getCheckByCardProductStatusValue();
|
||||
let checkByCardProductStatusValue =
|
||||
getCheckByCardProductStatusValue.c_value;
|
||||
|
||||
// // log warn
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} RESPONSE reservation validate: ${JSON.stringify(result)}`
|
||||
// );
|
||||
if (checkByCardProductStatusValue == "A") {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
|
||||
// check card number
|
||||
let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
if (!checkCardNumber) {
|
||||
result = {
|
||||
code: "413",
|
||||
message: "card number is not registered",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE reservation validate: ${JSON.stringify(
|
||||
result
|
||||
)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// return res.status(200).json(result);
|
||||
// }
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking reservation amount...`);
|
||||
|
||||
@@ -475,25 +491,33 @@ const reservation = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// // log debug
|
||||
// winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
// get reservation expiration date by parameter
|
||||
let getCheckByCardProductStatusValue =
|
||||
await model.getCheckByCardProductStatusValue();
|
||||
let checkByCardProductStatusValue =
|
||||
getCheckByCardProductStatusValue.c_value;
|
||||
|
||||
// // check card number
|
||||
// let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
// if (!checkCardNumber) {
|
||||
// result = {
|
||||
// code: "413",
|
||||
// message: "card number is not registered",
|
||||
// data: {},
|
||||
// };
|
||||
if (checkByCardProductStatusValue == "A") {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
|
||||
// // log warn
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} RESPONSE reservation: ${JSON.stringify(result)}`
|
||||
// );
|
||||
// check card number
|
||||
let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
if (!checkCardNumber) {
|
||||
result = {
|
||||
code: "413",
|
||||
message: "card number is not registered",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// return res.status(200).json(result);
|
||||
// }
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking reservation amount...`);
|
||||
|
||||
@@ -86,6 +86,16 @@ const getReservationExpirationDateMeasure = () => {
|
||||
return result;
|
||||
};
|
||||
|
||||
// GET CHECKING CARD PRODUCT FROM GLOBAL PARAMETER
|
||||
const getCheckByCardProductStatusValue = () => {
|
||||
let result = knex("t_m_global_parameter")
|
||||
.select("c_value")
|
||||
.where("c_code", "HSM_CHECK_BY_CARD_PRODUCT_STAT")
|
||||
.where("c_status", "A")
|
||||
.first();
|
||||
return result;
|
||||
};
|
||||
|
||||
// GET BI REGULATION STATUS FROM GLOBAL PARAMETER
|
||||
const getBIRegulationStatus = () => {
|
||||
let result = knex("t_m_global_parameter")
|
||||
@@ -286,6 +296,7 @@ module.exports = {
|
||||
getIssuer,
|
||||
getReservationExpirationDateValue,
|
||||
getReservationExpirationDateMeasure,
|
||||
getCheckByCardProductStatusValue,
|
||||
getBIRegulationStatus,
|
||||
getMaxAmountOnTheCard,
|
||||
getMaxTopupPerMonth,
|
||||
|
||||
Reference in New Issue
Block a user