Commit 6597c1bd authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Extract proper real name from Lufthansa and EuroWings pkpass

parent 880a0190
Pipeline #87045 passed with stage
in 13 minutes and 59 seconds
...@@ -12,5 +12,12 @@ function main(pass, node) ...@@ -12,5 +12,12 @@ function main(pass, node)
if (pass.field["operatingcarrier"]) if (pass.field["operatingcarrier"])
res.reservationFor.airline.name = pass.field["operatingcarrier"].value; res.reservationFor.airline.name = pass.field["operatingcarrier"].value;
const secondary = pass.secondaryFields;
const nameField = secondary.find(item => item.key === "name");
if (nameField) {
res.underName = JsonLd.newObject("Person");
res.underName.name = nameField.value;
}
return res; return res;
} }
...@@ -14,5 +14,12 @@ function main(pass, node) ...@@ -14,5 +14,12 @@ function main(pass, node)
res.reservationFor.departureAirport.name = pass.field["origin"].label; res.reservationFor.departureAirport.name = pass.field["origin"].label;
res.reservationFor.arrivalAirport.name = pass.field["destination"].label; res.reservationFor.arrivalAirport.name = pass.field["destination"].label;
const secondary = pass.secondaryFields;
const passengerName = secondary.find(item => item.key === "passenger");
if (passengerName) {
res.underName = JsonLd.newObject("Person");
res.underName.name = passengerName.value;
}
return res; return res;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment