Input
{
"name": "Karan",
"age": 25,
"contact": {
"email": "[email protected]"
},
"details": [
{
"contact": {
"firstName": "karan",
"lastName": "singh"
},
"phone": "5555555555",
"email": "[email protected]",
"address": {
"line1": "123",
"city": "bangalore",
"state": "karnataka",
"country": "india",
"zip": "570089"
}
}
],
"shippingTo": {
"contact": {
"name": {
"firstName": "5505",
"lastName": "5505"
},
"phone": null,
"email": null
},
"address": {
"line1": "2100 88th St",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"zip": "07047"
}
},
"fulfillmentLines": [
{
"chargeDetails": [
{
"chargeCategory": "PRODUCT",
"chargeName": "ItemPrice",
"chargePerUnit": {
"currencyAmount": 34.96,
"currencyUnit": "USD"
},
"isDiscount": false,
"taxDetails": {
"taxPerUnit": {
"currencyAmount": 2.4,
"currencyUnit": "USD"
},
"taxPerLine": {
"currencyAmount": 2.4,
"currencyUnit": "USD"
}
}
}
],
"lineDates": {
"minDeliveryDate": "2019-01-10T00:30:12+00:00",
"maxDeliveryDate": "2019-02-10T00:30:12+00:00",
"orderProcessingDate": "2019-03-10T00:30:12+00:00",
"preciseDeliveryDate": "2019-04-17T01:30:12+00:00"
}
}
]
}
Output:
{
"contact": {
"name": "Karan",
"age": 25,
"isTestMode": false //How to set it to true if the input Json contact.email contains "abc"
},
"contactDetails": [ //Shud pick from "details" input json
{
"personalInfo": {
"address": {
"line1": 123,
"city": "bangalore",
"state": "karnataka",
"country": "india",
"zip": "570089",
"isLoadingAvailable": false //How to Set it to default value false in each contactDetails list
},
"contact": {
"firstName": "karan",
"lastName": "singh",
"completeName": "karan singh"
},
"phone": "5555555555",
"email": "[email protected]"
}
}
],
"orderLines": [
{
"shipToAddress": { // How to pick from the same "shippingTo" input json for each orderLines list
"address": {
"addressLineOne": "2100 88th St",
"city": "Mumbai",
"countryCode": "India",
"postalCode": "07047",
"stateOrProvinceCode": "Maharashtra"
},
"name": {
"firstName": "5505",
"lastName": "5505"
},
"phone": {
"completeNumber": null
},
"email": {
"emailAddress": null
}
},
"charges": [ //Shud pick from "fulfillmentLines.chargeDetails" input json
{
"chargeCategory": "PRODUCT",
"chargeName": "ItemPrice",
"chargePerUnit": {
"currencyAmount": 0,
"currencyUnit": "USD"
},
"isDiscount": false,
"tax": [ //How to convert it to array as its an object(fulfillmentLines.0.chargeDetails.0.taxDetails) in input json
{
"taxName": "Tax1", //How to Set it to default value "Tax1" in each "tax" list
"taxPerLine": {
"currencyAmount": 2.15,
"currencyUnit": "USD"
},
"taxPerUnit": {
"currencyAmount": 2.15,
"currencyUnit": "USD"
}
}
]
}
],
"orderedLineDates": [ //Shud pick from "fulfillmentLines.lineDates" input json
{
"dateTypeId": "DELIVERY",
"minExpectedDate":"2019-01-10T00:30:12+00:00",//Shud pick from minDeliveryDate
"maxExpectedDate": "2019-02-10T00:30:12+00:00",//Shud pick from maxDeliveryDate
"expectedDate": "2019-04-17T01:30:12+00:00"//Shud pick from preciseDeliveryDate
},
{
"dateTypeId": "OPD",
"requestedDate": "2019-03-10T00:30:12+00:00",//Shud pick from orderProcessingDate
"expectedDate": "2019-03-10T00:30:12+00:00"//Shud pick from orderProcessingDate
}
]
}
]
}
Need jolt spec for same. Also please suggest any good tutorial is available for same. Need info on below. 1.Add default values in list 2.Set the field values based on conditions of other fields 3.Can String append function will work in JOLT? 4.Convert the object to an array
Can you please suggest the JOLT spec for same?