Commit 99a20bc6 authored by Volker Krause's avatar Volker Krause
Browse files

Fix merging of separate train tickets and ticket-less seat reservations

parent 2ddee1c0
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifiedTime": "2020-01-14T00:00:00Z",
"reservationFor": {
"@type": "TrainTrip",
"arrivalPlatform": "4 A-C",
"arrivalStation": {
"@type": "TrainStation",
"name": "Köln Hbf"
},
"arrivalTime": "2019-02-03T10:15:00",
"departureDay": "2019-02-03",
"departurePlatform": "3",
"departureStation": {
"@type": "TrainStation",
"name": "Bruxelles"
},
"departureTime": "2019-02-03T08:32:00",
"trainNumber": "ICE 13"
},
"reservationNumber": "XXX007",
"reservedTicket": {
"@type": "Ticket",
"ticketToken": "aztecbin:foo",
"ticketedSeat": {
"@type": "Seat",
"seatingType": "2"
}
},
"underName": {
"@type": "Person",
"familyName": "Konqui",
"givenName": "Dragon",
"name": "Konqui Dragon"
}
}
]
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifiedTime": "2020-01-14T00:00:00Z",
"reservationFor": {
"@type": "TrainTrip",
"arrivalPlatform": "4 A-C",
"arrivalStation": {
"@type": "TrainStation",
"name": "Köln Hbf"
},
"arrivalTime": "2019-02-03T10:15:00",
"departureDay": "2019-02-03",
"departurePlatform": "3",
"departureStation": {
"@type": "TrainStation",
"name": "Bruxelles"
},
"departureTime": "2019-02-03T08:32:00",
"trainNumber": "ICE 13"
},
"reservationNumber": "XXX007",
"reservedTicket": {
"@type": "Ticket",
"ticketToken": "aztecbin:foo",
"ticketedSeat": {
"@type": "Seat",
"seatNumber": "42",
"seatSection": "23",
"seatingType": "2"
}
},
"underName": {
"@type": "Person",
"familyName": "Konqui",
"givenName": "Dragon",
"name": "Konqui Dragon"
}
}
]
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifiedTime": "2020-01-14T00:00:00Z",
"reservationFor": {
"@type": "TrainTrip",
"arrivalPlatform": "4 A-C",
"arrivalStation": {
"@type": "TrainStation",
"name": "Köln Hbf"
},
"arrivalTime": "2019-02-03T10:15:00",
"departureDay": "2019-02-03",
"departurePlatform": "3",
"departureStation": {
"@type": "TrainStation",
"name": "Bruxelles"
},
"departureTime": "2019-02-03T08:32:00",
"trainNumber": "ICE 13"
},
"reservedTicket": {
"@type": "Ticket",
"ticketedSeat": {
"@type": "Seat",
"seatNumber": "42",
"seatSection": "23",
"seatingType": "2"
}
}
}
]
......@@ -126,7 +126,7 @@ bool MergeUtil::isSame(const QVariant& lhs, const QVariant& rhs)
if (JsonLd::isA<TrainReservation>(lhs)) {
const auto lhsRes = lhs.value<TrainReservation>();
const auto rhsRes = rhs.value<TrainReservation>();
if (lhsRes.reservationNumber() != rhsRes.reservationNumber()) {
if (conflictIfPresent(lhsRes.reservationNumber(), rhsRes.reservationNumber())) {
return false;
}
return isSame(lhsRes.reservationFor(), rhsRes.reservationFor());
......
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