Commit 1dd7fb76 authored by Volker Krause's avatar Volker Krause
Browse files

Extract SNCF ticket numbers

Those are relevant for login to Renfe onboard WiFi.
parent e7f5c742
Pipeline #242231 failed with stage
in 10 minutes and 50 seconds
......@@ -44,6 +44,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketNumber": "123456789",
"ticketToken": "aztecCode:i0CVXXX007123456789121101/01/1970FRXYTFRMPL0432131/070123456789012345678 DOE JOHN2CF000 00000\n",
"ticketedSeat": {
"@type": "Seat",
......
......@@ -40,6 +40,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketNumber": "123456789",
"ticketToken": "aztecCode:i0CVXXX007123456789121101/01/1970CHGVAFRAVG5432101/110123456789012345678 DOE JOHN2 1FRAVGFRXYT04321\n",
"ticketedSeat": {
"@type": "Seat",
......@@ -94,6 +95,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketNumber": "123456789",
"ticketToken": "aztecCode:i0CVXXX007123456789121101/01/1970CHGVAFRAVG5432101/110123456789012345678 DOE JOHN2 1FRAVGFRXYT04321\n",
"ticketedSeat": {
"@type": "Seat",
......
......@@ -131,6 +131,7 @@ function parseSncfBarcode(barcode)
res1.reservationFor.departureDay = JsonLd.toDateTime(barcode.substr(48, 5), "dd/MM", "fr");
res1.reservationFor.trainNumber = barcode.substr(43, 5);
res1.reservedTicket.ticketToken = "aztecCode:" + barcode;
res1.reservedTicket.ticketNumber = barcode.substr(10, 9);
res1.reservedTicket.ticketedSeat.seatingType = barcode.substr(110, 1);
res1.programMembershipUsed.programName = tariffs[barcode.substr(111, 4)];
reservations.push(res1);
......@@ -177,13 +178,7 @@ function parsePdf(pdf) {
if (legs.length > 0) {
for (var j = 0; j < legs.length; ++j) {
if (barcode && j < barcodeRes.length) {
legs[j].underName = barcodeRes[j].underName;
legs[j].reservedTicket.ticketToken = "aztecCode:" + barcode;
legs[j].reservationFor.departureStation.identifier = barcodeRes[j].reservationFor.departureStation.identifier;
legs[j].reservationFor.arrivalStation.identifier = barcodeRes[j].reservationFor.arrivalStation.identifier;
legs[j].reservedTicket.ticketedSeat.seatingType = barcodeRes[j].reservedTicket.ticketedSeat.seatingType;
legs[j].reservationNumber = barcodeRes[j].reservationNumber;
legs[j].programMembershipUsed = barcodeRes[j].programMembershipUsed;
legs[j] = JsonLd.apply(barcodeRes[j], legs[j]);
}
reservations.push(legs[j]);
}
......@@ -267,6 +262,7 @@ function parseSecutixPdf(pdf, node, triggerNode)
res.reservationFor.arrivalStation.identifier = "sncf:" + code.substr(22, 5);
res.reservationFor.departureDay = JsonLd.toDateTime(code.substr(83, 8), "ddMMyyyy", "fr");
res.reservedTicket.ticketedSeat.seatingType = code.substr(91, 1);
res.reservedTicket.ticketNumber = code.substr(8, 9);
res.reservedTicket.ticketToken = "aztecbin:" + ByteArray.toBase64(triggerNode.content);
res.underName.familyName = code.substr(116, 19);
res.underName.givenName = code.substr(135, 19);
......
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