pauls-heaven / test-project

0 stars 0 forks source link

input #1

Open pauls-heaven opened 6 years ago

pauls-heaven commented 6 years ago

[ { "profileId": 10, "profileName": "Senth-Test-Profile", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000010", "profileType": "DIGITAL", "connections": [ { "connectionId": 5, "connectionName": "string", "connectionStatus": "DRAFT" }, { "connectionId": 6, "connectionName": "string", "connectionStatus": "DRAFT" }, { "connectionId": 15, "connectionName": "Test Connection-=1", "connectionStatus": "DRAFT" }, { "connectionId": 36, "connectionName": "JOG-R3-CONNECTION-005", "connectionStatus": "DRAFT" } ], "countries": [ { "countryCode": "IN", "countryDescription": "India", "status": "ACTIVE", "transactions": [ { "id": 1, "countryCode": "IN", "countryDescription": "India", "transactionType": "Domestic HV / Urgent Payments", "transactionTypeDescription": null, "fileFormatId": 1, "fileFormat": "XML Payment Initiation - V3", "universal": true, "status": null }], "accounts": [] }, { "countryCode": "US", "countryDescription": "United States", "status": "DRAFT", "transactions": [], "accounts": [ { "accountId": 119, "accountName": "ACCT23549", "accountNumber": "00023549", "accountCountryCode": "UK", "accountInstitutionCode": "HBEU", "groupAccount": "Y", "accountCurrencyCode": "GBP", "alternateFormattedAccountNumber": "002023549 ", "cdNationalClearingCode": null, "status": null }] }, { "countryCode": "UK", "countryDescription": "United Kingdom", "status": "DRAFT", "transactions": [], "accounts": [] } ], "preferences": [] }, { "profileId": 15, "profileName": "Senth-Test-Profile 6", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000015", "profileType": "DIGITAL", "connections": [], "countries": [ { "countryCode": "IN", "countryDescription": "India", "status": null, "transactions": [], "accounts": [] }], "preferences": [] }, { "profileId": 100, "profileName": "CREAM 1", "profileStatus": "DRAFT", "shortId": "H23CD", "abcId": null, "picId": "PC000000100", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 200, "profileName": "CREAM 2", "profileStatus": "DRAFT", "shortId": "H23CD", "abcId": null, "picId": "PC000000200", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 300, "profileName": "Test Profile 300", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000300", "profileType": "DIGITAL", "connections": [ { "connectionId": 22, "connectionName": "JOG-R3-CONNECTION-005", "connectionStatus": "DRAFT" }, { "connectionId": 26, "connectionName": "JOG-R3-CONNECTION-009", "connectionStatus": "SFG_ONBOARDED" }, { "connectionId": 21, "connectionName": "JOG-R3-CONNECTION-004", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 23, "connectionName": "JOG-R3-CONNECTION-006", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 25, "connectionName": "JOG-R3-CONNECTION-008", "connectionStatus": "SFG_ONBOARDED" }, { "connectionId": 20, "connectionName": "JOG-R3-CONNECTION-00x", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 24, "connectionName": "JOG-R3-CONNECTION-007", "connectionStatus": "SFG_ONBOARDED" }, { "connectionId": 27, "connectionName": "JOG-R3-CONNECTION-010", "connectionStatus": "SFG_ONBOARDED" }, { "connectionId": 30, "connectionName": "Test Conn-1", "connectionStatus": "APPROVED" }, { "connectionId": 18, "connectionName": "JOG-R3-CONNECTION-002", "connectionStatus": "SFG_ONBOARDED" }, { "connectionId": 17, "connectionName": "JOG-R3-CONNECTION-001", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 28, "connectionName": "JOG-R3-CONNECTION-012", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 29, "connectionName": "JOG-R3-CONNECTION-012", "connectionStatus": "ONBOARDING_IN_PROGRESS" } ], "countries": [], "preferences": [ { "id": 4, "approvalStatus": "DRAFT", "preferenceType": "REPORTING" }] }, { "profileId": 12, "profileName": "Senth-Test-Profile2", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000012", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 13, "profileName": "Senth-Test-Profile3", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000013", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 44, "profileName": "JOG-Test-001", "profileStatus": "DRAFT", "shortId": null, "abcId": null, "picId": "PC000000044", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 45, "profileName": "JOG-Test-002", "profileStatus": "DRAFT", "shortId": null, "abcId": null, "picId": "PC000000045", "profileType": "HERITAGE", "connections": [], "countries": [], "preferences": [] }, { "profileId": 4, "profileName": "Test Profile 400", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000004", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 9, "profileName": "Test Profile 9", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000009", "profileType": "DIGITAL", "connections": [ { "connectionId": 7, "connectionName": "Abdul Text 1", "connectionStatus": "ONBOARDING_IN_PROGRESS" }, { "connectionId": 8, "connectionName": "Paul Text", "connectionStatus": "PENDING_APPROVAL" }, { "connectionId": 9, "connectionName": "Senth Text", "connectionStatus": "DRAFT" }, { "connectionId": 19, "connectionName": "JOG-R3-CONNECTION-002", "connectionStatus": "DRAFT" } ], "countries": [], "preferences": [] }, { "profileId": 11, "profileName": "Senth-Test-Profile1", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000011", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] }, { "profileId": 14, "profileName": "Senth-Test-Profile 5", "profileStatus": "DRAFT", "shortId": "PR300", "abcId": "ABC123 ", "picId": "PC000000014", "profileType": "DIGITAL", "connections": [], "countries": [], "preferences": [] } ]

pauls-heaven commented 6 years ago

[ { "profileId": 11, "profileName": "Mock profile 11", "connections": [11, 12], "footprint": { "countries": [ ["IN", "India"], ["PL", "Poland"], ["GB", "United Kingdom"] ], "footprintStatus": "SAVED" }, "accounts": { "selected": [ ["IN", [11, 12]], ["GB", [12, 13, 14]] ], "accountsStatus": "DEFAULT" }, "transactions": { "types": { "PL": [11], "GB": [], "universal": [12, 13] }, "fileFormats": { "universal": ["XMLv3", "XMLv2"], "PL": ["PLD"] }, "transactionsStatus": "DRAFT" }, "reports": { "reportsStatus": "DEFAULT" }, "preferences": { "preferencesStatus": "DEFAULT", "reportRouting": 11 }, "profileStatus": "DRAFT", "shortId": "PR011", "abcId": "ABC011", "picId": "PC000000011" } ]

pauls-heaven commented 6 years ago

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">

<flow name="paulFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <dw:transform-message doc:name="Transform Message" metadata:id="3b0834fc-4eb5-4850-9979-fe72a7ca873d">
        <dw:input-payload />
        <dw:set-payload><![CDATA[%dw 1.0

%output application/json


payload map ((payload01 , indexOfPayload01) -> {

profileId: payload01.profileId,

profileName: payload01.profileName,

connections: payload01.connections.connectionId,

footprint: {

    countries: payload01.countries map ((country , indexOfCountry) -> 

        [

            country.countryCode,

            country.countryDescription

        ]

    ),

    footprintStatus: payload01.countries[0].status

},

accounts: {

    selected: payload01.countries map ((country,index) -> [

        country.countryCode,

        country.accounts.*accountId

    ]),

    accountsStatus: payload01.countries[0].status

},

profileStatus: payload01.profileStatus,

shortId: payload01.shortId,

abcId: payload01.abcId,

picId: payload01.picId,

transactions: {

     types: lookup("transactions",{"type":"transactions","data":payload01.countries.*transactions}) when payload01.countries.transactions != null otherwise {},

     fileFormats :lookup("transactions",{"type":"fileFormats","data":payload01.countries.*transactions}) when payload01.countries.transactions != null otherwise {},

     transactionsStatus : payload01.countries.transactions[0].status[0]

},

"reports": {

    "reportsStatus": ""

},

"preferences": {

    "preferencesStatus": payload01.preferences[0].approvalStatus,

    "reportRouting": payload01.preferences[0].id

}

})]]></dw:set-payload> </dw:transform-message>