mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 10:46:28 +00:00
update funtion add helper scheduler
This commit is contained in:
@@ -57,6 +57,10 @@ const apiGenerateCahsIn = async (req, res) => {
|
||||
`${uniqueCode} REQUEST generate cashin: ${JSON.stringify(req.body)}`
|
||||
);
|
||||
|
||||
const schedulerCode = 'GENERATECASHINONLINETOPUP';
|
||||
const startData = await helper.startScheduler(schedulerCode);
|
||||
const token = startData.c_execution_token ?? null;
|
||||
|
||||
// check validator
|
||||
const err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
@@ -82,6 +86,8 @@ const apiGenerateCahsIn = async (req, res) => {
|
||||
data: cashIn,
|
||||
};
|
||||
|
||||
const finishData = await helper.finishScheduler(token, schedulerCode);
|
||||
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
@@ -165,6 +171,10 @@ const apiGenerateCashInSalesInternal = async (req, res) => {
|
||||
`${uniqueCode} REQUEST generate cashin sales internal: ${JSON.stringify(req.body)}`
|
||||
);
|
||||
|
||||
const schedulerCode = 'GENERATECASHINSALESSTATIONCASHLESS';
|
||||
const startData = await helper.startScheduler(schedulerCode);
|
||||
const token = startData.c_execution_token ?? null;
|
||||
|
||||
// check validator
|
||||
const err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
@@ -190,6 +200,8 @@ const apiGenerateCashInSalesInternal = async (req, res) => {
|
||||
data: cashIn,
|
||||
};
|
||||
|
||||
const finishData = await helper.finishScheduler(token, schedulerCode);
|
||||
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
@@ -219,6 +231,10 @@ const apiGenerateCashInTopUpCashlessInternal = async (req, res) => {
|
||||
`${uniqueCode} REQUEST generate cashin topup cashless internal: ${JSON.stringify(req.body)}`
|
||||
);
|
||||
|
||||
const schedulerCode = 'GENERATECASHINTOPUPSTATIONCASHLESS';
|
||||
const startData = await helper.startScheduler(schedulerCode);
|
||||
const token = startData.c_execution_token ?? null;
|
||||
|
||||
// check validator
|
||||
const err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
@@ -244,6 +260,8 @@ const apiGenerateCashInTopUpCashlessInternal = async (req, res) => {
|
||||
data: cashIn,
|
||||
};
|
||||
|
||||
const finishData = await helper.finishScheduler(token, schedulerCode);
|
||||
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
|
||||
@@ -53,6 +53,10 @@ const apiGenerateInvoice = async (req, res) => {
|
||||
`${uniqueCode} REQUEST generate invoice: ${JSON.stringify(req.body)}`
|
||||
);
|
||||
|
||||
const schedulerCode = 'GENERATEINVOICEONLINETOPUP';
|
||||
const startData = await helper.startScheduler(schedulerCode);
|
||||
const token = startData.c_execution_token ?? null;
|
||||
|
||||
// check validator
|
||||
let err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
@@ -85,6 +89,8 @@ const apiGenerateInvoice = async (req, res) => {
|
||||
data: invoice,
|
||||
};
|
||||
|
||||
const finishData = await helper.finishScheduler(token, schedulerCode);
|
||||
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
@@ -115,6 +121,10 @@ const apiPostingInvoice = async (req, res) => {
|
||||
`${uniqueCode} REQUEST posting invoice: ${JSON.stringify(req.body)}`
|
||||
);
|
||||
|
||||
const schedulerCode = 'POSTINGINVOICEONLINETOPUP';
|
||||
const startData = await helper.startScheduler(schedulerCode);
|
||||
const token = startData.c_execution_token ?? null;
|
||||
|
||||
// check validator
|
||||
let err = validationResult(req, res);
|
||||
if (!err.isEmpty()) {
|
||||
@@ -143,6 +153,8 @@ const apiPostingInvoice = async (req, res) => {
|
||||
data: invoice,
|
||||
};
|
||||
|
||||
const finishData = await helper.finishScheduler(token, schedulerCode);
|
||||
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
|
||||
Reference in New Issue
Block a user