INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('req-core.itm.0200.230000.002NMB', '[itmit]', CURRENT USER, CURRENT TIMESTAMP);
INSERT INTO MWCONFIG.MAPPING_GROUP (MAPPING_ID, ID, SOURCE, TARGET, INCLUDE_MAPPING_ID, INCLUDE_ID) 
  VALUES 
    ('req-core.itm.0200.230000.002NMB', 1, '/data/body', '/data/body', NULL, NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, '/data/body', '/data/body', NULL, NULL);
INSERT INTO MWCONFIG.MAPPING_GROUP_LINE (MAPPING_ID, MAPPING_GROUP_ID, NAME, TEXT, SEQ) 
  VALUES 
    ('req-core.itm.0200.230000.002NMB', 1, '!connid', '${head.connid}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!destination', 'ist-conn', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!group', '${head.group}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!mappingCode', '${head.code}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!mid', '${head.mid}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!queueName', 'BACKEND_ISO_IN', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!reqtimestamp', '${head.reqtimestamp}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!ReplyToQ', 'ITM_CORE_REPLY', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!ReplyToQMgr', 'ISOBROKER.QM', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!sid', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!source', '${head.source}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '!timestamp', '${head.reqtimestamp}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 1, '@', 'copyMessageToChild("original");copyMessage();', NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, 'additionalDataPrivate', '${msg.additionalDataPrivate."!value".substring(0,16)}', NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, 'isMultipleRequest', 'true', NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, 'mappingCodeMultiple', 'konven', NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, 'processingCode', '940000', NULL), 
    ('req-core.itm.0200.230000.002NMB', 2, 'reservedPrivate3', '${msg.additionalDataPrivate."!value".substring(16,80)}', NULL);

INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('req-core.itm.0200.230000.002NMB.konven', '[itmit]', CURRENT USER, CURRENT TIMESTAMP);
INSERT INTO MWCONFIG.MAPPING_GROUP (MAPPING_ID, ID, SOURCE, TARGET, INCLUDE_MAPPING_ID, INCLUDE_ID) VALUES ('req-core.itm.0200.230000.002NMB.konven', 1, '/data/body', '/data/body', 'req-core.itm.multiple-master.konven', 1);
INSERT INTO MWCONFIG.MAPPING_GROUP_LINE (MAPPING_ID, MAPPING_GROUP_ID, NAME, TEXT, SEQ) 
  VALUES 
    ('req-core.itm.0200.230000.002NMB.konven', 1, '@', 'dtree("CHARGES","!group");', 10), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'ACCTYPE', '${getParamValueWithError("account-type", msg.fromAccount."!value".padLeft(20, "0").substring(11, 13), "error:01Unknown account type " +msg.fromAccount."!value".padLeft(20, "0").substring(11, 13))}', 10), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'dspTransactionCode', '${tar.ACCTYPE?(tar.ACCTYPE."!value".equals("S")?"5195":(tar.ACCTYPE."!value".equals("D")?"5196":null)):null}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF02', '${decimalFormat("0",(msg.amountTransaction."!value".toBigDecimal()+(getCharge(1).toBigDecimal()+getCharge(2).toBigDecimal())*100))}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF03', '${getAccount(2)}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF04', '${decimalFormat("0",(getCharge(2).toBigDecimal())*100)}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF09', '${getAccount(1)}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF10', '${decimalFormat("0",(getCharge(1).toBigDecimal())*100)}', 20), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, '!code', 'AXISSYSTEMSDNBHD.000000${tar.dspTransactionCode}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'amountTransaction', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'fromAccount', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'networkManagementInformation', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'primaryAccountNumber', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'reservedForPrivateUse', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'RMCNT', '${head.request.data.body.original.additionalDataPrivate."!value".substring(43,63)}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'RMSEHS', '${msg.dateLocalTransaction}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBDS1', '${msg.merchantType}:      :${msg.additionalDataPrivate."!value".substring(0,16)}:${msg.retrievalReferenceNumber}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBDS2', '${"      "}:${msg.additionalDataPrivate."!value".substring(0,16)}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF01', '${msg.fromAccount."!value".substring(0,16)}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF15', '${getParamValueWithError("coa", "gl-withdrawal-acquire-"+msg.serviceIndicator."!value".substring(0, 3), "error:92Unknown coa")}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBF16', '${msg.amountTransaction}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBTCD', '${tar.dspTransactionCode}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLBTPN', '${msg.cardAcceptorTerminalIdentification."!value".padRight(16," ")}:${msg.additionalDataPrivate."!value".substring(0,16)}:${msg.retrievalReferenceNumber."!value".padRight(12," ")}', NULL), 
    ('req-core.itm.0200.230000.002NMB.konven', 1, 'TLXUFD', 'ATMCWDW', NULL);

INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('req-core.itm.0200.230000.002NMB.res-reverse', '[itmit]', CURRENT USER, CURRENT TIMESTAMP);
INSERT INTO MWCONFIG.MAPPING_GROUP (MAPPING_ID, ID, SOURCE, TARGET, INCLUDE_MAPPING_ID, INCLUDE_ID) VALUES ('req-core.itm.0200.230000.002NMB.res-reverse', 1, '/data/body', '/data/body', 'req-core.itm.res-reverse-master', 1);
INSERT INTO MWCONFIG.MAPPING_GROUP_LINE (MAPPING_ID, MAPPING_GROUP_ID, NAME, TEXT, SEQ) 
  VALUES 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'additionalDataPrivate', '${head.request.data.original1.body.additionalDataPrivate}', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'cardAcceptorIdentificationCode', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'messageType', '400', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'originalDataElements', '${head.request.data.original1.request.data.body.messageType."!value".trim()}${head.request.data.original1.request.data.body.retrievalReferenceNumber."!value".trim().padRight(12," ")}${head.request.data.original1.request.data.body.dateLocalTransaction."!value".trim()}${head.request.data.original1.request.data.body.timeLocalTransaction."!value".trim()}${head.request.data.original1.request.data.body.systemsTraceAuditNumber."!value".trim()}${"          "}', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'processingCode', '940000', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'reasonCode', '${null}', NULL), 
    ('req-core.itm.0200.230000.002NMB.res-reverse', 1, 'serviceIndicator', '${null}', NULL);

INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('res-core.itm.0200.230000.002NMB', '[itmit]', CURRENT USER, CURRENT TIMESTAMP);
INSERT INTO MWCONFIG.MAPPING_GROUP (MAPPING_ID, ID, SOURCE, TARGET, INCLUDE_MAPPING_ID, INCLUDE_ID) VALUES ('res-core.itm.0200.230000.002NMB', 1, '/data/body', '/data/body', 'res-core.itm.0200', 1);
INSERT INTO MWCONFIG.MAPPING_GROUP_LINE (MAPPING_ID, MAPPING_GROUP_ID, NAME, TEXT, SEQ) 
  VALUES 
    ('res-core.itm.0200.230000.002NMB', 1, 'additionalDataPrivate', '${msg.SNAME_F1."!value".substring(0,20)}${head.request.data.original1.body.additionalDataPrivate}${head.request.data.original1.body.reservedPrivate3}', NULL), 
    ('res-core.itm.0200.230000.002NMB', 1, 'amountTransaction', '${head.request.data.original1.body.amountTransaction."!value".padLeft(12,"0")}', NULL), 
    ('res-core.itm.0200.230000.002NMB', 1, 'amountTransactionFee', '${decimalFormat("0",(head.request.data.body.TLBF04."!value".toBigDecimal()+head.request.data.body.TLBF10."!value".toBigDecimal()))}', NULL), 
    ('res-core.itm.0200.230000.002NMB', 1, 'fromAccount', '${head.request.data.original1.body.fromAccount."!value".padLeft(16,"0")}', NULL);

INSERT INTO MWCONFIG.DTREE (GROUP, PATH, VALUE, MODIFIED_BY, TIMESTAMP, MODULE) 
   VALUES 
      ('CHARGES', 'itm|940000', 'cardless-btn', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'itm|941000', 'cardless-btn', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'itm|942000', 'cardless-btn', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'itm|950000', 'cardless-cash-deposit', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'itm|951000', 'cardless-cash-deposit', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'itm|952000', 'cardless-cash-deposit', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'cardless-btn', '---', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
      ('CHARGES', 'cardless-cash-deposit', '---', CURRENT USER, CURRENT TIMESTAMP, '[itm]');


INSERT INTO MWCONFIG.CHARGES (ID, C1_VALUE, C1_NAME, C1_SCRIPT, C1_ACCOUNT, C2_VALUE, C2_NAME, C2_SCRIPT, C2_ACCOUNT, C3_VALUE, C3_NAME, C3_SCRIPT, C3_ACCOUNT, C4_VALUE, C4_NAME, C4_SCRIPT, C4_ACCOUNT, C5_VALUE, C5_NAME, C5_SCRIPT, C5_ACCOUNT, MODIFIED_BY, TIMESTAMP, C6_VALUE, C6_NAME, C6_SCRIPT, C6_ACCOUNT) 
    VALUES 
      ('cardless-btn', 0.00, 'Pendapatan BTN', null, '467811491418', 0.00, 'Biaya Admin', null, '467811491418', 0.00, null, null, null, 0.00, null, null, null, 0.00, null, null, null, CURRENT USER, CURRENT TIMESTAMP, null, null, null, null),
      ('cardless-cash-deposit', 0.00, 'Pendapatan BTN', null, '467811491418', 0.00, 'Biaya Admin', null, '467811491418', 0.00, null, null, null, 0.00, null, null, null, 0.00, null, null, null, CURRENT USER, CURRENT TIMESTAMP, null, null, null, null);

INSERT INTO MWCONFIG.PARAM_MAP (GROUP, NAME, VALUE, SEQ, MODIFIED_BY, TIMESTAMP, DESCRIPTION) 
  VALUES 
    ('coa', 'gl-withdrawal-acquire-BTN', '111330000000', null, CURRENT USER, CURRENT TIMESTAMP, 'GL Cash ATM BTN'), 
    ('coa', 'gl-withdrawal-acquire-VND', '111340000061', null, CURRENT USER, CURRENT TIMESTAMP, 'GL Cash ATM Vendor'), 
    ('coa', 'gl-withdrawal-acquire-BCR', '111360000000', null, CURRENT USER, CURRENT TIMESTAMP, null);
