mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 11:16:28 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa7a38c713 | |||
| d13ac26b95 | |||
| 6e7e390ac8 | |||
| 3c8fc4d81d | |||
| 22ce0b611a | |||
| a6c6146933 | |||
| 0113e6dbb1 | |||
| 8d2f4bcda2 | |||
| 9aa3428620 | |||
| e8c73abf2e | |||
| 6275d8cf86 | |||
| 8af96b9a5f | |||
| d9f3516d56 | |||
| b7dec2613f | |||
| d540308d2d | |||
| 9708f81242 | |||
| 35c9fe205c | |||
| b206b50968 |
@@ -262,6 +262,12 @@ const _generateCashIn = async (uniqueCode) => {
|
|||||||
item.c_invoice_no
|
item.c_invoice_no
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// winston.logger.info(
|
||||||
|
// `SCHEDULER-FB70-${uniqueCode} cashIn reserv ${code} DATA : ${JSON.stringify(
|
||||||
|
// reserv
|
||||||
|
// )}`
|
||||||
|
// );
|
||||||
|
|
||||||
//TOTAL AMOUNT CASH-IN
|
//TOTAL AMOUNT CASH-IN
|
||||||
let cashInAmount = 0;
|
let cashInAmount = 0;
|
||||||
for (const itemCI of reserv) {
|
for (const itemCI of reserv) {
|
||||||
@@ -269,6 +275,12 @@ const _generateCashIn = async (uniqueCode) => {
|
|||||||
}
|
}
|
||||||
dataCahsIn.i_amount = cashInAmount;
|
dataCahsIn.i_amount = cashInAmount;
|
||||||
|
|
||||||
|
winston.logger.info(
|
||||||
|
`SCHEDULER-FB70-${uniqueCode} cashInAmount ${code} DATA : ${JSON.stringify(
|
||||||
|
cashInAmount
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
|
||||||
if(cashInAmount > 0) {
|
if(cashInAmount > 0) {
|
||||||
//INSERT CASH-IN
|
//INSERT CASH-IN
|
||||||
const cashIn = await model.insertCashIn(trx, dataCahsIn);
|
const cashIn = await model.insertCashIn(trx, dataCahsIn);
|
||||||
|
|||||||
@@ -299,9 +299,11 @@ const getReserve = async (trx, code, date, invoice) => {
|
|||||||
.where('tdpr.c_status', '=', 'S')
|
.where('tdpr.c_status', '=', 'S')
|
||||||
.whereNotNull('tdi.c_return_sap')
|
.whereNotNull('tdi.c_return_sap')
|
||||||
.whereNotNull('tdrb.c_load_balance_no')
|
.whereNotNull('tdrb.c_load_balance_no')
|
||||||
.whereRaw(
|
.whereNull('tdrb.c_cash_in_no')
|
||||||
`tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
|
// .whereRaw(
|
||||||
);
|
// `tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
|
||||||
|
// );
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ const cardHistory = async (req, res) => {
|
|||||||
new Date((parseInt(element.slice(0, 8), 16) + 946684800) * 1000)
|
new Date((parseInt(element.slice(0, 8), 16) + 946684800) * 1000)
|
||||||
).format('YYYY-MM-DD HH:mm:ss');
|
).format('YYYY-MM-DD HH:mm:ss');
|
||||||
nominal = parseInt(element.slice(8, 16), 16);
|
nominal = parseInt(element.slice(8, 16), 16);
|
||||||
mid = element.slice(16, 20);
|
mid = element.slice(16, 20).toUpperCase();
|
||||||
tid = element.slice(20, 24);
|
tid = element.slice(20, 24).toUpperCase();
|
||||||
|
|
||||||
// blok yang menandakan konten untuk reska
|
// blok yang menandakan konten untuk reska
|
||||||
checkReskaFormat = element.slice(14, 20);
|
checkReskaFormat = element.slice(14, 20);
|
||||||
@@ -198,6 +198,14 @@ const history = async (req, res) => {
|
|||||||
// param
|
// param
|
||||||
let { mid, tid, card_number, start_date, end_date } = req.body;
|
let { mid, tid, card_number, start_date, end_date } = req.body;
|
||||||
|
|
||||||
|
if (mid) {
|
||||||
|
mid = mid.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tid) {
|
||||||
|
tid = tid.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
// log info
|
// log info
|
||||||
winston.logger.info(
|
winston.logger.info(
|
||||||
`${uniqueCode} [ REQUEST CARD-HISTORY-FROM-CMS ]: ${JSON.stringify(
|
`${uniqueCode} [ REQUEST CARD-HISTORY-FROM-CMS ]: ${JSON.stringify(
|
||||||
|
|||||||
@@ -474,44 +474,44 @@ const loadingBalanceRequest = async (req, res) => {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
// jika settingan untuk server adalah production
|
// jika settingan untuk server adalah production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// jika settingan production maka nomor kartu yang di request harus berawalan angka 1, jika bukan angka 1 maka ditolak
|
// // jika settingan production maka nomor kartu yang di request harus berawalan angka 1, jika bukan angka 1 maka ditolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan production, bisa development atau local maka jika ada nomor kartu berawalan angka 1 maka ditolak
|
// // jika settingan bukan production, bisa development atau local maka jika ada nomor kartu berawalan angka 1 maka ditolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE LOADING-BALANCE-REQUEST ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// time
|
// time
|
||||||
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ const insertLoadingBalance = async (
|
|||||||
let loadDetail = [];
|
let loadDetail = [];
|
||||||
detail.forEach((element) => {
|
detail.forEach((element) => {
|
||||||
loadDetail.push({
|
loadDetail.push({
|
||||||
i_load_balance: id,
|
i_load_balance: id.i_load_balance,
|
||||||
i_reservation_balance: element.i_reservation_balance,
|
i_reservation_balance: element.i_reservation_balance,
|
||||||
c_reservation_no: element.c_reservation_no,
|
c_reservation_no: element.c_reservation_no,
|
||||||
i_amount: element.i_amount,
|
i_amount: element.i_amount,
|
||||||
@@ -336,7 +336,7 @@ const insertLoadingBalance = async (
|
|||||||
let loadDetail = [];
|
let loadDetail = [];
|
||||||
detail.forEach((element) => {
|
detail.forEach((element) => {
|
||||||
loadDetail.push({
|
loadDetail.push({
|
||||||
i_load_balance: id,
|
i_load_balance: id.i_load_balance,
|
||||||
i_reservation_balance: element.i_reservation_balance,
|
i_reservation_balance: element.i_reservation_balance,
|
||||||
c_reservation_no: element.c_reservation_no,
|
c_reservation_no: element.c_reservation_no,
|
||||||
i_amount: element.i_amount,
|
i_amount: element.i_amount,
|
||||||
|
|||||||
@@ -10,11 +10,20 @@ const validate = (method) => {
|
|||||||
switch (method) {
|
switch (method) {
|
||||||
case 'callbackOy':
|
case 'callbackOy':
|
||||||
return [
|
return [
|
||||||
body('partner_trx_id').not().isEmpty().withMessage('Partner Trx Id is required'),
|
body('partner_trx_id')
|
||||||
|
.not()
|
||||||
|
.isEmpty()
|
||||||
|
.withMessage('Partner Trx Id is required'),
|
||||||
body('trx_id').not().isEmpty().withMessage('Trx Id is required'),
|
body('trx_id').not().isEmpty().withMessage('Trx Id is required'),
|
||||||
body('amount').not().isEmpty().withMessage('Amount is required'),
|
body('amount').not().isEmpty().withMessage('Amount is required'),
|
||||||
body('recipient_bank').not().isEmpty().withMessage('Recipient Bank is required'),
|
body('recipient_bank')
|
||||||
body('recipient_account').not().isEmpty().withMessage('Recipient Account is required'),
|
.not()
|
||||||
|
.isEmpty()
|
||||||
|
.withMessage('Recipient Bank is required'),
|
||||||
|
body('recipient_account')
|
||||||
|
.not()
|
||||||
|
.isEmpty()
|
||||||
|
.withMessage('Recipient Account is required'),
|
||||||
];
|
];
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -29,7 +38,18 @@ const callbackOy = async (req, res) => {
|
|||||||
let result = {};
|
let result = {};
|
||||||
|
|
||||||
// param
|
// param
|
||||||
let { status, amount, recipient_name, recipient_bank, recipient_account, trx_id, partner_trx_id, timestamp, created_date, last_updated_date } = req.body;
|
let {
|
||||||
|
status,
|
||||||
|
amount,
|
||||||
|
recipient_name,
|
||||||
|
recipient_bank,
|
||||||
|
recipient_account,
|
||||||
|
trx_id,
|
||||||
|
partner_trx_id,
|
||||||
|
timestamp,
|
||||||
|
created_date,
|
||||||
|
last_updated_date,
|
||||||
|
} = req.body;
|
||||||
|
|
||||||
// log info
|
// log info
|
||||||
winston.logger.info(
|
winston.logger.info(
|
||||||
@@ -59,9 +79,15 @@ const callbackOy = async (req, res) => {
|
|||||||
`${uniqueCode} [ RESPONSE REFUND-KMT ]: ${JSON.stringify(result)}`
|
`${uniqueCode} [ RESPONSE REFUND-KMT ]: ${JSON.stringify(result)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
let recipient_bank_code = recipient_bank.toLowerCase();
|
let recipient_bank_code = recipient_bank.toUpperCase();
|
||||||
// check trx_id yang di request match
|
// check trx_id yang di request match
|
||||||
let checkRequest = await model.checkRedeem(partner_trx_id, trx_id, amount, recipient_bank_code, recipient_account);
|
let checkRequest = await model.checkRedeem(
|
||||||
|
partner_trx_id,
|
||||||
|
trx_id,
|
||||||
|
amount,
|
||||||
|
recipient_bank_code,
|
||||||
|
recipient_account
|
||||||
|
);
|
||||||
|
|
||||||
if (!checkRequest) {
|
if (!checkRequest) {
|
||||||
result = {
|
result = {
|
||||||
@@ -103,42 +129,53 @@ const callbackOy = async (req, res) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const unixTimeZero = Date.parse(last_updated_date);
|
const date_reimbursement = moment(last_updated_date, 'DD-MM-YYYY HH:mm:ss').format(
|
||||||
const date_reimbursement = moment(unixTimeZero).format("YYYY-MM-DD HH:mm:ss")
|
'YYYY-MM-DD HH:mm:ss'
|
||||||
|
);
|
||||||
|
|
||||||
|
winston.logger.warn(
|
||||||
|
`${uniqueCode} [ log date_reimbusement ]: ${JSON.stringify(date_reimbursement)}`
|
||||||
|
);
|
||||||
|
|
||||||
//Update Card Replacement
|
//Update Card Replacement
|
||||||
await model.updateReplacementComplete(checkRequest.i_card_replacement, checkRequest.c_request_no, date_reimbursement);
|
await model.updateReplacementComplete(
|
||||||
|
checkRequest.i_card_replacement,
|
||||||
|
checkRequest.c_request_no,
|
||||||
|
date_reimbursement
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
//Notif Email
|
//Notif Email
|
||||||
let urlCMS = '';
|
let urlCMS = '';
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
if (process.env.SERVER_FOR == 'production') {
|
||||||
urlCMS = 'https://cms.kci.id';
|
urlCMS = 'https://cms.kci.id';
|
||||||
} else if (process.env.SERVER_FOR == 'development') {
|
} else if (process.env.SERVER_FOR == 'development') {
|
||||||
urlCMS = 'http://10.20.14.18';
|
urlCMS = 'http://10.20.14.69';
|
||||||
} else {
|
} else {
|
||||||
urlCMS = 'http://localhost:8000';
|
urlCMS = 'http://localhost:8000';
|
||||||
}
|
}
|
||||||
|
|
||||||
let axios = require('axios');
|
let axios = require('axios');
|
||||||
|
|
||||||
const url = urlCMS + '/api/redeem/notifemail'
|
const url = urlCMS + '/api/redeem/notifemail';
|
||||||
console.log('urlCMS', url)
|
console.log('urlCMS', url);
|
||||||
|
|
||||||
// let resp = await axios.post(url, body, config);
|
// let resp = await axios.post(url, body, config);
|
||||||
const responseMail = await axios({
|
const responseMail = await axios({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: url,
|
url: url,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
i_card_replacement: checkRequest.i_card_replacement?.trim(),
|
i_card_replacement: checkRequest.i_card_replacement?.trim(),
|
||||||
c_request_no: checkRequest.c_request_no?.trim(),
|
c_request_no: checkRequest.c_request_no?.trim(),
|
||||||
c_card_no: checkRequest.c_card_no?.trim(),
|
c_card_no: checkRequest.c_card_no?.trim(),
|
||||||
status: 'complete'
|
status: 'complete',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
console.log('urlCMS', url)
|
*/
|
||||||
|
// console.log('urlCMS', url)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
code: '00',
|
code: '00',
|
||||||
@@ -149,7 +186,7 @@ const callbackOy = async (req, res) => {
|
|||||||
amount: amount,
|
amount: amount,
|
||||||
recipient_bank: recipient_bank,
|
recipient_bank: recipient_bank,
|
||||||
recipient_account: recipient_account,
|
recipient_account: recipient_account,
|
||||||
last_updated_date: last_updated_date
|
last_updated_date: last_updated_date,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -178,5 +215,5 @@ const callbackOy = async (req, res) => {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
validate,
|
validate,
|
||||||
callbackOy
|
callbackOy,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ const updateReplacementComplete = (i_replacement, request_no, date_disburse) =>
|
|||||||
let result = knex("trx.t_d_card_replacement")
|
let result = knex("trx.t_d_card_replacement")
|
||||||
.where("i_card_replacement", i_replacement)
|
.where("i_card_replacement", i_replacement)
|
||||||
.where("c_request_no", request_no)
|
.where("c_request_no", request_no)
|
||||||
|
// .update({
|
||||||
|
// c_status: "A",
|
||||||
|
// c_status_name: "COMPLETED",
|
||||||
|
// d_disburse: date_disburse,
|
||||||
|
// c_response_code: "000",
|
||||||
|
// c_response_message: "Success"
|
||||||
|
// });
|
||||||
.update({
|
.update({
|
||||||
c_status: "A",
|
c_status: "A",
|
||||||
c_status_name: "COMPLETED",
|
c_status_name: "COMPLETED",
|
||||||
|
|||||||
@@ -162,42 +162,42 @@ const checkReservation = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// jika settingan diperuntukan untuk production
|
// jika settingan diperuntukan untuk production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// kartu yang di request bukan kartu production maka akan di tolak
|
// // kartu yang di request bukan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
// winston.logger.warn(
|
// // winston.logger.warn(
|
||||||
// `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
|
// // `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
|
||||||
// result
|
// // result
|
||||||
// )}`
|
// // )}`
|
||||||
// );
|
// // );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
// log warn
|
// // log warn
|
||||||
// winston.logger.warn(
|
// // winston.logger.warn(
|
||||||
// `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
|
// // `${uniqueCode} [ RESPONSE RESERVATION-CHECK ]: ${JSON.stringify(
|
||||||
// result
|
// // result
|
||||||
// )}`
|
// // )}`
|
||||||
// );
|
// // );
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// log debug
|
// log debug
|
||||||
// proses pengecekkan data partner berdasarkan mid dan tid yang di request, apakah terdaftar di sistem CMS atau tidak
|
// proses pengecekkan data partner berdasarkan mid dan tid yang di request, apakah terdaftar di sistem CMS atau tidak
|
||||||
@@ -368,44 +368,44 @@ const reservationValidate = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// jika settingan diperuntukan untuk production
|
// jika settingan diperuntukan untuk production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// kartu yang di request bukan kartu production maka akan di tolak
|
// // kartu yang di request bukan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// time
|
// time
|
||||||
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
@@ -813,44 +813,44 @@ const reservationValidateV2 = async (req, res) => {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
// jika settingan diperuntukan untuk production
|
// jika settingan diperuntukan untuk production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// kartu yang di request bukan kartu production maka akan di tolak
|
// // kartu yang di request bukan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
|
// `${uniqueCode} [ RESPONSE RESERVATION-VALIDATE-V2 ]: ${JSON.stringify(
|
||||||
result
|
// result
|
||||||
)}`
|
// )}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// time
|
// time
|
||||||
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
@@ -1307,40 +1307,40 @@ const reservation = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// jika settingan diperuntukan untuk production
|
// jika settingan diperuntukan untuk production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// kartu yang di request bukan kartu production maka akan di tolak
|
// // kartu yang di request bukan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
|
// `${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
|
// `${uniqueCode} [ RESPONSE RESERVATION ]: ${JSON.stringify(result)}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// time
|
// time
|
||||||
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
@@ -2122,40 +2122,40 @@ const reservationV2 = async (req, res) => {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
// jika settingan diperuntukan untuk production
|
// jika settingan diperuntukan untuk production
|
||||||
if (process.env.SERVER_FOR == 'production') {
|
// if (process.env.SERVER_FOR == 'production') {
|
||||||
// kartu yang di request bukan kartu production maka akan di tolak
|
// // kartu yang di request bukan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) != '1') {
|
// if (card_number.substring(0, 1) != '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message: "It's not production card number.",
|
// message: "It's not production card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
|
// `${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
// // jika settingan bukan diperuntukan untuk production, bisa development atau local atau yang lainnya dan kemudian kartu yang di request merupakan kartu production maka akan di tolak
|
||||||
if (card_number.substring(0, 1) == '1') {
|
// if (card_number.substring(0, 1) == '1') {
|
||||||
result = {
|
// result = {
|
||||||
code: '400',
|
// code: '400',
|
||||||
message:
|
// message:
|
||||||
"It's production card number. Please use the development card number.",
|
// "It's production card number. Please use the development card number.",
|
||||||
data: {},
|
// data: {},
|
||||||
};
|
// };
|
||||||
|
|
||||||
// log warn
|
// // log warn
|
||||||
winston.logger.warn(
|
// winston.logger.warn(
|
||||||
`${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
|
// `${uniqueCode} [ RESPONSE RESERVATION-V2 ]: ${JSON.stringify(result)}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
return res.status(200).json(result);
|
// return res.status(200).json(result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// time
|
// time
|
||||||
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
let now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
@@ -2653,6 +2653,8 @@ const reservationV2 = async (req, res) => {
|
|||||||
// `${uniqueCode} [ PROCESSING RESERVATION-V2 ] inserting reservation transaction...`
|
// `${uniqueCode} [ PROCESSING RESERVATION-V2 ] inserting reservation transaction...`
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
// (belum) ada issue disini, jadi ada case reservation number nya sama, terus error query harusnya ada handle response message nya, yg sekarang malah masuk ke blok reservation saved successfully.
|
||||||
|
|
||||||
// insert transaction
|
// insert transaction
|
||||||
let insert = await model.insertReservation(data);
|
let insert = await model.insertReservation(data);
|
||||||
|
|
||||||
|
|||||||
Generated
+1521
-1583
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "topuponline",
|
"name": "topuponline",
|
||||||
"version": "1.0.0",
|
"version": "1.5.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/mohamadihsan/topuponline#readme",
|
"homepage": "https://github.com/mohamadihsan/topuponline#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^1.7.7",
|
||||||
"bcrypt": "^5.0.1",
|
"bcrypt": "^5.0.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"check-internet-connected": "^2.0.6",
|
"check-internet-connected": "^2.0.6",
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-validator": "^6.10.0",
|
"express-validator": "^6.10.0",
|
||||||
"express-winston": "^4.2.0",
|
"express-winston": "^4.2.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"knex": "^0.95.4",
|
"knex": "^3.1.0",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
"node-cron": "^3.0.1",
|
"node-cron": "^3.0.1",
|
||||||
"pg": "^8.6.0",
|
"pg": "^8.6.0",
|
||||||
@@ -41,12 +41,12 @@
|
|||||||
"prom-client": "^14.2.0",
|
"prom-client": "^14.2.0",
|
||||||
"redis": "^4.6.5",
|
"redis": "^4.6.5",
|
||||||
"response-time": "^2.3.2",
|
"response-time": "^2.3.2",
|
||||||
"sticky-session": "^1.1.2",
|
"sticky-session": "^0.1.0",
|
||||||
"winston": "^3.7.2",
|
"winston": "^3.7.2",
|
||||||
"winston-daily-rotate-file": "^4.7.1",
|
"winston-daily-rotate-file": "^4.7.1",
|
||||||
"winston-loki": "^6.0.6",
|
"winston-loki": "^6.0.6",
|
||||||
"ws": "^8.5.0",
|
"ws": "^8.5.0",
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^29.0.2",
|
"jest": "^29.0.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user