Commit 2e293e53 authored by Volker Krause's avatar Volker Krause
Browse files

Remove the UIC/VDV organization identifier hacks

Those are no longer needed now that we can properly access properties of
the underlying type in extractor filtering directly.
parent 50e64104
Pipeline #62167 passed with stages
in 12 minutes and 39 seconds
......@@ -40,13 +40,6 @@
"result": [
{
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
"provider": {
"@type": "Organization",
"identifier": "uic:0080"
}
},
"reservationNumber": "9E8DXL",
"reservedTicket": {
"@type": "Ticket",
......@@ -73,13 +66,6 @@
"data": [
{
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
"provider": {
"@type": "Organization",
"identifier": "uic:0080"
}
},
"reservationNumber": "9E8DXL",
"reservedTicket": {
"@type": "Ticket",
......
......@@ -53,12 +53,8 @@ void Uic9183DocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_u
{
const auto p = node.content<Uic9183Parser>();
QJsonObject org;
org.insert(QStringLiteral("@type"), QLatin1String("Organization"));
org.insert(QStringLiteral("identifier"), QString(QLatin1String("uic:") + p.carrierId()));
QJsonObject trip;
trip.insert(QStringLiteral("@type"), QLatin1String("TrainTrip"));
trip.insert(QStringLiteral("provider"), org);
QJsonObject seat;
seat.insert(QStringLiteral("@type"), QLatin1String("Seat"));
seat.insert(QStringLiteral("seatingType"), p.seatingType());
......@@ -124,7 +120,9 @@ void Uic9183DocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_u
QJsonObject res;
res.insert(QStringLiteral("@type"), QLatin1String("TrainReservation"));
res.insert(QStringLiteral("reservationFor"), trip);
if (trip.size() > 1) {
res.insert(QStringLiteral("reservationFor"), trip);
}
res.insert(QStringLiteral("reservationNumber"), p.pnr());
res.insert(QStringLiteral("reservedTicket"), ticket);
res.insert(QStringLiteral("underName"), JsonLdDocument::toJson(p.person()));
......
......@@ -40,12 +40,8 @@ void VdvDocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_unuse
{
const auto vdv = node.content<VdvTicket>();
QJsonObject org;
org.insert(QStringLiteral("@type"), QLatin1String("Organization"));
org.insert(QStringLiteral("identifier"), QString(QLatin1String("vdv:") + QString::number(vdv.issuerId())));
QJsonObject trip;
trip.insert(QStringLiteral("@type"), QLatin1String("TrainTrip"));
trip.insert(QStringLiteral("provider"), org);
trip.insert(QStringLiteral("departureDay"), vdv.beginDateTime().date().toString(Qt::ISODate));
QJsonObject seat;
seat.insert(QStringLiteral("@type"), QLatin1String("Seat"));
......
Markdown is supported
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