I am a little confused in how to proceed with this scenario using ramda. Here is the JSON that I am working with.
{
"type" : "CartWsDTO",
"Cartentries" : [ {
"entryNumber" : 1,
"flightGroup" : {
"PAXDetails" : [ {
"paxID" : "1",
"paxPrice" : "770.82",
"paxType" : "ADT"
}, {
"paxID" : "2",
"paxPrice" : "770.82",
"paxType" : "ADT"
} ]
}
}, {
"entryNumber" : 2,
"flightGroup" : {
"PAXDetails" : [ {
"paxID" : "1",
"paxName" : "Vinitha",
"paxPrice" : "770.82",
"paxSurname" : "Vinitha",
"paxType" : "ADT"
}, {
"paxID" : "2",
"paxName" : "Prahal",
"paxPrice" : "770.82",
"paxSurname" : "Prahal",
"paxType" : "ADT"
} ]
}
} ]
}
There are 2 CartEnteries in the above JSON. There is an array named paxDetails in flightGroup of each entry. From this paxDetails array I want to pick the paxPrice and make a sum of all the pax prices for that cart entry. In traditional for loop and if conditions I am able to achieve it. But using Ramda I couldn't understand how to start with. Kindly provide me a solution.
Thanks in advance.