KItinerary

fcbticket.h
1/*
2 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KITINERARY_FCBTICKET_H
7#define KITINERARY_FCBTICKET_H
8
9#include <KItinerary/Uic9183Block>
10
11#include "asn1/uperelement.h"
12
13#include <QDateTime>
14#include <QList>
15#include <QVariant>
16
17#include <bitset>
18
19namespace KItinerary {
20
21class UPERDecoder;
22
23/** ERA Flexible Content Barcode (FCB)
24 * @see ERA TAP TSI TD B.12 ยง11 and the corresponding ASN.1 definition
25 */
26namespace Fcb {
27
28Q_NAMESPACE
29
30/** Generic extension data. */
32 UPER_GADGET
33 UPER_ELEMENT(QByteArray, extensionId)
34 UPER_ELEMENT(QByteArray, extensionData)
35 UPER_GADGET_FINALIZE
36};
37
38enum GeoUnitType {
39 microDegree = 0,
40 tenthmilliDegree = 1,
41 milliDegree = 2,
42 centiDegree = 3,
43 deciDegree = 4,
44};
45UPER_ENUM(GeoUnitType)
46
47enum GeoCoordinateSystemType {
48 wgs84 = 0,
49 grs80 = 1,
50};
51UPER_ENUM(GeoCoordinateSystemType)
52
53enum HemisphereLongitudeType {
54 north = 0,
55 south = 1,
56};
57UPER_ENUM(HemisphereLongitudeType)
58
59enum HemisphereLatitudeType {
60 east = 0,
61 west = 1,
62};
63UPER_ENUM(HemisphereLatitudeType)
64
65/** Geographic coordinate. */
67 UPER_GADGET
68 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::GeoUnitType, geoUnit, milliDegree)
69 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::GeoCoordinateSystemType, coordinateSystem, wgs84)
70 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::HemisphereLongitudeType, hemisphereLongitude, north)
71 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::HemisphereLatitudeType, hemisphereLatitude, east)
72 UPER_ELEMENT(int, longitude)
73 UPER_ELEMENT(int, latitude)
74 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::GeoUnitType, accuracy)
75 UPER_GADGET_FINALIZE
76};
77
78/** Delta encoding of a geographic coordinate. */
80 UPER_GADGET
81 UPER_ELEMENT(int, longitude)
82 UPER_ELEMENT(int, latitude)
83 UPER_GADGET_FINALIZE
84};
85
86/** Issuing information. */
88 UPER_EXTENDABLE_GADGET
89 UPER_ELEMENT_OPTIONAL(int, securityProviderNum)
90 UPER_ELEMENT_OPTIONAL(QByteArray, securityProviderIA5)
91 UPER_ELEMENT_OPTIONAL(int, issuerNum)
92 UPER_ELEMENT_OPTIONAL(QByteArray, issuerIA5)
93 UPER_ELEMENT(int, issuingYear)
94 UPER_ELEMENT(int, issuingDay)
95 UPER_ELEMENT_OPTIONAL(int, issuingTime)
96 UPER_ELEMENT_OPTIONAL(QString, issuerName)
97 UPER_ELEMENT(bool, specimen)
98 UPER_ELEMENT(bool, securePaperTicket)
99 UPER_ELEMENT(bool, activated)
100 UPER_ELEMENT_DEFAULT(QByteArray, currency, "EUR")
101 UPER_ELEMENT_DEFAULT(int, currencyFract, 2)
102 UPER_ELEMENT_OPTIONAL(QByteArray, issuerPNR)
103 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
104 UPER_ELEMENT_OPTIONAL(int, issuedOnTrainNum)
105 UPER_ELEMENT_OPTIONAL(QByteArray, issuedOnTrainIA5)
106 UPER_ELEMENT_OPTIONAL(int, issuedOnLine)
107 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::GeoCoordinateType, pointOfSale)
108 UPER_GADGET_FINALIZE
109
110 Q_PROPERTY(QDateTime issueingDateTime READ issueingDateTime)
111public:
112 [[nodiscard]] QDateTime issueingDateTime() const;
113};
114
115enum GenderType {
116 unspecified = 0,
117 female = 1,
118 male = 2,
119 other = 3,
120};
121UPER_EXTENABLE_ENUM(GenderType)
122
123enum PassengerType {
124 adult = 0,
125 senior = 1,
126 child = 2,
127 youth = 3,
128 dog = 4,
129 bicycle = 5,
130 freeAddonPassenger = 6,
131 freeAddonChild = 7,
132};
133UPER_EXTENABLE_ENUM(PassengerType)
134
135/** Customer status information. */
137 UPER_GADGET
138 UPER_ELEMENT_OPTIONAL(int, statusProviderNum)
139 UPER_ELEMENT_OPTIONAL(QByteArray, statusProviderIA5)
140 UPER_ELEMENT_OPTIONAL(int, customerStatus)
141 UPER_ELEMENT_OPTIONAL(QByteArray, customerStatusDescr)
142 UPER_GADGET_FINALIZE
143};
144
145/** Information about a single traveler. */
147 UPER_EXTENDABLE_GADGET
148 UPER_ELEMENT_OPTIONAL(QString, firstName)
149 UPER_ELEMENT_OPTIONAL(QString, secondName)
150 UPER_ELEMENT_OPTIONAL(QString, lastName)
151 UPER_ELEMENT_OPTIONAL(QByteArray, idCard)
152 UPER_ELEMENT_OPTIONAL(QByteArray, passportId)
153 UPER_ELEMENT_OPTIONAL(QByteArray, title)
154 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::GenderType, gender)
155 UPER_ELEMENT_OPTIONAL(QByteArray, customerIdIA5)
156 UPER_ELEMENT_OPTIONAL(int, customerIdNum)
157 UPER_ELEMENT_OPTIONAL(int, yearOfBirth)
158 UPER_ELEMENT_OPTIONAL(int, dayOfBirth)
159 UPER_ELEMENT(bool, ticketHolder)
160 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::PassengerType, passengerType)
161 UPER_ELEMENT_OPTIONAL(bool, passengerWithReducedMobility)
162 UPER_ELEMENT_OPTIONAL(int, countryOfResidence)
163 UPER_ELEMENT_OPTIONAL(int, countryOfPassport)
164 UPER_ELEMENT_OPTIONAL(int, countryOfIdCard)
165 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::CustomerStatusType>, status)
166 UPER_GADGET_FINALIZE
167};
168
169/** A set of traverlers. */
171 UPER_EXTENDABLE_GADGET
172 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TravelerType>, traveler)
173 UPER_ELEMENT_OPTIONAL(QByteArray, preferredLanguage)
174 UPER_ELEMENT_OPTIONAL(QString, groupName)
175 UPER_GADGET_FINALIZE
176};
177
178enum CodeTableType {
179 stationUIC = 0,
180 stationUICReservation = 1,
181 stationERA = 2,
182 localCarrierStationCodeTable = 3,
183 proprietaryIssuerStationCodeTable = 4,
184};
185UPER_ENUM(CodeTableType)
186
187/** Reference to a specific train journey. */
189 UPER_GADGET
190 UPER_ELEMENT_OPTIONAL(int, trainNum)
191 UPER_ELEMENT_OPTIONAL(QByteArray, trainIA5)
192 UPER_ELEMENT(int, travelDate)
193 UPER_ELEMENT(int, departureTime)
194 UPER_ELEMENT_OPTIONAL(int, departureUTCOffset)
195 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
196 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
197 UPER_ELEMENT_OPTIONAL(int, toStationNum)
198 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
199 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
200 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
201 UPER_GADGET_FINALIZE
202
203public:
204 Q_INVOKABLE [[nodiscard]] QDateTime departureDateTime(const QDateTime &issueingDateTime) const;
205};
206
207/** A set of via stations. */
209 UPER_EXTENDABLE_GADGET
210 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
211 UPER_ELEMENT_OPTIONAL(int, stationNum)
212 UPER_ELEMENT_OPTIONAL(QByteArray, stationIA5)
213 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::ViaStationType>, alternativeRoutes)
214 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::ViaStationType>, route)
215 UPER_ELEMENT(bool, border)
216 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
217 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
218 UPER_ELEMENT_OPTIONAL(int, seriesId)
219 UPER_ELEMENT_OPTIONAL(int, routeId)
220 UPER_GADGET_FINALIZE
221};
222
223/** A tariff zone. */
224class ZoneType {
225 UPER_EXTENDABLE_GADGET
226 UPER_ELEMENT_OPTIONAL(int, carrierNum)
227 UPER_ELEMENT_OPTIONAL(QByteArray, carrierIA5)
228 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
229 UPER_ELEMENT_OPTIONAL(int, entryStationNum)
230 UPER_ELEMENT_OPTIONAL(QByteArray, entryStationIA5)
231 UPER_ELEMENT_OPTIONAL(int, terminatingStationNum)
232 UPER_ELEMENT_OPTIONAL(QByteArray, terminatingStationIA5)
233 UPER_ELEMENT_OPTIONAL(int, city)
234 UPER_ELEMENT_OPTIONAL(QList<int>, zoneId)
235 UPER_ELEMENT_OPTIONAL(QByteArray, binaryZoneId)
236 UPER_ELEMENT_OPTIONAL(QByteArray, nutsCode)
237 UPER_GADGET_FINALIZE
238};
239
240/** */
241class LineType {
242 UPER_EXTENDABLE_GADGET
243 UPER_ELEMENT_OPTIONAL(int, carrierNum)
244 UPER_ELEMENT_OPTIONAL(QByteArray, carrierIA5)
245 UPER_ELEMENT_OPTIONAL(QList<int>, lineId)
246 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
247 UPER_ELEMENT_OPTIONAL(int, entryStationNum)
248 UPER_ELEMENT_OPTIONAL(QByteArray, entryStationIA5)
249 UPER_ELEMENT_OPTIONAL(int, terminatingStationNum)
250 UPER_ELEMENT_OPTIONAL(QByteArray, terminatingStationIA5)
251 UPER_ELEMENT_OPTIONAL(int, city)
252 UPER_ELEMENT_OPTIONAL(QByteArray, binaryZoneId)
253 UPER_GADGET_FINALIZE
254};
255
256/** A geographic polygon. */
258 UPER_GADGET
259 UPER_ELEMENT(KItinerary::Fcb::GeoCoordinateType, firstEdge)
260 UPER_ELEMENT(QList<KItinerary::Fcb::DeltaCoordinate>, edges)
261 UPER_GADGET_FINALIZE
262};
263
264/** Regional validity information.
265 * Can be one of:
266 * - TrainLinkType
267 * - ViaStationType
268 * - ZoneType
269 * - LineType
270 * - PolygoneType
271 */
273 UPER_EXTENDABLE_GADGET
274 UPER_ELEMENT(QVariant, value)
275 UPER_GADGET_FINALIZE
276};
277
278class ReturnRouteDescriptionType {
279 UPER_EXTENDABLE_GADGET
280 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
281 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
282 UPER_ELEMENT_OPTIONAL(int, toStationNum)
283 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
284 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
285 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
286 UPER_ELEMENT_OPTIONAL(QString, validReturnRegionDesc)
287 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegionalValidityType>, validReturnRegion)
288 UPER_GADGET_FINALIZE
289};
290
291enum TravelClassType {
292 notApplicable = 0,
293 first = 1,
294 second = 2,
295 tourist = 3,
296 comfort = 4,
297 premium = 5,
298 business = 6,
299 all = 7
300};
301UPER_EXTENABLE_ENUM(TravelClassType)
302
303class RouteSectionType {
304 UPER_GADGET
305 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
306 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
307 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
308 UPER_ELEMENT_OPTIONAL(int, toStationNum)
309 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
310 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
311 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
312 UPER_GADGET_FINALIZE
313};
314
315class SeriesDetailType {
316 UPER_GADGET
317 UPER_ELEMENT_OPTIONAL(int, supplyingCarrier)
318 UPER_ELEMENT_OPTIONAL(int, offerIdentification)
319 UPER_ELEMENT_OPTIONAL(int, series)
320 UPER_GADGET_FINALIZE
321};
322
323/** Customer card information. */
325 UPER_EXTENDABLE_GADGET
326 UPER_ELEMENT_OPTIONAL(int, cardIssuerNum)
327 UPER_ELEMENT_OPTIONAL(QByteArray, cardIssuerIA5)
328 UPER_ELEMENT_OPTIONAL(int, cardIdNum)
329 UPER_ELEMENT_OPTIONAL(QByteArray, cardIdIA5)
330 UPER_ELEMENT_OPTIONAL(QString, cardName)
331 UPER_ELEMENT_OPTIONAL(int, cardType)
332 UPER_ELEMENT_OPTIONAL(int, leadingCardIdNum)
333 UPER_ELEMENT_OPTIONAL(QByteArray, leadingCardIdIA5)
334 UPER_ELEMENT_OPTIONAL(int, trailingCardIdNum)
335 UPER_ELEMENT_OPTIONAL(QByteArray, trailingCardIdIA5)
336 UPER_GADGET_FINALIZE
337};
338
339enum ServiceType {
340 seat = 0,
341 couchette = 1,
342 berth = 2,
343 carcarriage = 3,
344};
345UPER_ENUM(ServiceType)
346
347/** Seat information. */
349 UPER_GADGET
350 UPER_ELEMENT_OPTIONAL(QByteArray, coach)
351 UPER_ELEMENT_OPTIONAL(QByteArray, placeString)
352 UPER_ELEMENT_OPTIONAL(QString, placeDescription)
353 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, placeIA5)
354 UPER_ELEMENT_OPTIONAL(QList<int>, placeNum)
355 UPER_GADGET_FINALIZE
356};
357
358enum class CompartmentPositionType {
359 unspecified = 0, // TODO ambiguous, therefore using enum class for now, but that's not going to work in QML
360 upperLevel = 1,
361 lowerLevel = 2,
362};
363UPER_ENUM(CompartmentPositionType)
364
365/** Compartment information. */
367 UPER_EXTENDABLE_GADGET
368 UPER_ELEMENT_OPTIONAL(int, coachType)
369 UPER_ELEMENT_OPTIONAL(int, compartmentType)
370 UPER_ELEMENT_OPTIONAL(int, specialAllocation)
371 UPER_ELEMENT_OPTIONAL(QString, coachTypeDescr)
372 UPER_ELEMENT_OPTIONAL(QString, compartmentTypeDescr)
373 UPER_ELEMENT_OPTIONAL(QString, specialAllocationDescr)
374 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CompartmentPositionType, position, CompartmentPositionType::unspecified)
375 UPER_GADGET_FINALIZE
376};
377
378enum BerthTypeType {
379 single = 0,
380 special = 1,
381 doubleBerth = 2, // "double" in the spec, but that conflicts
382 t2 = 3,
383 t3 = 4,
384 t4 = 5,
385};
386UPER_ENUM(BerthTypeType)
387
388enum class CompartmentGenderType {
389 unspecified = 0, // TODO see CompartmentPositionType
390 family = 1,
391 female = 2,
392 male = 3,
393 mixed = 4,
394};
395UPER_EXTENABLE_ENUM(CompartmentGenderType)
396
397/** Berth information. */
399 UPER_EXTENDABLE_GADGET
400 UPER_ELEMENT(KItinerary::Fcb::BerthTypeType, berthType)
401 UPER_ELEMENT(int, numberOfBerths)
402 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CompartmentGenderType, gender, CompartmentGenderType::family)
403 UPER_GADGET_FINALIZE
404};
405
406/** Tariff information. */
408 UPER_EXTENDABLE_GADGET
409 UPER_ELEMENT_DEFAULT(int, numberOfPassengers, 1)
410 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::PassengerType, passengerType)
411 UPER_ELEMENT_OPTIONAL(int, ageBelow)
412 UPER_ELEMENT_OPTIONAL(int, ageAbove)
413 UPER_ELEMENT_OPTIONAL(QList<int>, travelerid)
414 UPER_ELEMENT(bool, restrictedToCountryOfResidence)
415 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::RouteSectionType, restrictedToRouteSection)
416 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::SeriesDetailType, seriesDataDetails)
417 UPER_ELEMENT_OPTIONAL(int, tariffIdNum)
418 UPER_ELEMENT_OPTIONAL(QByteArray, tariffIdIA5)
419 UPER_ELEMENT_OPTIONAL(QString, tariffDesc)
420 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::CardReferenceType>, reductionCard)
421 UPER_GADGET_FINALIZE
422};
423
424enum PriceTypeType {
425 noPrice = 0,
426 reservationFee = 1,
427 supplement = 2,
428 travelPrice = 3,
429};
430UPER_ENUM(PriceTypeType)
431
432/** VAT information. */
434 UPER_GADGET
435 UPER_ELEMENT(int, country)
436 UPER_ELEMENT(int, percentage)
437 UPER_ELEMENT_OPTIONAL(int, amount)
438 UPER_ELEMENT_OPTIONAL(QByteArray, vatId)
439 UPER_GADGET_FINALIZE
440};
441
442/** Open tickets included into a reservation. */
444 UPER_EXTENDABLE_GADGET
445 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
446 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
447 UPER_ELEMENT_OPTIONAL(int, productIdNum)
448 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
449 UPER_ELEMENT_OPTIONAL(int, externalIssuerId)
450 UPER_ELEMENT_OPTIONAL(int, issuerAutorizationId)
451 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
452 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegionalValidityType>, validRegion)
453 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
454 UPER_ELEMENT_OPTIONAL(int, validFromTime)
455 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
456 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
457 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
458 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
459 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::TravelClassType, classCode)
460 UPER_ELEMENT_OPTIONAL(QByteArray, serviceLevel)
461 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
462 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
463 UPER_ELEMENT_OPTIONAL(QList<int>, includedServiceBrands)
464 UPER_ELEMENT_OPTIONAL(QList<int>, excludedServiceBrands)
465 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TariffType>, tariffs)
466 UPER_ELEMENT_OPTIONAL(QString, infoText)
467 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
468 UPER_GADGET_FINALIZE
469};
470
471/** Luggage information. */
473 UPER_EXTENDABLE_GADGET
474 UPER_ELEMENT_OPTIONAL(QByteArray, registrationId)
475 UPER_ELEMENT_OPTIONAL(int, maxWeight)
476 UPER_ELEMENT_OPTIONAL(int, maxSize)
477 UPER_GADGET_FINALIZE
478};
479
480/** Luggage restriction information. */
482 UPER_EXTENDABLE_GADGET
483 UPER_ELEMENT_DEFAULT(int, maxHandLuggagePieces, 3)
484 UPER_ELEMENT_DEFAULT(int, maxNonHandLuggagePieces, 1)
485 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegisteredLuggageType>, registeredLuggage)
486 UPER_GADGET_FINALIZE
487};
488
489/** Reservation document (IRT, RES). */
491 UPER_EXTENDABLE_GADGET
492 UPER_ELEMENT_OPTIONAL(int, trainNum)
493 UPER_ELEMENT_OPTIONAL(QByteArray, trainIA5)
494 UPER_ELEMENT_DEFAULT(int, departureDate, 0)
495 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
496 UPER_ELEMENT_OPTIONAL(int, referenceNum)
497 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
498 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
499 UPER_ELEMENT_OPTIONAL(int, productIdNum)
500 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
501 UPER_ELEMENT_OPTIONAL(int, serviceBrand)
502 UPER_ELEMENT_OPTIONAL(QString, serviceBrandAbrUTF8)
503 UPER_ELEMENT_OPTIONAL(QString, serviceBrandNameUTF8)
504 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::ServiceType, service, seat)
505 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUICReservation)
506 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
507 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
508 UPER_ELEMENT_OPTIONAL(int, toStationNum)
509 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
510 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
511 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
512 UPER_ELEMENT(int, departureTime)
513 UPER_ELEMENT_OPTIONAL(int, departureUTCOffset)
514 UPER_ELEMENT_DEFAULT(int, arrivalDate, 0)
515 UPER_ELEMENT_OPTIONAL(int, arrivalTime)
516 UPER_ELEMENT_OPTIONAL(int, arrivalUTCOffset)
517 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
518 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
519 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TravelClassType, classCode, second)
520 UPER_ELEMENT_OPTIONAL(QByteArray, serviceLevel)
521 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::PlacesType, places)
522 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::PlacesType, additionalPlaces)
523 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::PlacesType, bicyclePlaces)
524 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::CompartmentDetailsType, compartmentDetails)
525 UPER_ELEMENT_DEFAULT(int, numberOfOverbooked, 0)
526 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::BerthDetailData>, berth)
527 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TariffType>, tariffs) // "tariff" in the official ASN.1 spec, but that inconsistent with the other document types
528 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::PriceTypeType, priceType, travelPrice)
529 UPER_ELEMENT_OPTIONAL(int, price)
530 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::VatDetailType>, vatDetail)
531 UPER_ELEMENT_DEFAULT(int, typeOfSupplement, 0)
532 UPER_ELEMENT_DEFAULT(int, numberOfSupplements, 0)
533 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::LuggageRestrictionType, luggage)
534 UPER_ELEMENT_OPTIONAL(QString, infoText)
535 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
536 UPER_GADGET_FINALIZE
537
538public:
539 Q_INVOKABLE [[nodiscard]] QDateTime departureDateTime(const QDateTime &issueingDateTime) const;
540 Q_INVOKABLE [[nodiscard]] QDateTime arrivalDateTime(const QDateTime &issueingDateTime) const;
541};
542
543enum RoofRackType {
544 norack = 0,
545 roofRailing = 1,
546 luggageRack = 2,
547 skiRack = 3,
548 boxRack = 4,
549 rackWithOneBox = 5,
550 rackWithTwoBoxes = 6,
551 bicycleRack = 7,
552 otherRack = 8,
553};
554UPER_EXTENABLE_ENUM(RoofRackType)
555
556enum class LoadingDeckType {
557 unspecified = 0, // TODO see above
558 upper = 1,
559 lower = 2,
560};
561UPER_ENUM(LoadingDeckType)
562
563/** Car carriage reservation document. */
565 UPER_EXTENDABLE_GADGET
566 UPER_ELEMENT_OPTIONAL(int, trainNum)
567 UPER_ELEMENT_OPTIONAL(QByteArray, trainIA5)
568 UPER_ELEMENT_DEFAULT(int, beginLoadingDate, 0)
569 UPER_ELEMENT_OPTIONAL(int, beginLoadingTime)
570 UPER_ELEMENT_OPTIONAL(int, endLoadingTime)
571 UPER_ELEMENT_OPTIONAL(int, loadingUTCOffset)
572 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
573 UPER_ELEMENT_OPTIONAL(int, referenceNum)
574 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
575 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
576 UPER_ELEMENT_OPTIONAL(int, productIdNum)
577 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
578 UPER_ELEMENT_OPTIONAL(int, serviceBrand)
579 UPER_ELEMENT_OPTIONAL(QString, serviceBrandAbrUTF8)
580 UPER_ELEMENT_OPTIONAL(QString, serviceBrandNameUTF8)
581 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUICReservation)
582 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
583 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
584 UPER_ELEMENT_OPTIONAL(int, toStationNum)
585 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
586 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
587 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
588 UPER_ELEMENT_OPTIONAL(QByteArray, coach)
589 UPER_ELEMENT_OPTIONAL(QByteArray, place)
590 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::CompartmentDetailsType, compartmentDetails)
591 UPER_ELEMENT_OPTIONAL(QByteArray, numberPlate)
592 UPER_ELEMENT_OPTIONAL(QByteArray, trailerPlate)
593 UPER_ELEMENT(int, carCategory)
594 UPER_ELEMENT_OPTIONAL(int, boatCategory)
595 UPER_ELEMENT(bool, textileRoof)
596 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::RoofRackType, roofRackType, norack)
597 UPER_ELEMENT_OPTIONAL(int, roofRackHeight)
598 UPER_ELEMENT_OPTIONAL(int, attachedBoats)
599 UPER_ELEMENT_OPTIONAL(int, attachedBicycles)
600 UPER_ELEMENT_OPTIONAL(int, attachedSurfboards)
601 UPER_ELEMENT_OPTIONAL(int, loadingListEntry)
602 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::LoadingDeckType, loadingDeck, LoadingDeckType::upper)
603 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
604 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
605 UPER_ELEMENT(KItinerary::Fcb::TariffType, tariff)
606 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::PriceTypeType, priceType, travelPrice)
607 UPER_ELEMENT_OPTIONAL(int, price)
608 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::VatDetailType>, vatDetail)
609 UPER_ELEMENT_OPTIONAL(QString, infoText)
610 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
611 UPER_GADGET_FINALIZE
612};
613
614/** Open ticket document (NRT). */
616 UPER_EXTENDABLE_GADGET
617 UPER_ELEMENT_OPTIONAL(int, referenceNum)
618 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
619 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
620 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
621 UPER_ELEMENT_OPTIONAL(int, productIdNum)
622 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
623 UPER_ELEMENT_OPTIONAL(int, extIssuerId)
624 UPER_ELEMENT_OPTIONAL(int, issuerAutorizationId)
625 UPER_ELEMENT(bool, returnIncluded)
626 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
627 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
628 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
629 UPER_ELEMENT_OPTIONAL(int, toStationNum)
630 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
631 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
632 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
633 UPER_ELEMENT_OPTIONAL(QString, validRegionDesc)
634 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegionalValidityType>, validRegion)
635 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ReturnRouteDescriptionType, returnDescription)
636 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
637 UPER_ELEMENT_OPTIONAL(int, validFromTime)
638 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
639 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
640 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
641 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
642 UPER_ELEMENT_OPTIONAL(QList<int>, activatedDay)
643 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TravelClassType, classCode, second)
644 UPER_ELEMENT_OPTIONAL(QByteArray, serviceLevel)
645 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
646 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
647 UPER_ELEMENT_OPTIONAL(QList<int>, includedServiceBrands)
648 UPER_ELEMENT_OPTIONAL(QList<int>, excludedServiceBrands)
649 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TariffType>, tariffs)
650 UPER_ELEMENT_OPTIONAL(int, price)
651 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::VatDetailType>, vatDetail)
652 UPER_ELEMENT_OPTIONAL(QString, infoText)
653 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::IncludedOpenTicketType>, includedAddOns)
654 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::LuggageRestrictionType, luggage)
655 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
656 UPER_GADGET_FINALIZE
657
658public:
659 Q_INVOKABLE [[nodiscard]] QDateTime validFrom(const QDateTime &issueingDateTime) const;
660 Q_INVOKABLE [[nodiscard]] QDateTime validUntil(const QDateTime &issueingDateTime) const;
661};
662
663/** Time range. */
665 UPER_GADGET
666 UPER_ELEMENT(int, fromTime)
667 UPER_ELEMENT(int, untilTime)
668 UPER_GADGET_FINALIZE
669};
670
671/** Validity time period. */
673 UPER_GADGET
674 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
675 UPER_ELEMENT_OPTIONAL(int, validFromTime)
676 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
677 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
678 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
679 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
680 UPER_GADGET_FINALIZE
681};
682
683/** Set of validity time period. */
685 UPER_GADGET
686 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::ValidityPeriodDetailType>, validityPeriod)
687 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TimeRangeType>, excludedTimeRange)
688 UPER_GADGET_FINALIZE
689};
690
691/** Rail pass document (RPT). */
692class PassData {
693 UPER_EXTENDABLE_GADGET
694 UPER_ELEMENT_OPTIONAL(int, referenceNum)
695 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
696 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
697 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
698 UPER_ELEMENT_OPTIONAL(int, productIdNum)
699 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
700 UPER_ELEMENT_OPTIONAL(int, passType)
701 UPER_ELEMENT_OPTIONAL(QString, passDescription)
702 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TravelClassType, classCode, second)
703 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
704 UPER_ELEMENT_OPTIONAL(int, validFromTime)
705 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
706 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
707 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
708 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
709 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ValidityPeriodDetailType, validityPeriodDetails)
710 UPER_ELEMENT_OPTIONAL(int, numberOfValidityDays)
711 UPER_ELEMENT_OPTIONAL(int, numberOfPossibleTrips)
712 UPER_ELEMENT_OPTIONAL(int, numberOfDaysOfTravel)
713 UPER_ELEMENT_OPTIONAL(QList<int>, activatedDay)
714 UPER_ELEMENT_OPTIONAL(QList<int>, countries)
715 UPER_ELEMENT_OPTIONAL(QList<int>, includedCarrierNum)
716 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, includedCarrierIA5)
717 UPER_ELEMENT_OPTIONAL(QList<int>, excludedCarrierNum)
718 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, excludedCarrierIA5)
719 UPER_ELEMENT_OPTIONAL(QList<int>, includedServiceBrands)
720 UPER_ELEMENT_OPTIONAL(QList<int>, excludedServiceBrands)
721 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegionalValidityType>, validRegion)
722 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TariffType>, tariffs)
723 UPER_ELEMENT_OPTIONAL(int, price)
724 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::VatDetailType>, vatDetail)
725 UPER_ELEMENT_OPTIONAL(QString, infoText)
726 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
727 UPER_GADGET_FINALIZE
728
729public:
730 Q_INVOKABLE [[nodiscard]] QDateTime validFrom(const QDateTime &issueingDateTime) const;
731 Q_INVOKABLE [[nodiscard]] QDateTime validUntil(const QDateTime &issueingDateTime) const;
732};
733
734/** Voucher document. */
736 UPER_EXTENDABLE_GADGET
737 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
738 UPER_ELEMENT_OPTIONAL(int, referenceNum)
739 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
740 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
741 UPER_ELEMENT_OPTIONAL(int, productIdNum)
742 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
743 UPER_ELEMENT(int, validFromYear)
744 UPER_ELEMENT(int, validFromDay)
745 UPER_ELEMENT(int, validUntilYear)
746 UPER_ELEMENT(int, validUntilDay)
747 UPER_ELEMENT_DEFAULT(int, value, 0)
748 UPER_ELEMENT_OPTIONAL(int, type)
749 UPER_ELEMENT_OPTIONAL(QString, infoText)
750 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
751 UPER_GADGET_FINALIZE
752};
753
754/** Customer card document. */
756 UPER_EXTENDABLE_GADGET
757 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::TravelerType, customer)
758 UPER_ELEMENT_OPTIONAL(QByteArray, cardIdIA5)
759 UPER_ELEMENT_OPTIONAL(int, cardIdNum)
760 UPER_ELEMENT(int, validFromYear)
761 UPER_ELEMENT_OPTIONAL(int, validFromDay)
762 UPER_ELEMENT_DEFAULT(int, validUntilYear, 0)
763 UPER_ELEMENT_OPTIONAL(int, validUntilDay)
764 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::TravelClassType, classCode)
765 UPER_ELEMENT_OPTIONAL(int, cardType)
766 UPER_ELEMENT_OPTIONAL(QString, cardTypeDescr)
767 UPER_ELEMENT_OPTIONAL(int, customerStatus)
768 UPER_ELEMENT_OPTIONAL(QByteArray, customerStatusDescr)
769 UPER_ELEMENT_OPTIONAL(QList<int>, includedServices)
770 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
771 UPER_GADGET_FINALIZE
772
773 Q_PROPERTY(QDate validFrom READ validFrom)
774 Q_PROPERTY(QDate validUntil READ validUntil)
775public:
776 [[nodiscard]] QDate validFrom() const;
777 [[nodiscard]] QDate validUntil() const;
778};
779
780/** Countermark document. */
782 UPER_EXTENDABLE_GADGET
783 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
784 UPER_ELEMENT_OPTIONAL(int, referenceNum)
785 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
786 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
787 UPER_ELEMENT_OPTIONAL(int, productIdNum)
788 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
789 UPER_ELEMENT_OPTIONAL(QByteArray, ticketReferenceIA5)
790 UPER_ELEMENT_OPTIONAL(int, ticketReferenceNum)
791 UPER_ELEMENT(int, numberOfCountermark)
792 UPER_ELEMENT(int, totalOfCountermarks)
793 UPER_ELEMENT(QString, groupName)
794 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
795 UPER_ELEMENT_OPTIONAL(int, fromStationNum)
796 UPER_ELEMENT_OPTIONAL(QByteArray, fromStationIA5)
797 UPER_ELEMENT_OPTIONAL(int, toStationNum)
798 UPER_ELEMENT_OPTIONAL(QByteArray, toStationIA5)
799 UPER_ELEMENT_OPTIONAL(QString, fromStationNameUTF8)
800 UPER_ELEMENT_OPTIONAL(QString, toStationNameUTF8)
801 UPER_ELEMENT_OPTIONAL(QString, validRegionDesc)
802 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::RegionalValidityType>, validRegion)
803 UPER_ELEMENT(bool, returnIncluded)
804 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ReturnRouteDescriptionType, returnDescription)
805 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
806 UPER_ELEMENT_OPTIONAL(int, validFromTime)
807 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
808 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
809 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
810 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
811 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TravelClassType, classCode, second)
812 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
813 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
814 UPER_ELEMENT_OPTIONAL(QList<int>, includedServiceBrands)
815 UPER_ELEMENT_OPTIONAL(QList<int>, excludedServiceBrands)
816 UPER_ELEMENT_OPTIONAL(QString, infoText)
817 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
818 UPER_GADGET_FINALIZE
819};
820
821/** Parking ground document. */
823 UPER_EXTENDABLE_GADGET
824 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
825 UPER_ELEMENT_OPTIONAL(int, referenceNum)
826 UPER_ELEMENT(QByteArray, parkingGroundId)
827 UPER_ELEMENT(int, fromParkingDate)
828 UPER_ELEMENT_DEFAULT(int, untilParkingDate, 0)
829 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
830 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
831 UPER_ELEMENT_OPTIONAL(int, productIdNum)
832 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
833 UPER_ELEMENT_OPTIONAL(QByteArray, accessCode)
834 UPER_ELEMENT(QString, location)
835 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
836 UPER_ELEMENT_OPTIONAL(int, stationNum)
837 UPER_ELEMENT_OPTIONAL(QString, stationIA5) // yep, actually UTF8String rather than IA5String
838 UPER_ELEMENT_OPTIONAL(QString, specialInformation)
839 UPER_ELEMENT_OPTIONAL(QString, entryTrack)
840 UPER_ELEMENT_OPTIONAL(QByteArray, numberPlate)
841 UPER_ELEMENT_OPTIONAL(int, price)
842 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::VatDetailType>, vatDetail)
843 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
844 UPER_GADGET_FINALIZE
845};
846
847/** FIP ticket document. */
849 UPER_EXTENDABLE_GADGET
850 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
851 UPER_ELEMENT_OPTIONAL(int, referenceNum)
852 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
853 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
854 UPER_ELEMENT_OPTIONAL(int, productIdNum)
855 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
856 UPER_ELEMENT_DEFAULT(int, validFromDay, 0)
857 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
858 UPER_ELEMENT_OPTIONAL(QList<int>, activatedDay)
859 UPER_ELEMENT_OPTIONAL(QList<int>, carrierNum)
860 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, carrierIA5)
861 UPER_ELEMENT(int, numberOfTravelDays)
862 UPER_ELEMENT(bool, includesSupplements)
863 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TravelClassType, classCode, second)
864 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
865 UPER_GADGET_FINALIZE
866};
867
868/** Station passage document. */
870 UPER_EXTENDABLE_GADGET
871 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
872 UPER_ELEMENT_OPTIONAL(int, referenceNum)
873 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
874 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
875 UPER_ELEMENT_OPTIONAL(int, productIdNum)
876 UPER_ELEMENT_OPTIONAL(QByteArray, productIdIA5)
877 UPER_ELEMENT_OPTIONAL(QString, productName)
878 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
879 UPER_ELEMENT_OPTIONAL(QList<int>, stationNum)
880 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, stationIA5)
881 UPER_ELEMENT_OPTIONAL(QList<QString>, stationNameUTF8)
882 UPER_ELEMENT_OPTIONAL(QList<int>, areaCodeNum)
883 UPER_ELEMENT_OPTIONAL(QList<QByteArray>, areaCodeIA5)
884 UPER_ELEMENT_OPTIONAL(QList<QString>, areaNameUTF8)
885 UPER_ELEMENT(int, validFromDay)
886 UPER_ELEMENT_OPTIONAL(int, validFromTime)
887 UPER_ELEMENT_OPTIONAL(int, validFromUTCOffset)
888 UPER_ELEMENT_DEFAULT(int, validUntilDay, 0)
889 UPER_ELEMENT_OPTIONAL(int, validUntilTime)
890 UPER_ELEMENT_OPTIONAL(int, validUntilUTCOffset)
891 UPER_ELEMENT_OPTIONAL(int, numberOfDaysValid)
892 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
893 UPER_GADGET_FINALIZE
894};
895
896enum ConfirmationType {
897 trainDelayConfirmation = 0,
898 travelerDelayConfirmation = 1,
899 trainLinkedTicketDelay = 2,
900};
901UPER_EXTENABLE_ENUM(ConfirmationType)
902
903enum TicketType {
904 openTicket = 0,
905 pass = 1,
906 reservation = 2,
907 carCarriageReservation = 3,
908};
909UPER_EXTENABLE_ENUM(TicketType)
910
911enum LinkMode {
912 issuedTogether = 0,
913 onlyValidInCombination = 1,
914};
915UPER_EXTENABLE_ENUM(LinkMode)
916
917/** */
918class TicketLinkType {
919 UPER_EXTENDABLE_GADGET
920 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
921 UPER_ELEMENT_OPTIONAL(int, referenceNum)
922 UPER_ELEMENT_OPTIONAL(QString, issuerName)
923 UPER_ELEMENT_OPTIONAL(QByteArray, issuerPNR)
924 UPER_ELEMENT_OPTIONAL(int, productOwnerNum)
925 UPER_ELEMENT_OPTIONAL(QByteArray, productOwnerIA5)
926 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::TicketType, ticketType, openTicket)
927 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::LinkMode, linkMode, issuedTogether)
928 UPER_GADGET_FINALIZE
929};
930
931/** Delay confirmation document. */
933 UPER_EXTENDABLE_GADGET
934 UPER_ELEMENT_OPTIONAL(QByteArray, referenceIA5)
935 UPER_ELEMENT_OPTIONAL(int, referenceNum)
936 UPER_ELEMENT_OPTIONAL(int, trainNum)
937 UPER_ELEMENT_OPTIONAL(QByteArray, trainIA5)
938 UPER_ELEMENT_OPTIONAL(int, departureYear)
939 UPER_ELEMENT_OPTIONAL(int, departureDay)
940 UPER_ELEMENT_OPTIONAL(int, departureTime)
941 UPER_ELEMENT_OPTIONAL(int, departureUTCOffset)
942 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::CodeTableType, stationCodeTable, stationUIC)
943 UPER_ELEMENT_OPTIONAL(int, stationNum)
944 UPER_ELEMENT_OPTIONAL(QByteArray, stationIA5)
945 UPER_ELEMENT(int, delay)
946 UPER_ELEMENT(bool, trainCancelled)
947 UPER_ELEMENT_DEFAULT(KItinerary::Fcb::ConfirmationType, confirmationType, travelerDelayConfirmation)
948 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TicketLinkType>, affectedTickets)
949 UPER_ELEMENT_OPTIONAL(QString, infoText)
950 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
951 UPER_GADGET_FINALIZE
952};
953
954/** Ticket token. */
956 UPER_GADGET
957 UPER_ELEMENT_OPTIONAL(int, tokenProviderNum)
958 UPER_ELEMENT_OPTIONAL(QByteArray, tokenProviderIA5)
959 UPER_ELEMENT_OPTIONAL(QByteArray, tokenSpecification)
960 UPER_ELEMENT(QByteArray, token)
961 UPER_GADGET_FINALIZE
962};
963
964/** Variant wrapper for specific document types.
965 * Can be one of:
966 * - ReservationData
967 * - CarCarriageReservationData
968 * - OpenTicketData
969 * - PassData
970 * - VoucherData
971 * - CustomerCardData
972 * - CountermarkData
973 * - ParkingGroundData
974 * - FIPTicketData
975 * - StationPassageData
976 * - ExtensionData
977 * - DelayConfirmation
978 */
980 UPER_EXTENDABLE_GADGET
981 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::TokenType, token)
982 UPER_ELEMENT(QVariant, ticket)
983 UPER_GADGET_FINALIZE
984};
985
986/** Ticket control data. */
988 UPER_EXTENDABLE_GADGET
989 UPER_ELEMENT_OPTIONAL(QList <KItinerary::Fcb::CardReferenceType>, identificationByCardReference)
990 UPER_ELEMENT(bool, identificationByIdCard)
991 UPER_ELEMENT(bool, identificationByPassportId)
992 UPER_ELEMENT_OPTIONAL(int, identificationItem)
993 UPER_ELEMENT(bool, passportValidationRequired)
994 UPER_ELEMENT(bool, onlineValidationRequired)
995 UPER_ELEMENT_OPTIONAL(int, randomDetailedValidationRequired)
996 UPER_ELEMENT(bool, ageCheckRequired)
997 UPER_ELEMENT(bool, reductionCardCheckRequired)
998 UPER_ELEMENT_OPTIONAL(QString, infoText)
999 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::TicketLinkType>, includedTickets)
1000 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ExtensionData, extension)
1001 UPER_GADGET_FINALIZE
1002};
1003
1004/** Top-level type for the ERA FCB ticket structure. */
1005class KITINERARY_EXPORT UicRailTicketData {
1006 UPER_EXTENDABLE_GADGET
1007 UPER_ELEMENT(KItinerary::Fcb::IssuingData, issuingDetail)
1008 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::TravelerData, travelerDetail)
1009 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::DocumentData>, transportDocument)
1010 UPER_ELEMENT_OPTIONAL(KItinerary::Fcb::ControlData, controlDetail)
1011 UPER_ELEMENT_OPTIONAL(QList<KItinerary::Fcb::ExtensionData>, extension)
1012 UPER_GADGET_FINALIZE
1013public:
1015 UicRailTicketData(const Uic9183Block &block);
1016
1017 static constexpr const char RecordId[] = "U_FLEX";
1018
1019 [[nodiscard]] bool isValid() const;
1020
1021private:
1022 Uic9183Block m_block;
1023};
1024
1025}
1026}
1027
1028Q_DECLARE_METATYPE(KItinerary::Fcb::ExtensionData)
1029Q_DECLARE_METATYPE(KItinerary::Fcb::GeoCoordinateType)
1030Q_DECLARE_METATYPE(KItinerary::Fcb::DeltaCoordinate)
1031Q_DECLARE_METATYPE(KItinerary::Fcb::IssuingData)
1032Q_DECLARE_METATYPE(KItinerary::Fcb::TravelerType)
1033Q_DECLARE_METATYPE(KItinerary::Fcb::CustomerStatusType)
1034Q_DECLARE_METATYPE(KItinerary::Fcb::TravelerData)
1035Q_DECLARE_METATYPE(KItinerary::Fcb::TrainLinkType)
1036Q_DECLARE_METATYPE(KItinerary::Fcb::ViaStationType)
1037Q_DECLARE_METATYPE(KItinerary::Fcb::ZoneType)
1038Q_DECLARE_METATYPE(KItinerary::Fcb::LineType)
1039Q_DECLARE_METATYPE(KItinerary::Fcb::PolygoneType)
1040Q_DECLARE_METATYPE(KItinerary::Fcb::RegionalValidityType)
1041Q_DECLARE_METATYPE(KItinerary::Fcb::ReturnRouteDescriptionType)
1042Q_DECLARE_METATYPE(KItinerary::Fcb::RouteSectionType)
1043Q_DECLARE_METATYPE(KItinerary::Fcb::SeriesDetailType)
1044Q_DECLARE_METATYPE(KItinerary::Fcb::PlacesType)
1046Q_DECLARE_METATYPE(KItinerary::Fcb::BerthDetailData)
1047Q_DECLARE_METATYPE(KItinerary::Fcb::TariffType)
1048Q_DECLARE_METATYPE(KItinerary::Fcb::VatDetailType)
1052Q_DECLARE_METATYPE(KItinerary::Fcb::ReservationData)
1054Q_DECLARE_METATYPE(KItinerary::Fcb::OpenTicketData)
1055Q_DECLARE_METATYPE(KItinerary::Fcb::TimeRangeType)
1056Q_DECLARE_METATYPE(KItinerary::Fcb::ValidityPeriodType)
1058Q_DECLARE_METATYPE(KItinerary::Fcb::PassData)
1059Q_DECLARE_METATYPE(KItinerary::Fcb::VoucherData)
1060Q_DECLARE_METATYPE(KItinerary::Fcb::CustomerCardData)
1061Q_DECLARE_METATYPE(KItinerary::Fcb::CountermarkData)
1062Q_DECLARE_METATYPE(KItinerary::Fcb::ParkingGroundData)
1063Q_DECLARE_METATYPE(KItinerary::Fcb::FIPTicketData)
1064Q_DECLARE_METATYPE(KItinerary::Fcb::StationPassageData)
1065Q_DECLARE_METATYPE(KItinerary::Fcb::DelayConfirmation)
1066Q_DECLARE_METATYPE(KItinerary::Fcb::TokenType)
1067Q_DECLARE_METATYPE(KItinerary::Fcb::DocumentData)
1068Q_DECLARE_METATYPE(KItinerary::Fcb::CardReferenceType)
1069Q_DECLARE_METATYPE(KItinerary::Fcb::TicketLinkType)
1070Q_DECLARE_METATYPE(KItinerary::Fcb::ControlData)
1071Q_DECLARE_METATYPE(KItinerary::Fcb::UicRailTicketData)
1072
1073#endif // KITINERARY_FCBTICKET_H
Car carriage reservation document.
Definition fcbticket.h:564
Customer card information.
Definition fcbticket.h:324
Ticket control data.
Definition fcbticket.h:987
Countermark document.
Definition fcbticket.h:781
Customer card document.
Definition fcbticket.h:755
Customer status information.
Definition fcbticket.h:136
Delay confirmation document.
Definition fcbticket.h:932
Delta encoding of a geographic coordinate.
Definition fcbticket.h:79
Variant wrapper for specific document types.
Definition fcbticket.h:979
Generic extension data.
Definition fcbticket.h:31
FIP ticket document.
Definition fcbticket.h:848
Geographic coordinate.
Definition fcbticket.h:66
Open tickets included into a reservation.
Definition fcbticket.h:443
Issuing information.
Definition fcbticket.h:87
Luggage restriction information.
Definition fcbticket.h:481
Open ticket document (NRT).
Definition fcbticket.h:615
Parking ground document.
Definition fcbticket.h:822
Rail pass document (RPT).
Definition fcbticket.h:692
Seat information.
Definition fcbticket.h:348
A geographic polygon.
Definition fcbticket.h:257
Regional validity information.
Definition fcbticket.h:272
Reservation document (IRT, RES).
Definition fcbticket.h:490
Station passage document.
Definition fcbticket.h:869
Tariff information.
Definition fcbticket.h:407
Reference to a specific train journey.
Definition fcbticket.h:188
A set of traverlers.
Definition fcbticket.h:170
Information about a single traveler.
Definition fcbticket.h:146
Top-level type for the ERA FCB ticket structure.
Definition fcbticket.h:1005
Set of validity time period.
Definition fcbticket.h:684
A set of via stations.
Definition fcbticket.h:208
A data block from a UIC 918.3 ticket.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.