Commit 06ed6845 authored by Volker Krause's avatar Volker Krause
Browse files

Also extract VDV organization ids as provider identifier

Similar to the UIC company code we'll be able to use this to select
matching KPublicTransport backends for a given train ticket.
parent 4e1f6e59
......@@ -235,6 +235,8 @@ function parsePdf(pdf, node, triggerNode) {
break;
}
}
} else if (triggerNode.mimeType == "internal/vdv") {
reservations[i].reservationFor.provider.identifier = "vdv:" + triggerNode.content.operatorId;
}
if (triggerNode.result.length > 0) {
reservations[i].reservedTicket.name = triggerNode.result[0].reservedTicket.name;
......
......@@ -112,6 +112,12 @@ int VdvTicket::issuerId() const
return hdr ? hdr->kvpOrgId : 0;
}
int VdvTicket::operatorId() const
{
const auto hdr = header();
return hdr ? hdr->pvOrgId : 0;
}
VdvTicket::ServiceClass VdvTicket::serviceClass() const
{
const auto tlv = d->productData<VdvTicketBasicData>();
......
......@@ -36,6 +36,8 @@ class KITINERARY_EXPORT VdvTicket
/** VDV organization identifier of the ticket issuer. */
Q_PROPERTY(int issuerId READ issuerId)
/** VDV organization identifier of the operator. */
Q_PROPERTY(int operatorId READ operatorId)
/** Service class for this ticket. */
Q_PROPERTY(ServiceClass serviceClass READ serviceClass)
/** The person this ticket is valid for. */
......@@ -55,6 +57,7 @@ public:
QDateTime beginDateTime() const;
QDateTime endDateTime() const;
int issuerId() const;
int operatorId() const;
enum ServiceClass {
UnknownClass = 0,
......
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