INSERT INTO MWCONFIG.DTREE(GROUP, PATH, VALUE, MODIFIED_BY, TIMESTAMP, MODULE) 
    VALUES 
        ('ITM-CODE', '0200.881000', '0200.881000.${msg.reservedPrivate2.substring(0, 9)}', CURRENT USER, CURRENT TIMESTAMP, '[itm]'),
        ('ITM-CODE', '0210.881000', '0210.881000.${msg.reservedPrivate2.substring(0, 9)}', CURRENT USER, CURRENT TIMESTAMP, '[itm]');

INSERT INTO MWCONFIG.PARAM_MAP(GROUP, NAME, "VALUE", SEQ, MODIFIED_BY, TIMESTAMP, DESCRIPTION) 
VALUES 
    ('itm-api-core', 'inqRegisMBSyariah', 'http://DUMMY:7080/mid/inqregnmb', null, CURRENT USER, CURRENT TIMESTAMP, null),
    ('coa', 'prima-liability', '211976400000', null, CURRENT USER, CURRENT TIMESTAMP, 'gl kewajiban');

INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('req-core.itm.0200.881000.002001000', '[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.881000.002001000', 1, '/data/body', '/data/body', 'dsp', '1');
INSERT INTO MWCONFIG.MAPPING_GROUP_LINE (MAPPING_ID, MAPPING_GROUP_ID, NAME, TEXT, SEQ) 
    VALUES 
        ('req-core.itm.0200.881000.002001000', 1, '@', 'copyMessageToChild("original");', 5),
        ('req-core.itm.0200.881000.002001000', 1, '!ReplyToQ', 'ITM_CORE_REPLY', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!ReplyToQMgr', 'PAYBROKER.QM', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!RequestURL', '${getParamValue("itm-api-core","inqRegisMBSyariah","http://localhost:8094")}', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!destination', 'api-bis-conn', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!dir', 'O', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!key', 'fcd5b3601f3bc0b9e6f80f21ebb76eb8', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!mappingCode', '${head.code}', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!errorCodePath', 'msg.rsp', 10),
        ('req-core.itm.0200.881000.002001000', 1, '!queueName', 'BACKEND_REST_IN', 10),
        ('req-core.itm.0200.881000.002001000', 1, 'account', '${msg.fromAccount."!value".replaceFirst(/^0+/, "")}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'card', '${msg.primaryAccountNumber."!value".trim()}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'dob', '${msg.additionalDataPrivate."!value".substring(23,29).trim()}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'hp', '${msg.additionalDataPrivate."!value".substring(0,16).trim()}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'ref', '${msg.retrievalReferenceNumber."!value".padRight(12," ").trim()}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'user', '${msg.cardAcceptorTerminalIdentification."!value".trim()}', 20),
        ('req-core.itm.0200.881000.002001000', 1, 'isMultipleRequest', 'true', 30),
        ('req-core.itm.0200.881000.002001000', 1, 'mappingCodeMultiple', 'istconn', 30);
    
INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('req-core.itm.0200.881000.002001000.istconn', '[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.881000.002001000.istconn', 1, '/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.881000.002001000.istconn', 1, '@', 'copyMessage(".", "request/data/body/original");copyMessage("../respapi", ".");copyMessage("original", "request/data/body/original");', 10),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!CorrelId', '${head.request.data.CorrelId}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!ReplyToQ', 'ITM_CORE_REPLY', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!ReplyToQMgr', 'ISOBROKER.QM', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!code', '${head.request.data.code}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!connid', '${head.request.data.connid}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!destination', 'ist-conn', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!dir', 'O', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!group', '${head.request.data.group}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!mappingCode', '${head.request.data.mappingCode}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!mid', '${head.request.data.mid}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!queueName', 'BACKEND_ISO_IN', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!reqtimestamp', '${head.request.data.reqtimestamp}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!sid', '${null}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!source', '${head.request.data.source}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!timestamp', '${head.request.data.reqtimestamp}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, '!type', 'iso-8583-cws', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, 'additionalDataPrivate', '${msg.hp?."!value"!=null?msg.hp."!value".padLeft(16," "):" ".padLeft(16," ")}${msg.cif?."!value"!=null?msg.cif."!value".padRight(7," "):" ".padRight(7," ")}${msg.dob?."!value"!=null?msg.dob."!value".padRight(6," "):" ".padRight(6," ")}${" ".padRight(20," ")}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, 'fromAccount', 'NULL', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, 'isMultipleRequest', 'NULL', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, 'processingCode', '${head.request.data.body.original.processingCode."!value".trim()=="881000"?"022000":"021000"}', null),
        ('req-core.itm.0200.881000.002001000.istconn', 1, 'reservedPrivate3', 'NULL', null);

INSERT INTO MWCONFIG.MAPPING (ID, MODULE, MODIFIED_BY, TIMESTAMP) VALUES ('res-core.itm.0200.881000.002001000', '[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.881000.002001000', 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.881000.002001000', 1, 'additionalDataPrivate', '${msg.additionalDataPrivate."!value"}', 20);

INSERT INTO MWCONFIG.ERROR_MAP (GROUP, ORIGINAL, TARGET, DETAIL, MODIFIED_BY, TIMESTAMP)
VALUES 
    ('api-bis-conn', '000', '00', 'Transaction Success', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '001', '01', 'Account Not Found', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '097', '70', 'Duplicate Reff', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '098', 'RA', 'Is Switch A Day Mode Or Night Mode', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '099', 'H1', 'Not Authorize', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '701', '26', 'Invalid Institution Code', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '702', 'RB', 'Invalid Length Bin', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '703', 'RC', 'BIN Must Be Fill', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '704', 'RD', 'Payment Code Descriptioapi-bis-connn Must Be Filled', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '705', 'RE', 'Payment Code Must Be Filled', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '706', 'RF', 'Length Virtual Account Invalid', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '707', 'RG', 'Length Customer Id Invalid', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '721', 'PU', 'Prefix Belum Terdaftar', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '722', 'RH', 'Wrong Merchant Id', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '723', 'RO', 'Jenis Rekening Salah', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '724', 'RJ', 'Branch Invalid', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '801', 'RK', 'Invalid Date', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '802', 'PG', 'Data Cannot Be Empty / Wrong Format', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '901', 'HP', 'Mobile Phone Not Authorize.', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '902', 'RL', 'Card Number Not Authorize.', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '903', 'RM', 'Phone Number And Card Number Is Not', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '904', 'B2', 'Invalid Cif Number.', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '905', 'RN', 'Nik Not Found', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '906', 'RU', 'Data Already Exist', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '907', 'RP', 'Data Not Found', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '908', 'RQ', 'Email Not Valid', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '941', 'RR', 'Error Because Any Host Message', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '942', 'RS', 'Error Because Any Host Message', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '994', 'RT', 'Error Because Any Host Message', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '971', '14', 'Invalid Transaction', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '995', 'RP', 'Data Not Found (API)', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '996', '14', 'Invalid Data Request (API)', CURRENT USER, CURRENT TIMESTAMP),
    ('api-bis-conn', '999', '99', 'General Error (Timeout)', CURRENT USER, CURRENT TIMESTAMP);