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