mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 10:46:28 +00:00
update log debug
This commit is contained in:
@@ -624,35 +624,30 @@ const updateReservationAndLoadingBalance = async (
|
||||
.where('c_load_balance_no', data.c_load_balance_no)
|
||||
.then(() => {
|
||||
// insert load balance history
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} proses insert t_d_load_balance_history updateReservationAndLoadingBalance`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${reservationNumber} proses insert t_d_load_balance_history updateReservationAndLoadingBalance`
|
||||
// );
|
||||
return knex('trx.t_d_load_balance_history')
|
||||
.transacting(trx)
|
||||
.returning('i_load_balance')
|
||||
.insert(data);
|
||||
})
|
||||
.then((history) => {
|
||||
winston.logger.debug(
|
||||
`${JSON.stringify(history)} history t_d_load_balance_history_detail`
|
||||
);
|
||||
winston.logger.debug(
|
||||
`${JSON.stringify(
|
||||
history[0]
|
||||
)} id t_d_load_balance_history_detail before parseint`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${JSON.stringify(history)} history t_d_load_balance_history_detail`
|
||||
// );
|
||||
// winston.logger.debug(
|
||||
// `${JSON.stringify(
|
||||
// history[0]
|
||||
// )} id t_d_load_balance_history_detail before parseint`
|
||||
// );
|
||||
let id = history[0];
|
||||
winston.logger.debug(
|
||||
`${id} id t_d_load_balance_history_detail id only`
|
||||
);
|
||||
winston.logger.debug(
|
||||
`${id.i_load_balance} id t_d_load_balance_history_detail id.i_load_balance`
|
||||
);
|
||||
winston.logger.info(
|
||||
`${uniqueCode} [ id t_d_load_balance_history_detail after parseint ]: ${JSON.stringify(
|
||||
id
|
||||
)}`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${id} id t_d_load_balance_history_detail id only`
|
||||
// );
|
||||
// winston.logger.debug(
|
||||
// `${id.i_load_balance} id t_d_load_balance_history_detail id.i_load_balance`
|
||||
// );
|
||||
let loadDetail = [];
|
||||
detail.forEach((element) => {
|
||||
loadDetail.push({
|
||||
@@ -671,11 +666,11 @@ const updateReservationAndLoadingBalance = async (
|
||||
});
|
||||
});
|
||||
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} proses insert t_d_load_balance_history_detail updateReservationAndLoadingBalance: ${JSON.stringify(
|
||||
loadDetail
|
||||
)}`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${reservationNumber} proses insert t_d_load_balance_history_detail updateReservationAndLoadingBalance: ${JSON.stringify(
|
||||
// loadDetail
|
||||
// )}`
|
||||
// );
|
||||
// insert detail load balance
|
||||
return knex('trx.t_d_load_balance_history_detail')
|
||||
.transacting(trx)
|
||||
@@ -683,9 +678,9 @@ const updateReservationAndLoadingBalance = async (
|
||||
})
|
||||
.then(() => {
|
||||
// update reservation
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} proses update t_d_reservation_balance updateReservationAndLoadingBalance`
|
||||
);
|
||||
// winston.logger.debug(
|
||||
// `${reservationNumber} proses update t_d_reservation_balance updateReservationAndLoadingBalance`
|
||||
// );
|
||||
return knex('trx.t_d_reservation_balance')
|
||||
.transacting(trx)
|
||||
.update({
|
||||
@@ -703,14 +698,12 @@ const updateReservationAndLoadingBalance = async (
|
||||
.whereIn('c_reservation_no', reservationNumber);
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} commit transaction updateReservationAndLoadingBalance`
|
||||
);
|
||||
winston.logger.debug(`${reservationNumber} commit transaction`);
|
||||
trx.commit();
|
||||
})
|
||||
.catch((error) => {
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} rollback transaction updateReservationAndLoadingBalance: ${error.message}`
|
||||
`${reservationNumber} rollback transaction: ${error.message}`
|
||||
);
|
||||
trx.rollback(); // Rollback transaction
|
||||
// throw error; // Rethrow error to outer catch
|
||||
@@ -718,14 +711,14 @@ const updateReservationAndLoadingBalance = async (
|
||||
})
|
||||
.then((result) => {
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} result updateReservationAndLoadingBalance success`
|
||||
`${reservationNumber} result success ${JSON.stringify(result)}}`
|
||||
);
|
||||
// console.log(result);
|
||||
return result.rowCount;
|
||||
})
|
||||
.catch((error) => {
|
||||
winston.logger.debug(
|
||||
`${reservationNumber} result updateReservationAndLoadingBalance error: ${error.message}`
|
||||
`${reservationNumber} result error: ${error.message}`
|
||||
);
|
||||
// console.log(error.message);
|
||||
return error.message;
|
||||
|
||||
Reference in New Issue
Block a user