Commit 16bd5246 authored by Volker Krause's avatar Volker Krause
Browse files

Implement top-level Ticket merging

parent 237b3035
......@@ -251,6 +251,27 @@ bool MergeUtil::isSame(const QVariant& lhs, const QVariant& rhs)
return isSameTouristAttractionVisit(l, r);
}
// top-level tickets
if (JsonLd::isA<Ticket>(lhs)) {
const auto lhsTicket = lhs.value<Ticket>();
const auto rhsTicket = rhs.value<Ticket>();
// underName either matches or is not set
const auto lhsUN = lhsTicket.underName();
const auto rhsUN = rhsTicket.underName();
if (!lhsUN.name().isEmpty() && !rhsUN.name().isEmpty() && !isSamePerson(lhsUN, rhsUN)) {
return false;
}
if (conflictIfPresent(lhsTicket.ticketNumber(), rhsTicket.ticketNumber())
|| conflictIfPresent(lhsTicket.name(), rhsTicket.name())
|| conflictIfPresent(lhsTicket.validFrom(), rhsTicket.validFrom())
|| !isSameTicketToken(lhsTicket.ticketTokenData(), rhsTicket.ticketTokenData())
) {
return false;
}
}
return true;
}
......
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