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

KDE's Doxygen guidelines are available online.