Commit e9b875dd authored by Volker Krause's avatar Volker Krause
Browse files

Set Reservation::modifiedTime to the document context time if empty

This will allow us to properly sort two documents for the same reservation
in the right order for merging if we cannot otherwise determine which one
is newer/better.
parent bccb8796
......@@ -2,6 +2,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-12-29T18:46:02+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -55,6 +56,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-12-29T18:46:02+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -108,6 +110,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-12-29T18:46:02+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -161,6 +164,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-12-29T18:46:02+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......
......@@ -2,6 +2,7 @@
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifiedTime": "2018-01-01T00:00:00",
"reservationFor": {
"@type": "TrainTrip",
"arrivalStation": {
......
......@@ -2,6 +2,7 @@
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifiedTime": "2017-12-29T18:46:02+01:00",
"reservationFor": {
"@type": "TrainTrip",
"arrivalStation": {
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "13C",
"modifiedTime": "2019-08-19T19:23:28+01:00",
"passengerSequenceNumber": "42",
"reservationFor": {
"@type": "Flight",
......
......@@ -2,6 +2,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -57,6 +58,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -112,6 +114,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......
......@@ -2,6 +2,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -57,6 +58,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -112,6 +114,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -168,6 +171,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -224,6 +228,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......@@ -279,6 +284,7 @@
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"modifiedTime": "2017-01-01T12:34:56+01:00",
"reservationFor": {
"@type": "Flight",
"airline": {
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "14E",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "63",
"reservationFor": {
"@type": "Flight",
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "19F",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "60",
"reservationFor": {
"@type": "Flight",
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "17C",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "40",
"reservationFor": {
"@type": "Flight",
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "1A",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "1",
"reservationFor": {
"@type": "Flight",
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "5A",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "17",
"reservationFor": {
"@type": "Flight",
......
......@@ -3,6 +3,7 @@
"@context": "http://schema.org",
"@type": "FlightReservation",
"airplaneSeat": "10E",
"modifiedTime": "2017-12-29T18:46:02",
"passengerSequenceNumber": "143",
"pkpassPassTypeIdentifier": "pass.booking.swiss.com",
"pkpassSerialNumber": "123456789",
......
......@@ -475,6 +475,15 @@ void ExtractorEnginePrivate::extractDocument()
}
}
}
// set modification time for all results that don't have it yet
for (int i = 0; i < m_result.size(); ++i) {
auto res = m_result.at(i).toObject();
if (!res.contains(QLatin1String("modifiedTime"))) {
res.insert(QStringLiteral("modifiedTime"), m_context->m_senderDate.toString(Qt::ISODate));
}
m_result[i] = res;
}
}
void ExtractorEnginePrivate::extractGeneric()
......
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