including:
- remove batch_size di config-gw-wa.json
- merge function, bedakan dengan message_type
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
import { readFileSync } from "fs";
|
|
|
|
interface IConfig {
|
|
base_url: string;
|
|
schedule: string[];
|
|
startDate: string;
|
|
endDate: string;
|
|
messageTypes: {
|
|
mcu: {
|
|
name: string;
|
|
endpoints: {
|
|
listOutbox: string;
|
|
uploadFile: string;
|
|
sendMsg: string;
|
|
changeStatus: string;
|
|
};
|
|
};
|
|
payment: {
|
|
name: string;
|
|
endpoints: {
|
|
listOutbox: string;
|
|
uploadFile: string;
|
|
sendMsg: string;
|
|
changeStatus: string;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
const j_config = JSON.parse(readFileSync("./config-gw-wa.json").toString());
|
|
|
|
const config: IConfig = {
|
|
base_url: j_config["base_url"],
|
|
schedule: j_config["schedule"],
|
|
startDate: j_config["startDate"], // T_OrderHeaderDate. Format: YYYY-MM-DD
|
|
endDate: j_config["endDate"], // T_OrderHeaderDate. Format: YYYY-MM-DD
|
|
messageTypes: {
|
|
mcu: {
|
|
name: "MCU Result",
|
|
endpoints: {
|
|
listOutbox: "mockup/sendwa/sendwa/listoutbox",
|
|
uploadFile: "mockup/sendwa/sendwa/uploadfile",
|
|
sendMsg: "mockup/sendwa/sendwa/QontakSendMsg",
|
|
changeStatus: "mockup/sendwa/sendwa/changeStatusOutbox",
|
|
},
|
|
},
|
|
payment: {
|
|
name: "Payment Receipt",
|
|
endpoints: {
|
|
listOutbox:
|
|
"mockup/fo/cashiernewpayment-cpone-v2/payment/listOutbox",
|
|
uploadFile:
|
|
"mockup/fo/cashiernewpayment-cpone-v2/payment/uploadFile",
|
|
sendMsg:
|
|
"mockup/fo/cashiernewpayment-cpone-v2/payment/qontakSendMsg",
|
|
changeStatus:
|
|
"mockup/fo/cashiernewpayment-cpone-v2/payment/changeStatusOutbox",
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|