KItinerary

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

KDE's Doxygen guidelines are available online.