,
flightsWithDetails as Array) =
ai -- mask
fun joinAirportDetails (p) =
p map (f) -> (f - "destination") ++
destination: reduceAirportInfo(airports.LAX[0],fieldMask)
++ "IATA": f.destination
fun getAirportDetails (f:Object) =
destination: reduceAirportInfo(airports.LAX[0],fieldMask)
fun joinAirportDetailsV2 (p) =
p map (f) ->
f mapObject (v,k) ->
k match {
case "destination" -> getAirportDetails(f)
case "price" -> price: f.price as USCurrency
else -> (k): v
}
---
joinAirportDetailsV2(payload)
]]>