summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-06-29 16:26:36 +0200
committerGitHub <noreply@github.com>2021-06-29 16:26:36 +0200
commit27d114203f6edaf8aea75ee710bd87f32d79f003 (patch)
tree794e40b39e154adef8e471ab8774c8a68bd3e434
parentDelete uicBarcodeFCBv2.0.asn (diff)
parent- test for FCB version 3 (diff)
downloadUIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar.gz
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar.bz2
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar.lz
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar.xz
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.tar.zst
UIC-barcode-27d114203f6edaf8aea75ee710bd87f32d79f003.zip
Diffstat (limited to '')
-rw-r--r--misc/uicBarcodeHeader_v1.0.0.asn119
-rw-r--r--misc/uicDynamicContentData_v1.0.0.asn (renamed from misc/dynamicContentFDCv1.0.asn)17
-rw-r--r--misc/uicRailTicketData_v1.3.0.asn (renamed from misc/uicBarcodeV1finalDelayConfirmation1.3.asn)4092
-rw-r--r--misc/uicRailTicketData_v1.3.1.asn (renamed from misc/uicBarcodeV1finalDelayConfirmation1.3.1.asn)4040
-rw-r--r--misc/uicRailTicketData_v2.0.0.asn2040
-rw-r--r--misc/uicRailTicketData_v2.0.1.asn2042
-rw-r--r--misc/uicRailTicketData_v2.0.2.asn2113
-rw-r--r--misc/uicRailTicketData_v3.0.0.asn2180
-rw-r--r--src/main/java/org/uic/barcode/Decoder.java43
-rw-r--r--src/main/java/org/uic/barcode/Encoder.java44
-rw-r--r--src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java1
-rw-r--r--src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java76
-rw-r--r--src/main/java/org/uic/barcode/dynamicFrame/Level2DataType.java21
-rw-r--r--src/main/java/org/uic/barcode/staticFrame/StaticFrame.java75
-rw-r--r--src/main/java/org/uic/barcode/ticket/UicRailTicketCoder.java32
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthDetailData.java79
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthTypeType.java41
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/BoardingOrArrivalType.java39
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java734
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CardReferenceType.java182
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CodeTableType.java40
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentDetailsType.java136
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentGenderType.java42
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentPositionType.java38
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ConfirmationTypeType.java42
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ControlData.java200
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CountermarkData.java578
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java297
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerStatusType.java93
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java339
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/DeltaCoordinates.java58
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/DocumentData.java61
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ExtensionData.java64
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/FIPTicketData.java338
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/GenderType.java42
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateSystemType.java38
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateType.java144
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoUnitType.java40
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLatitudeType.java37
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLongitudeType.java36
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java454
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java360
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/LineType.java185
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/LinkMode.java39
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/LoadingDeckType.java38
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java88
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java678
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ParkingGroundData.java364
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java602
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassengerType.java46
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/PlacesType.java131
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/PolygoneType.java58
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/PriceTypeType.java39
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegionalValidityType.java100
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegisteredLuggageType.java80
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java711
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReturnRouteDescriptionType.java150
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/RoofRackType.java46
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/RouteSectionType.java138
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java26
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfBerthDetailData.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCardReferenceType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierIA5.java13
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java28
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java27
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCustomerStatusType.java11
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDeltaCoordinates.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDocumentData.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfExtensionData.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfIncludedOpenTicketType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java28
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegionalValidityType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegisteredLuggageType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java26
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTariffType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTicketLinkType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java26
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java26
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfVatDetail.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfViaStationType.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/SeriesDetailType.java75
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ServiceType.java38
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/StationPassageData.java387
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java206
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketDetailData.java190
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketLinkType.java156
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketType.java41
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TimeRangeType.java59
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TokenType.java92
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java185
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java255
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelClassType.java50
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerData.java82
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java334
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/UicRailTicketData.java115
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodDetailType.java73
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java165
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/VatDetailType.java86
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ViaStationType.java205
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java316
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/asn/omv3/ZoneType.java182
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java14
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java197
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java7
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java22
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/spec/IBoardingOrArrivalType.java39
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/spec/IPass.java26
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/spec/ITrainValidity.java146
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/spec/IUicTicketObjectFactory.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/spec/IViaStation.java30
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java13
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java10
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java2339
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/Asn2ApiDecoder.java13
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java2
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java2324
-rw-r--r--src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java153
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java57
-rw-r--r--src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java5
-rw-r--r--src/test/java/org/uic/barcode/test/utils/TestUtils.java5
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/CustomerCardTimeZoneTestV3.java314
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/FipTimeZoneTestV3.java347
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/OpenTicketComplexTestV3.java95
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/OpenTicketTimeZoneTestV3.java347
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/ParkingTimeZoneTestV3.java314
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/PassComplexTestV3.java92
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/PassTimeZoneTestV3.java347
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/ReservationTimeZoneTestV3.java314
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/StationPassageTimeZoneTestV3.java314
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV2.java20
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV3.java314
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV3.java170
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV3.java155
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestComplexTicketV3.java413
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV3.java158
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV3.java147
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassComplexTicketV3.java431
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV3.java168
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV3.java202
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV3.java184
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV3.java141
146 files changed, 34714 insertions, 4298 deletions
diff --git a/misc/uicBarcodeHeader_v1.0.0.asn b/misc/uicBarcodeHeader_v1.0.0.asn
new file mode 100644
index 0000000..52f2d45
--- /dev/null
+++ b/misc/uicBarcodeHeader_v1.0.0.asn
@@ -0,0 +1,119 @@
+-- Author: ClemensGantert
+-- Created: Thu Jun 04 17:19:28 CEST 2020
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- ##############################################################################################
+-- #
+-- # UIC barcode header - version 1.0.0
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- #
+-- # - A bar code which is only static (printed on a paper), and for which the security is in the system, doesn’t need any of these elements.
+-- # - A bar code which is only static, and includes its own security, needs:
+-- # level1Signature
+-- # level1KeyAlg if the associated key does not include the complete certificate in keys.xml but only the public key
+-- # (but level1SigningAlg is not necessary as it is in keys.xml)
+-- # - A dynamic bar code including static and dynamic signatures needs:
+-- # The same elements as a static bar code above,
+-- # level2SigningAlg, level2keyAlg, level2PublicKey, and level2Signature.
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- ##########################################################################################
+ UicBarcodeHeader ::= SEQUENCE {
+ -- barcode format type
+ format IA5String,
+ -- "U1" = UIC ticket
+
+
+ level2SignedData Level2DataType,
+
+ -- signature is calculated on the PER unaligned encoding of level2 signature data
+ level2Signature OCTET STRING OPTIONAL
+
+
+ }
+
+ Level2DataType ::= SEQUENCE {
+
+ level1Data Level1DataType,
+
+ -- signature is calculated on the PER unaligned encoding of level1 signature data
+ level1Signature OCTET STRING OPTIONAL,
+
+ level2Data DataType OPTIONAL
+
+ }
+
+
+ Level1DataType ::= SEQUENCE {
+
+ -- provider of the level1 signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ keyId INTEGER(0..99999) OPTIONAL,
+
+ dataSequence SEQUENCE OF DataType,
+
+
+ -- object identifier of the key algorithms
+ -- e.g.
+ -- ECC P-256 1.2.840.10045.3.1.7
+ level1KeyAlg OBJECT IDENTIFIER OPTIONAL,
+ level2KeyAlg OBJECT IDENTIFIER OPTIONAL,
+
+ -- object identifier of the signing algorithm
+ -- e.g.
+ -- DSA SHA224 2.16.840.1.101.3.4.3.1
+ -- DSA SHA256 2.16.840.1.101.3.4.3.2
+ -- ECDSA-256 1.2.840.10045.4.3.2
+ -- algorithm used for signing
+ level1SigningAlg OBJECT IDENTIFIER OPTIONAL,
+ level2SigningAlg OBJECT IDENTIFIER OPTIONAL,
+
+ level2PublicKey OCTET STRING OPTIONAL
+
+ }
+
+ DataType ::= SEQUENCE {
+ -- Content of data format:
+ -- FCBn (FCB1 = FCB version 1, FCB2 = FCB version 2)
+ -- FDCn dynamic content
+ -- or proprietary:
+ -- _RICS company code + addon
+ dataFormat IA5String,
+ data OCTET STRING
+ }
+
+
+END \ No newline at end of file
diff --git a/misc/dynamicContentFDCv1.0.asn b/misc/uicDynamicContentData_v1.0.0.asn
index 693980f..e93f260 100644
--- a/misc/dynamicContentFDCv1.0.asn
+++ b/misc/uicDynamicContentData_v1.0.0.asn
@@ -1,9 +1,10 @@
-- ##########################################################################################
-- #
--- # FCB Dynamic Content - Version 1.0 - Draft #3 (2021-05-12)
+-- # FCB Dynamic Content - Version 1.0 (2021-05-12)
-- #
--- # This file is available on the UIC FCB User Group GitHub:
--- # <GitHub-link-to-be-added-here>
+-- # This file is available on the UIC FCB User Group GitHub:
+-- # https://github.com/UnionInternationalCheminsdeFer/UIC-barcode
+-- #
-- # Please check this link to see if a more recent version of this file is available.
-- #
-- # The type UicDynamicContentData defined below is at least intended to generate a data
@@ -12,6 +13,14 @@
-- # and identified as "FDC1" in UicBarcodeHeader.level2SignedData.level2Data.dataFormat.
-- #
-- ##########################################################################################
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Mon Jun 28 14:14:28 CEST 2021
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
UicDynamicContentData ::= SEQUENCE {
-- Identification of the mobile application that generated the barcode
@@ -112,4 +121,4 @@
extensionId IA5String,
extensionData OCTET STRING
}
- \ No newline at end of file
+END \ No newline at end of file
diff --git a/misc/uicBarcodeV1finalDelayConfirmation1.3.asn b/misc/uicRailTicketData_v1.3.0.asn
index 6b79451..e2fb386 100644
--- a/misc/uicBarcodeV1finalDelayConfirmation1.3.asn
+++ b/misc/uicRailTicketData_v1.3.0.asn
@@ -1,2047 +1,2047 @@
--- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
--- Author: ClemensGantert
--- Created: Tue Aug 11 11:40:28 CEST 2015
-ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
-
--- imports and exports
--- EXPORTS ALL;
-
-
--- ##############################################################################################
--- #
--- # Final version 1.3 - value 13 in the UIC bar code version element
--- # (see element 2 in U_FLEX record definition in leaflet 918.9)
--- #
--- ##############################################################################################
-
-
--- ##############################################################################################
--- #
--- # Naming and encoding conventions
--- #
--- # Elements included as String and as Numeric values:
--- # Some elements are included in different formats to reduce the data size.
--- # These elements must be included only once.
--- # These elements are named with the same name and appendix
--- # Num (numeric values)
--- # IA5 (String values according to ASN IA5String (7Bit))
--- # Example:
--- # trainNum - in case of a numeric train number
--- # trainIA5 - in case of a alphanumeric train Id
--- #
--- #
--- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
--- # other codes are possible based on bilateral agreements
--- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
--- #
--- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
--- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
--- # special character (IA5String)
--- #
--- #
--- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
--- # ! they are unrestricted!!!
--- # !
--- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
--- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
--- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
--- # ! Please ensure to use a tool capable of dealing with larger numbers.
--- #
--- # BOOLEAN is always non optional
--- #
--- # Encoding of time:
--- # time is encoded as the number of minutes of the day 0 = 00:00, 1440 = 24:00,
--- # time data elements end with "time" in their name
--- #
--- # Encoding of date:
--- # .........................................................................................................
--- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
--- #
--- # For local dates the date is associated with the corresponding location:
--- # e.g.:
--- # valid from date -> location where the journey starts
--- # valid until date -> location where the journey covered by the ticket ends
--- #
--- # there could be rare cases where this is does not rovide a unique interpretation:
--- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
--- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
--- # ticket a few hours after the end of validity).
--- #
--- # If these date values are given as the number of days from the issuing date the following rule applies:
--- #
--- # The difference in days is calculated by ignoring the time zone information in the case no time zone offset is provided.
--- #
--- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
--- # issuing date (UTC): 31.12.2017 23:05
--- # local date (CET): 01.01.2018 00:05
--- # -> difference in days = 1
--- #
--- # example 1: (1.1.2018 22:05 UTC == 01.01.2018 23:05 CET) :
--- # issuing date (UTC): 31.12.2017 22:05
--- # local date (CET): 01.01.2018 23:05
--- # -> difference in days = 0
--- #
--- # the day difference could become -1 although this can happen for locations in America or New Zeeland only.
--- #
--- # implementation example:
--- #
--- # public static Long getDateDifference(Date issuingDate, Date localDate) {
--- #
--- # if (issuingDate == null || localDate == null) return null;
--- #
--- # Calendar issuingCal = Calendar.getInstance();
--- # issuingCal.clear();
--- # issuingCal.setTime(issuingDate);
--- # issuingCal.setTimeZone(TimeZone.getTimeZone("UTC"));
--- # issuingCal.set(Calendar.HOUR_OF_DAY, 0);
--- # issuingCal.set(Calendar.MINUTE, 0);
--- # issuingCal.set(Calendar.SECOND, 0);
--- # issuingCal.set(Calendar.MILLISECOND, 0);
--- # Date start = startCal.getTime();
--- #
--- # Calendar fromCal = Calendar.getInstance();
--- # fromCal.clear();
--- # fromCal.setTime(localDate);
--- # fromCal.setTimeZone(TimeZone.getTimeZone("UTC"));
--- # fromCal.set(Calendar.HOUR_OF_DAY, 0);
--- # fromCal.set(Calendar.MINUTE, 0);
--- # fromCal.set(Calendar.SECOND, 0);
--- # fromCal.set(Calendar.MILLISECOND, 0);
--- # Date end = endCal.getTime();
--- #
--- # long diff = TimeUnit.DAYS.convert(end.getTime() - start.getTime(), TimeUnit.MILLISECONDS );
--- #
--- # return new Long(diff);
--- #
--- # }
--- #
--- # public static Date getLocalDateFromDifference(Date issuingDate, int diff , Long time ) {
--- #
--- # if (issuingDate == null) return null;
--- #
--- # Calendar cal = Calendar.getInstance();
--- # cal.clear();
--- # cal.setTime(issuingDate);
--- # cal.add(Calendar.DAY_OF_YEAR, diff);
--- #
--- # if (time != null) {
--- # int hours = time.intValue() / 60;
--- # int minutes = time.intValue() - hours * 60;
--- # cal.set(Calendar.HOUR_OF_DAY, hours);
--- # cal.set(Calendar.MINUTE,minutes);
--- # }
--- #
--- # return cal.getTime();
--- #
--- # }
--- #
--- #
--- # ASN.1 Extensions:
--- #
--- # The specification makes use of extension (",...").
--- # These extesions might be defined in future versions of the UIC specification
--- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
--- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
--- #
--- # Bilateral Extensions:
--- # Bilateral extensions can be included in the data element "ExtensionData".
--- #
--- #
--- #
--- #########################################################################################
-
-
--- ############################################################################################
-
-
--- type assignments
-
- -- #########################################################################################
- -- the basic entry point of the data structure
- -- the data include:
- -- -issuer informations
- -- -the details of the transport document
- -- -informations required for the control process
- -- -informations on the travelers independent from the transport document
- -- -proprietary extensions
- --
- -- ##########################################################################################
- UicRailTicketData ::= SEQUENCE {
- -- data specific to the issuer
- issuingDetail IssuingData,
-
- -- data on the travelers
- travelerDetail TravelerData OPTIONAL,
-
- -- data of the transport document
- --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
- transportDocument SEQUENCE OF DocumentData OPTIONAL,
-
- -- data specific to support the ticket control process
- controlDetail ControlData OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension SEQUENCE OF ExtensionData OPTIONAL
- ,...
- }
-
-
-
- -- ###########################################################################################
- -- the choice on the different transport documents that can be included in the bar code data:
- -- - reservation of seat / couchette or berths (IRT, RES, BOA)
- -- - reservation of car carriage (VET)
- -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
- -- - Rail passes (including Eurail, Interail and local passes) (RPT)
- -- - Voucher (TRV)
- -- - Customer Cards (including bonus cards and reduction cards)
- -- - counter marks issued for group tickets
- -- - parking ground tickets
- -- - FIP tickets
- -- - station access / station passage tickets
- -- - proprietary documents as an extension
- -- ############################################################################################
- DocumentData ::= SEQUENCE {
-
- -- token
- -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
- token TokenType OPTIONAL,
-
- -- choice of the ticket
- ticket CHOICE
- {
-
- -- Reservation (without car carriage) (IRT and RES)
- reservation ReservationData,
-
- -- Reservation of car carriage
- carCarriageReservation CarCarriageReservationData,
-
- -- open ticket specification (NRT)
- openTicket OpenTicketData,
-
- -- pass specification (RPT) including Eurail and Interrail
- pass PassData,
-
- -- voucher
- voucher VoucherData,
-
- -- customer card either to identify a customer and / or to provide reductions
- customerCard CustomerCardData,
-
- -- countermark to accompagny a group ticket
- counterMark CountermarkData,
-
- -- car parking slot
- parkingGround ParkingGroundData,
-
- -- FIP duty ticket
- fipTicket FIPTicketData,
-
- -- ticket to pass the gates at a station
- stationPassage StationPassageData,
-
- -- proprietary data defined bilaterally
- extension ExtensionData,
-
- -- delay confirmation
- delayConfirmation DelayConfirmation
-
- ,...
- }
- ,...
- }
-
- -- ########################################################################################
- -- confirmation of the delay of a train
- --
- -- ########################################################################################
- DelayConfirmation ::= SEQUENCE {
-
- -- reference of the delay confirmation
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- train number of the delayed train - numeric or alphanumeric
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- departure date of the delayed train in local time
- -- number of year
- departureYear INTEGER (2016..2269) OPTIONAL,
- -- number of the day in the year (1.1. = 1)
- departureDay INTEGER (1..366) OPTIONAL,
- departureTime INTEGER (0..1440) OPTIONAL,
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- station where the delay became relevant
- stationCodeTable CodeTableType DEFAULT stationUIC,
- stationNum INTEGER (1..9999999) OPTIONAL,
- stationIA5 IA5String OPTIONAL,
-
- -- delay in minutes at the mentioned station
- delay INTEGER (1..999),
-
- -- indication that the train was cancelled
- trainCancelled BOOLEAN,
-
- -- type of confirmation provided
- confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
-
- -- affected original ticket(s)
- affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
-
- -- info text
- infoText UTF8String OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL
- ,...
- }
-
- ConfirmationType ::= ENUMERATED {
- trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
- travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
- trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
- ,...
- }
-
-
- -- ########################################################################################
- -- Details of the issuer and the issue of the ticket
- -- - details on the issuer
- -- - indication of test tickets (specimen)
- -- - payment details: method of payment, currency
- -- - proprietary PNR of the issuer to be used to identify the sale within
- -- the issuers ecosystem
- -- - web link to display more information for the customer
- -- - proprietary extension data
- -- ########################################################################################
- IssuingData ::= SEQUENCE {
-
- -- provider of the signature (RICS code)
- securityProviderNum INTEGER (1..32000) OPTIONAL,
- securityProviderIA5 IA5String OPTIONAL,
-
- -- issuer of the transport document if the issuer is different from the security provider
- -- (RICS code)
- issuerNum INTEGER (1..32000) OPTIONAL,
- issuerIA5 IA5String OPTIONAL,
-
- -- issuing time stamp in UTC
- -- number of year
- issuingYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- issuingDay INTEGER (1..366),
- -- The number of the minutes of issue might be used in case of account
- -- based ticketing whith a delay of n minutes for the replication of central
- -- booking data to the control devices (e.g. at SBB)
- -- The time can be compared with the last synchronization time of
- -- the control device
- issuingTime INTEGER (0..1440) OPTIONAL,
-
- -- name of the issuer (E.g. short name mentioned in RICS code table)
- issuerName UTF8String OPTIONAL,
-
- -- specimen indicates a test specimen not valid for travelling
- specimen BOOLEAN,
-
- -- secure paper indicates that this barcode is issued with a secure paper ticket
- -- to ensure the uniqueness of the ticket. This allows to use the same control
- -- procedure as for e-tickets also for anonymous tickets
- -- the double use of the ticket is in this case excluded by the secure paper
- securePaperTicket BOOLEAN,
-
- -- indicates that the ticket is valid for traveling or still needs activation
- activated BOOLEAN,
-
- -- currency of the price: ISO4217 currency codes
- currency IA5String (SIZE(3)) DEFAULT "EUR",
-
- -- fraction of the prices included
- currencyFract INTEGER (1..3) DEFAULT 2,
-
- -- PNR used by the issuer to identify the document
- issuerPNR IA5String OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL,
-
- -- location of sale in case of a sale on board of a train
- -- numeric train number or aphanumeric id of the train where the ticket was sold
- issuedOnTrainNum INTEGER OPTIONAL,
- issuedOnTrainIA5 IA5String OPTIONAL,
- -- line number
- issuedOnLine INTEGER OPTIONAL,
-
- -- point of sale
- pointOfSale GeoCoordinateType OPTIONAL
- ,...
- }
-
- -- ###################################################################################
- -- data supporting the control process
- -- - list of items which the travelder can use to identify himself or the unique
- -- usage of the ticket
- -- (card ids, parts or identity card numbers, credit card numbers,..)
- -- - hints on the validation to be made on board
- --
- -- ###################################################################################
- ControlData ::= SEQUENCE {
-
- -- cards that can be used to identify the ticket holder
- identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
-
- -- idcard id must be checked to identify the traveler
- identificationByIdCard BOOLEAN,
-
- -- passport id must be checked to identify the traveler
- identificationByPassportId BOOLEAN,
-
- -- other items which could be used to identify the ticket holder
- -- (for future use, code list to be defined)
- identificationItem INTEGER OPTIONAL,
-
- -- validation of the passport is required (e.g. in case of Eurail)
- passportValidationRequired BOOLEAN,
-
- -- online validation of the ticket required
- onlineValidationRequired BOOLEAN,
-
- -- percentage of the tickets to be validated in more detail
- -- (i.e. via online check or detailed checks lateron)
- randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
-
- -- manual validation of the traveler age required (in case of reductions)
- ageCheckRequired BOOLEAN,
-
- -- manual validation of the travelers reduction card required (in case of reductions)
- reductionCardCheckRequired BOOLEAN,
-
- -- controler info text
- infoText UTF8String OPTIONAL,
-
- -- additional tickets that should be controlled
- includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ################################################################################
- -- Traveler data
- -- these data do not include tariff details of the booked tariffs,
- -- tariff data are included in the transport document details and might
- -- have a reference to the traveler defined here.
- -- - personal data of the travellers
- -- - the index of the list can be used to identify the
- -- traveler within other contexts (e.g. in assigned tariffs)
- -- ################################################################################
- TravelerData ::= SEQUENCE {
- -- traveler list
- traveler SEQUENCE OF TravelerType OPTIONAL,
-
- -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
- preferredLanguage IA5String (SIZE(2)) OPTIONAL,
-
- -- name of the group in case of a group ticket
- groupName UTF8String OPTIONAL
- ,...
- }
-
- -- ####################################################################################
- -- the following part contains the different transport document specifications
- -- ####################################################################################
-
-
- -- ####################################################################################
- -- reservations of seats , couchettes and berths
- -- included are the data defined in:
- -- - leaflet 918.1 for reservation data exchange
- -- - a few additional data currently used by some railways via different interfaces
- -- - information on trach an dplafoorm where the coach stops
- -- - additional second coach for large groups
- -- ####################################################################################
- ReservationData ::= SEQUENCE {
-
- -- train number - numeric or alphanumeric
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- departure date in local time
- -- number of the days calculated from the issuing date
- departureDate INTEGER (-1..370) DEFAULT 0,
-
-
- -- reservation reference according ton 918.1 in case ade via Hermes
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code to be used as standard)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- serviceBrand INTEGER (0..32000) OPTIONAL,
- serviceBrandAbrUTF8 UTF8String OPTIONAL,
- serviceBrandNameUTF8 UTF8String OPTIONAL,
-
- -- service code list from 918.1 (seat couchette,..)
- service ServiceType DEFAULT seat,
-
- -- code table used to encode stations
- stationCodeTable CodeTableType DEFAULT stationUICReservation,
-
- -- origin station code
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- -- destination station code
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- -- origin station name
- fromStationNameUTF8 UTF8String OPTIONAL,
-
- -- destination station name
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- departure time
- departureTime INTEGER (0..1440),
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- arrival date and time in local time
- -- number of days counted from the departure date
- -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
- arrivalDate INTEGER (0..20) DEFAULT 0,
- arrivalTime INTEGER (0..1440) OPTIONAL,
- arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omitted in case it is the same as for depature
-
- -- responsible carriers on the route
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- travel class
- classCode TravelClassType DEFAULT second,
-
- -- service level code list from 918.1
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- places
- places PlacesType OPTIONAL,
-
- -- additional places in a second coach
- additionalPlaces PlacesType OPTIONAL,
-
- --bicycle places
- bicyclePlaces PlacesType OPTIONAL,
-
- -- compartment details (open space, wheelchair,..)
- compartmentDetails CompartmentDetailsType OPTIONAL,
-
- -- number of persons on the ticket without place numbers (on IRT)
- numberOfOverbooked INTEGER (0..200) DEFAULT 0,
-
- -- description of berths
- berth SEQUENCE OF BerthDetailData OPTIONAL,
-
- -- tariffs included (Adult, Children,... )
- tariff SEQUENCE OF TariffType OPTIONAL,
-
- -- type of the price (supplement,... )
- priceType PriceTypeType DEFAULT travelPrice,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- -- type of supplement - code list from 018.1
- typeOfSupplement INTEGER (0..9) DEFAULT 0,
-
- numberOfSupplements INTEGER (0..200) DEFAULT 0,
-
- -- luggage restrictions and registered luggage
- -- in case the luggage restrictions are general and do not depend on the
- -- ticket type they should not be included
- luggage LuggageRestrictionType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
-
- -- bilaterally agreed proprietary extension
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #################################################################################
- -- details on the VAT included to be used in after sale processes
- -- #################################################################################
- VatDetailType ::= SEQUENCE {
-
- -- ISO 3166 numeric country code
- country INTEGER (1..999),
-
- -- 1/10th of a percent
- percentage INTEGER (0..999),
-
- -- amount of VAT, the currency and the currency fraction is included in the issuing data
- amount INTEGER OPTIONAL,
-
- -- european tax id of the company paying VAT
- vatId IA5String OPTIONAL
-
- }
-
-
- -- #################################################################################
- -- reservations of car carriage
- -- included are the data defined in:
- -- - leaflet 918.1 for reservation data exchange
- -- - a few additional data currently used by some railways via different interfaces
- -- #################################################################################
- CarCarriageReservationData ::= SEQUENCE {
-
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
-
- -- loading / unloading of the car in local date and time
- -- number of the days calculated from the issuing date
- beginLoadingDate INTEGER (-1..370) DEFAULT 0,
- beginLoadingTime INTEGER (0..1440) OPTIONAL,
- endLoadingTime INTEGER (0..1440) OPTIONAL,
- loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- reservation reference according on 918.1 in case ade via Hermes
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- serviceBrand INTEGER (1..32000) OPTIONAL,
- serviceBrandAbrUTF8 UTF8String OPTIONAL,
- serviceBrandNameUTF8 UTF8String OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUICReservation,
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- coach IA5String OPTIONAL,
- place IA5String OPTIONAL,
-
- compartmentDetails CompartmentDetailsType OPTIONAL,
-
- -- description of the car
- numberPlate IA5String,
- trailerPlate IA5String OPTIONAL,
- carCategory INTEGER (0..9),
- boatCategory INTEGER (0..6) OPTIONAL,
- textileRoof BOOLEAN,
- roofRackType RoofRackType DEFAULT norack,
-
- -- heigth of a roof rack in cm
- roofRackHeight INTEGER (0..99) OPTIONAL,
-
- -- number of boats on a rack
- attachedBoats INTEGER (0..2) OPTIONAL,
-
- -- number of biycles on a rack
- attachedBicycles INTEGER (0..4) OPTIONAL,
-
- -- number of surf boards on a rack
- attachedSurfboards INTEGER (0..5) OPTIONAL,
-
- -- reference to an entry on the loading list
- loadingListEntry INTEGER (0..999) OPTIONAL,
- loadingDeck LoadingDeckType DEFAULT upper,
-
- -- responsible carriers on the route (RICS codes)
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- tariff TariffType,
- priceType PriceTypeType DEFAULT travelPrice,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
- -- #####################################################################################
- -- data for open tickets (NRT and group tickets)
- -- included are the data defined in:
- -- - the ticket layout (leaflet 918.8)
- -- - the ticket bar code version 3 (leaflet 918.9)
- -- - additional data based on 108.1 with some extensions as 108.1
- -- does not provide well structured data,
- -- especially concerning regional validity
- --
- -- #####################################################################################
-
- OpenTicketData ::= SEQUENCE {
-
- -- reference must be given either in numeric or alphanumeric format
- referenceNum INTEGER OPTIONAL,
- referenceIA5 IA5String OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
- -- issuer code using the default code table of the product owner
- extIssuerId INTEGER OPTIONAL,
- -- authorization id provided to the issuer by the product owner
- issuerAutorizationId INTEGER OPTIONAL,
-
- -- ticket includes the return trip
- returnIncluded BOOLEAN,
-
- -- for tickets valid in regions without from or to stations no station is provided
- stationCodeTable CodeTableType DEFAULT stationUIC,
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- -- for tickets valid in regions without from or to stations no station is provided
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validRegionDesc UTF8String OPTIONAL,
- -- specification of the ordered sequence of valid regions
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- -- return route description
- -- the return route description can be omitted if it is identical to the
- -- inversed outbound validRegion sequence
- returnDescription ReturnRouteDescriptionType OPTIONAL,
-
- -- temporal validity data in local time of the location where the jouney starts
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- number of days from valid-from date, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
- -- list of activated days in case the entire ticket is not activated
- -- the day is given by the number of days from the first day of validity
- -- 1 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- classCode TravelClassType DEFAULT second,
-
- -- servicelevel code according to leaflet 918.1 to encode other products
- -- (e.g. PREMIUM, ...)
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- carriers involved in the transport (RICS codes)
- -- the indication of carriers is mandatory on international routes,
- -- they can be listed here but can also be included in viaDetails
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
-
- -- list of service brands for which the ticket is valid
- -- in case the included service brands are listed all other brands are excluded
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- list of service brands for which the ticket is not valid
- -- service brand: code list https://uic.org/service-brand-code-list
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
- -- additional included open tickets
- -- e.g. to include local city traffic on parts of a the route
- includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
-
- -- in case the luggage restrictions are general and do not depend
- -- on the ticket type they should not be included
- luggage LuggageRestrictionType OPTIONAL,
-
-
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
-
- -- ####################################################################################
- -- data for passes
- -- included are the data defined in:
- -- - the ticket layout (leaflet 918.8)
- -- - the ticket bar code version 3 (leaflet 918.8)
- -- ####################################################################################
- PassData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceNum INTEGER OPTIONAL,
- referenceIA5 IA5String OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- type of the pass, code list provided by the product owner
- -- in case of Eurail:
- -- 1 = Interrail
- -- 2 = Eurail
- -- 3 = Eurail Global (all countries)
- passType INTEGER (1..250) OPTIONAL,
-
- -- literal name of the pass
- passDescription UTF8String OPTIONAL,
-
- classCode TravelClassType DEFAULT second,
-
- -- begin of validity (local time)
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- end of validity (local time)
- -- number of days from valid from day, 0 = valid on valid-from-date
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omitted in case it is the same as for depature
-
-
-
- -- additional validity periods and excluded time ranges
- validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
-
- -- max number of days of validity in case the valid from day is open
- numberOfValidityDays INTEGER (0..370) OPTIONAL,
-
- -- max number of possible trips to be activated
- numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
- numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
-
- -- list of activated days in case the entire ticket is not activated
- -- the day is given by the number of days from the first day of validity
- -- 0 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- -- included countries, code table according to UIC leaflet 918.9
- countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
-
- -- included carriers (RICS codes)
- includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- excluded carriers (RICS codes)
- excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- region description to cover local zones
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- ValidityPeriodDetailType ::= SEQUENCE {
- validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
- excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
- }
-
- ValidityPeriodType ::= SEQUENCE {
- -- number of days from issuing date (local date)
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- number of days from valid from day, 0 = valid on valid from date
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
- }
-
- TimeRangeType ::= SEQUENCE {
- fromTime INTEGER (0..1440),
- untilTime INTEGER (0..1440)
- }
-
- -- ######################################################################################
- -- data for vouchers
- -- included are quite basic further study is required
- -- ######################################################################################
- VoucherData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- begin of validity in UTC
- -- number of year
- validFromYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- validFromDay INTEGER (0..370),
- -- end of validity
- -- number of year
- validUntilYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- validUntilDay INTEGER (0..370),
-
- value INTEGER DEFAULT 0,
-
- -- type of the voucher, code list defined by the product owner
- type INTEGER (1..32000) OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
- -- ###################################################################################
- -- data for FIP tickets
- -- included are data from the FIP ticket layout,
- -- ###################################################################################
- FIPTicketData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- first day of validity in UTC
- --- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- -- last day of validity
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
-
- -- activated days: list of days for which the ticket is valid
- -- the day is given by the number of days from the first day of validity
- -- 0 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- -- included carriers
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- number of travel days allowed
- numberOfTravelDays INTEGER (1..200),
- includesSupplements BOOLEAN,
-
- -- travel class
- classCode TravelClassType DEFAULT second,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #####################################################################################
- -- data station passage and access
- -- ticket used to enter, exit or pass a station without travelling by train.
- -- E.g. for staff working in a station.
- -- #####################################################################################
- StationPassageData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- productName UTF8String OPTIONAL,
-
- -- code table used to encode he stations
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- list of station where the passage is allowed
- stationNum SEQUENCE OF INTEGER OPTIONAL,
- stationIA5 SEQUENCE OF IA5String OPTIONAL,
- -- station names
- stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
-
- -- list of areas in a station where the access is allowed
- areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
- areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
- -- area names
- areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
-
- -- begin of validity in local date and time
- -- number of days from issuing date
- validFromDay INTEGER (-1..700),
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- end of validity
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- -- number of days for station passage in case the number of days
- -- is limited and less that the validity period
- numberOfDaysValid INTEGER OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- data for customer cards
- -- included are data from:
- -- - �BB requirements on card data
- -- - DB Bahncard as HandyTicket
- -- note: customer data are included in the traveler data structure
- -- ######################################################################################
- CustomerCardData ::= SEQUENCE {
-
- -- customer details
- -- optional, as there might be an anonymous cards
- customer TravelerType OPTIONAL,
-
- -- card id might be numerical or alphanumerical
- cardIdIA5 IA5String OPTIONAL,
- cardIdNum INTEGER OPTIONAL,
-
- -- valid from date in UTC
- -- number of year
- validFromYear INTEGER (2016..2269),
- --- number of the day in the year (1.1. = 1)
- validFromDay INTEGER (0..370) OPTIONAL,
-
- --- number of year from valid from year onwards
- validUntilYear INTEGER (0..250) DEFAULT 0,
- --- number of the day in the year (1.1. = 1)
- validUntilDay INTEGER (0..370) OPTIONAL,
-
- classCode TravelClassType OPTIONAL,
-
- -- code of the card type code list defined by the issuer
- cardType INTEGER (1..1000) OPTIONAL,
-
- -- readable description of the card type
- cardTypeDescr UTF8String OPTIONAL,
-
- -- customer status code
- -- 1 = basic
- -- 2 = premium
- -- 3 = silver
- -- 4 = gold
- -- 5 = platinum
- -- 6 = senator
- -- > 50 - code table of the card issuer
- customerStatus INTEGER OPTIONAL,
-
- -- readable customer status "e.g. gold",
- customerStatusDescr IA5String OPTIONAL,
-
- -- list of included services,
- -- 1 = Rail Plus
- -- 2 = access to launch
- -- > 50 code list of the issuer
- includedServices SEQUENCE OF INTEGER OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- data for customer cards
- -- included are data from:
- -- - DB parking ground reservation
- -- #######################################################################################
- ParkingGroundData ::= SEQUENCE {
-
- -- booking reference
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- parkingGroundId IA5String,
-
- -- parking date in local date time
- -- number of days from the issuing date
- fromParkingDate INTEGER (-1..370),
- -- number of days from the from parking date in case it is different from that date
- untilParkingDate INTEGER (0..370) DEFAULT 0,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- code needed to access the parking lot
- accessCode IA5String OPTIONAL,
-
- location UTF8String,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- in case the parking ground is associated with a station
- stationNum INTEGER OPTIONAL,
- stationIA5 UTF8String OPTIONAL,
-
- specialInformation UTF8String OPTIONAL,
- entryTrack UTF8String OPTIONAL,
- numberPlate IA5String OPTIONAL,
-
- price INTEGER OPTIONAL,
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #######################################################################
- -- data for countermarks issued with group tickets
- -- included are data from:
- -- - version 3 bar code (leaflet 918.9)
- -- - printed layout (leaflet 918.8)
- -- ########################################################################
- CountermarkData ::= SEQUENCE {
-
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- reference of the group ticket
- ticketReferenceIA5 IA5String OPTIONAL,
- ticketReferenceNum INTEGER OPTIONAL,
-
- -- sequential number of the countermark
- numberOfCountermark INTEGER (1..200),
- -- total number of countermarks
- totalOfCountermarks INTEGER (1..200),
- -- name of the group
- groupName UTF8String,
-
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validRegionDesc UTF8String OPTIONAL,
- -- specification of the ordered sequence of valid regions
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
-
- -- ticket includes the return trip
- returnIncluded BOOLEAN,
- -- retrurn route description
- -- can be omitted if it is identical to the inversed outbound validRegion sequence
- returnDescription ReturnRouteDescriptionType OPTIONAL,
-
- -- local date
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
-
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- classCode TravelClassType DEFAULT second,
-
- -- valid carriers
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brands where the ticket is valid
- -- in case this list is provided the ticket is invalid on all other service brands
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- service brands where the ticket is not valid
- -- in case this list is provided the ticket is valid on all other service brands
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
- -- ###########################################################################################
- -- generic non standard extension element
- -- the generic non - standard element contains:
- -- - an extension id to distinguish different extensions
- -- - the extension data as binary data
- -- proprietary extensions are by definition proprietary. This standard provides
- -- the means to identify these extensions
- -- within the data and to skip these data.
- -- the evaluation of these data and the unique identification of the extensions
- -- via the extension id is in the
- -- responsibility of the railways which use these extensions.
- -- ###########################################################################################
- ExtensionData ::= SEQUENCE {
- extensionId IA5String,
- extensionData OCTET STRING
- }
-
- -- ############################################################################################
- -- type definitions
- -- ############################################################################################
-
- -- #############################################################################################
- -- included open ticke for a part of the travel (e.g. local city trafic)
- -- - data identically already included in the covering open ticket do not need to be
- -- repeated here
- -- - main source are the data required for included regional and city traffic tickets
- -- #############################################################################################
- IncludedOpenTicketType ::= SEQUENCE {
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- issuer code using the default code table of the product owner (today used e.g. by VDV)
- externalIssuerId INTEGER OPTIONAL,
- -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
- issuerAutorizationId INTEGER OPTIONAL,
-
- -- regional validity data
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- specification of the ordered sequence of valid regions, ordered in the direction of travel
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- -- temporal validity data in local date and time
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- number of days from valid-from date, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- -- travel class to be given in case it differs from the class of the main ticket
- classCode TravelClassType OPTIONAL,
- -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
- -- to be provided in case it differs from the main ticket
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- valid carriers (RICS codes)
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brands where the ticket is valid
- -- in case this list is provided the ticket is invalid on all other service brands
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- service brands where the ticket is not valid
- -- in case this list is provided the ticket is valid on all other service brands
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- tariff data for open tickets
- -- information included are:
- -- - number of passengers
- -- - optionally a link to the traveler data
- -- #######################################################################################
- TariffType ::= SEQUENCE {
-
- -- number of passengers using the tariff
- numberOfPassengers INTEGER (1..200) DEFAULT 1,
-
- -- type indication youth, adult, senior,..
- passengerType PassengerType OPTIONAL,
-
- -- age restrictions of the tariff
- ageBelow INTEGER (1..64) OPTIONAL,
- ageAbove INTEGER (1..128) OPTIONAL,
-
-
- -- named traveler list
- -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
- -- the number indicates the position in the traveler list starting from 1
- travelerid SEQUENCE OF INTEGER (0..254) OPTIONAL,
-
- -- restriction on country of residence
- -- this tariff is restricted by the country of residence given in the traveler data
- -- (e.g. Eurail tickets are not valid in the contry of residence)
- restrictedToCountryOfResidence BOOLEAN,
-
- -- section in case the tariff applies to a part of the route only
- restrictedToRouteSection RouteSectionType OPTIONAL,
-
- -- details on series according to lesaflet 108.1
- seriesDataDetails SeriesDetailType OPTIONAL,
-
- -- tariff code
- tariffIdNum INTEGER OPTIONAL,
- tariffIdIA5 IA5String OPTIONAL,
-
- -- tariff description
- tariffDesc UTF8String OPTIONAL,
-
- -- reduction cards applied (incl. dicount cards, loaylty cards relevant for the tariff)
- reductionCard SEQUENCE OF CardReferenceType OPTIONAL
- ,...
- }
-
- SeriesDetailType ::= SEQUENCE {
-
- -- data related to tariffs based on series according UIC leaflet 108.1
- -- supplying carrier according to UIC leaflet 108.1 (RICS code)
- supplyingCarrier INTEGER (1..32000) OPTIONAL,
-
- -- offer identifier of the carrier according to UIC leaflet 108.1
- offerIdentification INTEGER (1..99) OPTIONAL,
-
- -- series of the carrier according to UIC leaflet 108.1
- series INTEGER OPTIONAL
- }
-
-
- RouteSectionType ::= SEQUENCE {
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL
- }
-
-
- -- #######################################################################################
- -- customer card reference
- -- #######################################################################################
- CardReferenceType ::= SEQUENCE {
-
- -- issuer of the card
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- cardIssuerNum INTEGER (1..32000) OPTIONAL,
- cardIssuerIA5 IA5String OPTIONAL,
-
- cardIdNum INTEGER OPTIONAL,
- cardIdIA5 IA5String OPTIONAL,
-
- -- Name of the card e.g. "VISA-CARD"
- cardName UTF8String OPTIONAL,
-
- -- type of the card, code list defined by the issuer
- cardType INTEGER OPTIONAL,
-
- -- in case only the leading part of the card number is provided
- leadingCardIdNum INTEGER OPTIONAL,
- leadingCardIdIA5 IA5String OPTIONAL,
-
-
- -- in case only the trailing part of the card number is provided
- trailingCardIdNum INTEGER OPTIONAL,
- trailingCardIdIA5 IA5String OPTIONAL
-
- ,...
- }
-
- -- #######################################################################################
- -- traveler data
- -- - traveler data might contain all traveler details which are independent
- -- from the type of travel document
- -- e.g. it can include the date of birth as this is part of the traveler
- -- but not the indication "Senior" as this is tariff dependent
- --
- -- #######################################################################################
- TravelerType ::= SEQUENCE {
-
- firstName UTF8String OPTIONAL,
- secondName UTF8String OPTIONAL,
- lastName UTF8String OPTIONAL,
- idCard IA5String OPTIONAL,
- passportId IA5String OPTIONAL,
- title IA5String (SIZE(1..3)) OPTIONAL,
- gender GenderType OPTIONAL,
-
- -- customer id might be numerical or alphanumerical
- customerIdIA5 IA5String OPTIONAL,
- customerIdNum INTEGER OPTIONAL,
-
- -- date of birth
- -- number of year
- yearOfBirth INTEGER (1901..2155) OPTIONAL,
- -- number of the day in the year (1.1. = 1)
- dayOfBirth INTEGER (0..370) OPTIONAL,
-
- -- indicates the ticket holder/group leader in case of groups
- ticketHolder BOOLEAN,
-
- passengerType PassengerType OPTIONAL,
-
- passengerWithReducedMobility BOOLEAN OPTIONAL,
-
- -- country of residence (numeric ISO country code)
- -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
- countryOfResidence INTEGER (1..999) OPTIONAL,
-
- countryOfPassport INTEGER (1..999) OPTIONAL,
- countryOfIdCard INTEGER (1..999) OPTIONAL,
-
- status SEQUENCE OF CustomerStatusType OPTIONAL
- ,...
- }
-
- CustomerStatusType ::= SEQUENCE {
-
- -- compagny providing the status, default is the issuer
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- statusProviderNum INTEGER (1..32000) OPTIONAL,
- statusProviderIA5 IA5String OPTIONAL,
-
- -- customer status code
- -- 1 = basic
- -- 2 = premium
- -- 3 = silver
- -- 4 = gold
- -- 5 = platinum
- -- 6 = senator
- -- > 50 - code table of the card issuer
- customerStatus INTEGER OPTIONAL,
-
- -- customer status "gold"
- customerStatusDescr IA5String OPTIONAL
- }
-
-
- ReturnRouteDescriptionType ::= SEQUENCE {
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validReturnRegionDesc UTF8String OPTIONAL,
-
- -- specification of the ordered sequence of valid regions for the return trip
- validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
- ,...
-
- }
-
- -- ######################################################################################
- -- regional validity of an open ticket
- -- specification of the regional validity.
- -- ######################################################################################
-
- RegionalValidityType ::= CHOICE {
- trainLink TrainLinkType,
- viaStations ViaStationType,
- zones ZoneType,
- lines LineType,
- polygone PolygoneType
- ,...
- }
-
-
-
- -- #######################################################################################
- -- train link data
- -- includes a restriction of an open ticket valid only on a specific train
- -- and date on a part of the route
- -- #######################################################################################
- TrainLinkType ::= SEQUENCE {
-
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- local date at the station where the train link starts
- -- days from the issuing date onwards
- travelDate INTEGER (-1..370),
- departureTime INTEGER (0..1440), -- time in minutes
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL
-
- }
-
-
-
- -- ######################################################################################
- -- regional validity using a set of lines
- -- - based on data used in regional city trafic enviromnemnts
- -- ######################################################################################
- LineType ::= SEQUENCE {
-
- -- local service provider / carrier within the zone
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- carrierNum INTEGER (1..32000) OPTIONAL,
- carrierIA5 IA5String OPTIONAL,
-
- -- ids of the valid lines known by the local carriers in that zone
- lineId SEQUENCE OF INTEGER OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
-
- -- in case the zone must be entered via a specific station
- -- (e.g. local city trafic at the end of a journey
- -- starting from the main train station)
- entryStationNum INTEGER (1..9999999) OPTIONAL,
- entryStationIA5 IA5String OPTIONAL,
-
- -- in case the zone must be left via a specific station
- -- (e.g. local city trafic at the beginning of a journey
- -- terminating at the main train station)
- terminatingStationNum INTEGER (1..9999999) OPTIONAL,
- terminatingStationIA5 IA5String OPTIONAL,
-
- -- code of the local city in case the zone is part of regional city transport
- -- code list of the local carrier
- city INTEGER (1..9999999) OPTIONAL,
-
- -- binary encoding of zones, encoding speciofication provided by
- -- the local service provider
- binaryZoneId OCTET STRING OPTIONAL
- ,...
- }
-
-
- -- #################################################################################
- -- regional validity in a zone
- -- - based on data used in regional city trafic enviromnemnts
- -- #################################################################################
- ZoneType ::= SEQUENCE {
-
- -- local service provider / carrier within the zone
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- carrierNum INTEGER (1..32000) OPTIONAL,
- carrierIA5 IA5String OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- in case the zone must be entered via a specific station
- -- (e.g. local city trafic at the end of a journey starting
- -- from the main train station)
- entryStationNum INTEGER (1..9999999) OPTIONAL,
- entryStationIA5 IA5String OPTIONAL,
-
- -- in case the zone must be left via a specific station
- -- (e.g. local city trafic at the beginning of a journey
- -- terminating at the main train station)
- terminatingStationNum INTEGER (1..9999999) OPTIONAL,
- terminatingStationIA5 IA5String OPTIONAL,
-
- -- code of the local city in case the zone is part of regional
- -- city transport code list of the local carrier
- city INTEGER OPTIONAL,
-
- -- ids of the valid zones known by the local carriers in that zone
- zoneId SEQUENCE OF INTEGER OPTIONAL,
-
- -- binary encoding of zones, encoding specification provided by
- -- the local service provider
- binaryZoneId OCTET STRING OPTIONAL,
-
- -- EU NUTS code for a region
- nutsCode IA5String OPTIONAL
- ,...
- }
-
-
- -- ##################################################################################
- -- via station
- -- includes a description of of the route by via stations.
- -- Via stations follow the description in leaflet 108.1:
- -- via stations can e mandatory to pass (but there does not need to be a
- -- train stop at this stations): visible route description: "*station*"
- -- there can be a list of alternative routes:
- -- visible route description: "*(station1/station2)*"
- -- there can also be alternative routes:
- -- "*(station1*station2/station3*station4)*" although the
- -- definition in 108.2 is not very precice on this option
- -- ###################################################################################
- ViaStationType ::= SEQUENCE {
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- mandatory via station
- stationNum INTEGER (1..9999999) OPTIONAL,
- stationIA5 IA5String OPTIONAL,
-
- -- list of alternative routes, one of these has to be taken
- alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
-
- -- list of stations along the route
- route SEQUENCE OF ViaStationType OPTIONAL,
- border BOOLEAN,
-
- -- carrier responsible for the transport starting at this station (RICS-Code)
- -- in case the carrier is included here it might be omitted
- -- in the carrier list of the region data
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- the route id as series number as defined in 108.1 data
- seriesId INTEGER OPTIONAL,
-
- -- route id of the route code list defined by the carrier on that route
- routeId INTEGER OPTIONAL
- ,...
- }
-
-
- PolygoneType ::= SEQUENCE {
- firstEdge GeoCoordinateType,
- edges SEQUENCE OF DeltaCoordinates
- }
-
-
- -- ###########################################################################################
- -- TokenType provides an additional identifier
- -- known use cases
- -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
- -- ###########################################################################################
- TokenType ::= SEQUENCE {
- -- provider of the token
- tokenProviderNum INTEGER OPTIONAL,
- tokenProviderIA5 IA5String OPTIONAL,
-
- -- in case the provider has multiple tokens
- tokenSpecification IA5String OPTIONAL,
- token OCTET STRING
- }
-
- -- ###########################################################################################
- -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
- -- (requirement from Eurail)
- -- use cases
- -- - DB Alleo (open ticket + reservation)
- -- - reservation of trailer and car carriage and traveller reservation
- -- - link between open ticket and bicycle reservations or pass
- -- - open ticket and vouchers for meals
- -- ###########################################################################################
- TicketLinkType ::= SEQUENCE {
-
- -- data to reference the external ticket
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- issuerName UTF8String OPTIONAL, -- name of the issuer
-
- issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
- -- the issuer PNR
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- type of linked ticket
- ticketType TicketType DEFAULT openTicket,
-
- -- type of link
- linkMode LinkMode DEFAULT issuedTogether
- ,...
- }
-
- -- ############################################################################################
- -- code table used fort station codes
- -- defines the code table used e.g. to define station code
- -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
- -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
- -- ############################################################################################
-
- CodeTableType ::= ENUMERATED {
- -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
- stationUIC (0),
- -- standard UIC station code for reservation
- stationUICReservation (1),
- -- future standard ERA station code
- stationERA (2),
- -- local carrier code list
- -- e.g. in case of stations / stops of non-railways stops (city trafic)
- localCarrierStationCodeTable (3),
-
- -- non standard code to be used within the issuer eco system only
- -- not applicable for multi carrier travel documents
- -- or in case issuer and carrier are different
- proprietaryIssuerStationCodeTable (4)
-
- }
-
-
- ServiceType ::= ENUMERATED {
- seat (0),
- couchette (1),
- berth (2),
- carcarriage (3)
- }
-
-
- PassengerType ::= ENUMERATED {
- adult (0),
- senior (1),
- child (2),
- youth (3),
- dog (4),
- bicycle (5),
- freeAddonPassenger (6),
- freeAddonChild (7)
- ,...
- }
-
- TicketType ::= ENUMERATED {
- openTicket (0),
- pass (1),
- reservation (2),
- carCarriageReservation (3)
- ,...
- }
-
- LinkMode ::= ENUMERATED {
- issuedTogether (0),
- onlyValidInCombination (1)
- ,...
- }
-
-
- -- ####################################################################################
- -- place data corresponding to leaflet 918.1
- -- placeString = place number ranges in case of groups
- -- ####################################################################################
- PlacesType ::= SEQUENCE {
- coach IA5String OPTIONAL,
-
- -- printable place string ("15-18, 21, 22" )
- placeString IA5String OPTIONAL,
-
- -- printable place description
- placeDescription UTF8String OPTIONAL,
-
- -- individual places
- placeIA5 SEQUENCE OF IA5String OPTIONAL,
- placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
- }
-
- PriceTypeType ::= ENUMERATED {
- noPrice (0),
- reservationFee (1),
- supplement (2),
- travelPrice (3)
- }
-
- BerthTypeType ::= ENUMERATED {
- single (0),
- special (1),
- double (2),
- t2 (3),
- t3 (4),
- t4 (5)
- }
-
- CompartmentGenderType ::= ENUMERATED {
- unspecified (0),
- family (1),
- female (2),
- male (3),
- mixed (4)
- ,...
- }
-
- GenderType ::= ENUMERATED {
- unspecified (0),
- female (1),
- male (2),
- other (3)
- ,...
- }
-
- TravelClassType ::= ENUMERATED {
- notApplicable (0),
- first (1),
- second (2),
- tourist (3),
- comfort (4),
- premium (5),
- business (6),
- all (7)
- ,...
- }
-
- -- ########################################################################################
- -- sleeper compartment types corresponding to leaflet 918.1
- -- ########################################################################################
- BerthDetailData ::= SEQUENCE {
- berthType BerthTypeType,
- numberOfBerths INTEGER (1..999),
- gender CompartmentGenderType DEFAULT family
- ,...
- }
-
- -- ####################################################################################
- -- compartment details corresponding to leaflet 918.1
- -- ####################################################################################
- CompartmentDetailsType ::= SEQUENCE {
- coachType INTEGER (1..99) OPTIONAL,
- compartmentType INTEGER (1..99) OPTIONAL,
- specialAllocation INTEGER (1..99) OPTIONAL,
- coachTypeDescr UTF8String OPTIONAL,
- compartmentTypeDescr UTF8String OPTIONAL,
- specialAllocationDescr UTF8String OPTIONAL,
- position CompartmentPositionType DEFAULT unspecified
- ,...
- }
-
-
- -- #####################################################################################
- -- luggage restrictions
- -- the basis for these data is week:
- -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
- -- a definition of hand luggaage
- -- SCIC referes to special conditions on registered lluggage, but SCIC NRT does
- -- not contain definitions on that and UIC 108.1 does not
- -- contain data structures for luggage
- -- - current THALYS luggage resrictions
- -- #####################################################################################
- LuggageRestrictionType ::= SEQUENCE {
- -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
- maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
- -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
- maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
- registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
- ,...
-
- }
-
- RegisteredLuggageType ::= SEQUENCE {
- -- id of the additional registered luggage
- registrationId IA5String OPTIONAL,
- -- maximum weight in kg
- maxWeight INTEGER (1..99) OPTIONAL,
- -- sum of length with and height in cm
- maxSize INTEGER (1..300) OPTIONAL
- ,...
-
- }
-
- -- ##########################################################################################
- -- generic type for geo coordinates
- -- ##########################################################################################
- GeoCoordinateType ::= SEQUENCE {
- geoUnit GeoUnitType DEFAULT milliDegree,
- coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
- -- separate hemishpere flag reduces the data size
- hemisphereLongitude HemisphereLongitudeType DEFAULT north,
- -- separate hemishpere flag reduces the data size
- hemisphereLatitude HemisphereLatitudeType DEFAULT east,
- longitude INTEGER,
- latitude INTEGER,
- accuracy GeoUnitType OPTIONAL
- }
-
- DeltaCoordinates ::= SEQUENCE {
- -- logitude difference to a reference point
- longitude INTEGER,
- -- latitude difference to a reference point
- latitude INTEGER
- }
-
- GeoCoordinateSystemType ::= ENUMERATED {
- wgs84 (0), -- WGS 84 standard system
- grs80 (1) -- (outdated) GRS 80 coordinate system
- }
-
- GeoUnitType ::= ENUMERATED {
- microDegree (0), -- approx. 11 cm on earth surface
- tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
- milliDegree (2), -- approx 110 meter on earth surface
- centiDegree (3),
- deciDegree (4)
- }
-
- HemisphereLongitudeType ::= ENUMERATED {
- north (0),
- south (1)
- }
-
- HemisphereLatitudeType ::= ENUMERATED {
- east (0),
- west (1)
- }
-
- LoadingDeckType ::= ENUMERATED {
- unspecified (0),
- upper (1),
- lower (2)
- }
-
- CompartmentPositionType ::= ENUMERATED {
- unspecified (0),
- upperLevel (1),
- lowerLevel (2)
- }
-
- RoofRackType ::= ENUMERATED {
- norack (0),
- roofRailing (1),
- luggageRack (2),
- skiRack (3),
- boxRack (4),
- rackWithOneBox (5),
- rackWithTwoBoxes (6),
- bicycleRack (7),
- otherRack (8)
- ,...
- }
-
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Tue Aug 11 11:40:28 CEST 2015
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- ##############################################################################################
+-- #
+-- # Final version 1.3 - value 13 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # BOOLEAN is always non optional
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1440 = 24:00,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this is does not rovide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # If these date values are given as the number of days from the issuing date the following rule applies:
+-- #
+-- # The difference in days is calculated by ignoring the time zone information in the case no time zone offset is provided.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05
+-- # local date (CET): 01.01.2018 00:05
+-- # -> difference in days = 1
+-- #
+-- # example 1: (1.1.2018 22:05 UTC == 01.01.2018 23:05 CET) :
+-- # issuing date (UTC): 31.12.2017 22:05
+-- # local date (CET): 01.01.2018 23:05
+-- # -> difference in days = 0
+-- #
+-- # the day difference could become -1 although this can happen for locations in America or New Zeeland only.
+-- #
+-- # implementation example:
+-- #
+-- # public static Long getDateDifference(Date issuingDate, Date localDate) {
+-- #
+-- # if (issuingDate == null || localDate == null) return null;
+-- #
+-- # Calendar issuingCal = Calendar.getInstance();
+-- # issuingCal.clear();
+-- # issuingCal.setTime(issuingDate);
+-- # issuingCal.setTimeZone(TimeZone.getTimeZone("UTC"));
+-- # issuingCal.set(Calendar.HOUR_OF_DAY, 0);
+-- # issuingCal.set(Calendar.MINUTE, 0);
+-- # issuingCal.set(Calendar.SECOND, 0);
+-- # issuingCal.set(Calendar.MILLISECOND, 0);
+-- # Date start = startCal.getTime();
+-- #
+-- # Calendar fromCal = Calendar.getInstance();
+-- # fromCal.clear();
+-- # fromCal.setTime(localDate);
+-- # fromCal.setTimeZone(TimeZone.getTimeZone("UTC"));
+-- # fromCal.set(Calendar.HOUR_OF_DAY, 0);
+-- # fromCal.set(Calendar.MINUTE, 0);
+-- # fromCal.set(Calendar.SECOND, 0);
+-- # fromCal.set(Calendar.MILLISECOND, 0);
+-- # Date end = endCal.getTime();
+-- #
+-- # long diff = TimeUnit.DAYS.convert(end.getTime() - start.getTime(), TimeUnit.MILLISECONDS );
+-- #
+-- # return new Long(diff);
+-- #
+-- # }
+-- #
+-- # public static Date getLocalDateFromDifference(Date issuingDate, int diff , Long time ) {
+-- #
+-- # if (issuingDate == null) return null;
+-- #
+-- # Calendar cal = Calendar.getInstance();
+-- # cal.clear();
+-- # cal.setTime(issuingDate);
+-- # cal.add(Calendar.DAY_OF_YEAR, diff);
+-- #
+-- # if (time != null) {
+-- # int hours = time.intValue() / 60;
+-- # int minutes = time.intValue() - hours * 60;
+-- # cal.set(Calendar.HOUR_OF_DAY, hours);
+-- # cal.set(Calendar.MINUTE,minutes);
+-- # }
+-- #
+-- # return cal.getTime();
+-- #
+-- # }
+-- #
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extesions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date of the delayed train in local time
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1440) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing whith a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1440) OPTIONAL,
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for travelling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or aphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the travelder can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- idcard id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks lateron)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time
+ departureTime INTEGER (0..1440),
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- arrival date and time in local time
+ -- number of days counted from the departure date
+ -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalDate INTEGER (0..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1440) OPTIONAL,
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for depature
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 018.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading / unloading of the car in local date and time
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1440) OPTIONAL,
+ endLoadingTime INTEGER (0..1440) OPTIONAL,
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- reservation reference according on 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- heigth of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- temporal validity data in local time of the location where the jouney starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 1 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes,
+ -- they can be listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for depature
+
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ fromTime INTEGER (0..1440),
+ untilTime INTEGER (0..1440)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin of validity in UTC
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- first day of validity in UTC
+ --- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without travelling by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700),
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- valid from date in UTC
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ --- number of year from valid from year onwards
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in local date time
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-1..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- local date
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- temporal validity data in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ travelerid SEQUENCE OF INTEGER (0..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to lesaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. dicount cards, loaylty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ dayOfBirth INTEGER (0..370) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ departureTime INTEGER (0..1440), -- time in minutes
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers in that zone
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city trafic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER (1..9999999) OPTIONAL,
+
+ -- binary encoding of zones, encoding speciofication provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city trafic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precice on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city trafic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggaage
+ -- SCIC referes to special conditions on registered lluggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage resrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
END \ No newline at end of file
diff --git a/misc/uicBarcodeV1finalDelayConfirmation1.3.1.asn b/misc/uicRailTicketData_v1.3.1.asn
index 0181738..d87bb5d 100644
--- a/misc/uicBarcodeV1finalDelayConfirmation1.3.1.asn
+++ b/misc/uicRailTicketData_v1.3.1.asn
@@ -1,2021 +1,2021 @@
--- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
--- Author: ClemensGantert
--- Created: Tue Aug 11 11:40:28 CEST 2015
-ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
-
--- imports and exports
--- EXPORTS ALL;
-
-
--- ##############################################################################################
--- #
--- # Final version 1.3 - value 13 in the UIC bar code version element
--- # (see element 2 in U_FLEX record definition in leaflet 918.9)
--- #
--- ##############################################################################################
-
-
--- ##############################################################################################
--- #
--- # Naming and encoding conventions
--- #
--- # Elements included as String and as Numeric values:
--- # Some elements are included in different formats to reduce the data size.
--- # These elements must be included only once.
--- # These elements are named with the same name and appendix
--- # Num (numeric values)
--- # IA5 (String values according to ASN IA5String (7Bit))
--- # Example:
--- # trainNum - in case of a numeric train number
--- # trainIA5 - in case of a alphanumeric train Id
--- #
--- #
--- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
--- # other codes are possible based on bilateral agreements
--- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
--- #
--- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
--- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
--- # special character (IA5String)
--- #
--- #
--- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
--- # ! they are unrestricted!!!
--- # !
--- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
--- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
--- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
--- # ! Please ensure to use a tool capable of dealing with larger numbers.
--- #
--- # BOOLEAN is always non optional
--- #
--- # Encoding of time:
--- # time is encoded as the number of minutes of the day 0 = 00:00, 1440 = 24:00,
--- # time data elements end with "time" in their name
--- #
--- # Encoding of date:
--- # .........................................................................................................
--- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
--- #
--- # For local dates the date is associated with the corresponding location:
--- # e.g.:
--- # valid from date -> location where the journey starts
--- # valid until date -> location where the journey covered by the ticket ends
--- #
--- # there could be rare cases where this is does not rovide a unique interpretation:
--- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
--- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
--- # ticket a few hours after the end of validity).
--- #
--- # If these date values are given as the number of days from the issuing date the following rule applies:
--- #
--- # The difference in days is calculated by ignoring the time zone information in the case no time zone offset is provided.
--- #
--- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
--- # issuing date (UTC): 31.12.2017 23:05
--- # local date (CET): 01.01.2018 00:05
--- # -> difference in days = 1
--- #
--- # example 1: (1.1.2018 22:05 UTC == 01.01.2018 23:05 CET) :
--- # issuing date (UTC): 31.12.2017 22:05
--- # local date (CET): 01.01.2018 23:05
--- # -> difference in days = 0
--- #
--- # The difference in days is calculated from dates only, ignoring the time and time zone information.
--- #
--- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
--- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
--- # issuingYear = 2017
--- # issuingDay = 365
--- # issuingTime = 1385
--- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
--- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
--- # departureTime = 15
--- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
--- #
--- #
--- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
--- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
--- # issuingYear = 2018
--- # issuingDay = 1
--- # issuingTime = 5
--- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
--- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
--- # departureTime = 1325
--- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
--- #
--- # departureDate can become -1 with a departure west of the GMT zone only
--- #
--- # Tickets might cover multiple time zones where valid from and until is not linked to a departure or arrival (e.g. Eurail Pass).
--- # In this case the date times are to be interpreted as local in any time zone and the utcOffset must not be
--- # provided for these local date times
--- #
--- # ASN.1 Extensions:
--- #
--- # The specification makes use of extension (",...").
--- # These extesions might be defined in future versions of the UIC specification
--- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
--- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
--- #
--- # Bilateral Extensions:
--- # Bilateral extensions can be included in the data element "ExtensionData".
--- #
--- #
--- #
--- #########################################################################################
-
-
--- ############################################################################################
-
-
--- type assignments
-
- -- #########################################################################################
- -- the basic entry point of the data structure
- -- the data include:
- -- -issuer informations
- -- -the details of the transport document
- -- -informations required for the control process
- -- -informations on the travelers independent from the transport document
- -- -proprietary extensions
- --
- -- ##########################################################################################
- UicRailTicketData ::= SEQUENCE {
- -- data specific to the issuer
- issuingDetail IssuingData,
-
- -- data on the travelers
- travelerDetail TravelerData OPTIONAL,
-
- -- data of the transport document
- --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
- transportDocument SEQUENCE OF DocumentData OPTIONAL,
-
- -- data specific to support the ticket control process
- controlDetail ControlData OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension SEQUENCE OF ExtensionData OPTIONAL
- ,...
- }
-
-
-
- -- ###########################################################################################
- -- the choice on the different transport documents that can be included in the bar code data:
- -- - reservation of seat / couchette or berths (IRT, RES, BOA)
- -- - reservation of car carriage (VET)
- -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
- -- - Rail passes (including Eurail, Interail and local passes) (RPT)
- -- - Voucher (TRV)
- -- - Customer Cards (including bonus cards and reduction cards)
- -- - counter marks issued for group tickets
- -- - parking ground tickets
- -- - FIP tickets
- -- - station access / station passage tickets
- -- - proprietary documents as an extension
- -- ############################################################################################
- DocumentData ::= SEQUENCE {
-
- -- token
- -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
- token TokenType OPTIONAL,
-
- -- choice of the ticket
- ticket CHOICE
- {
-
- -- Reservation (without car carriage) (IRT and RES)
- reservation ReservationData,
-
- -- Reservation of car carriage
- carCarriageReservation CarCarriageReservationData,
-
- -- open ticket specification (NRT)
- openTicket OpenTicketData,
-
- -- pass specification (RPT) including Eurail and Interrail
- pass PassData,
-
- -- voucher
- voucher VoucherData,
-
- -- customer card either to identify a customer and / or to provide reductions
- customerCard CustomerCardData,
-
- -- countermark to accompagny a group ticket
- counterMark CountermarkData,
-
- -- car parking slot
- parkingGround ParkingGroundData,
-
- -- FIP duty ticket
- fipTicket FIPTicketData,
-
- -- ticket to pass the gates at a station
- stationPassage StationPassageData,
-
- -- proprietary data defined bilaterally
- extension ExtensionData,
-
- -- delay confirmation
- delayConfirmation DelayConfirmation
-
- ,...
- }
- ,...
- }
-
- -- ########################################################################################
- -- confirmation of the delay of a train
- --
- -- ########################################################################################
- DelayConfirmation ::= SEQUENCE {
-
- -- reference of the delay confirmation
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- train number of the delayed train - numeric or alphanumeric
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- departure date of the delayed train in local time
- -- number of year
- departureYear INTEGER (2016..2269) OPTIONAL,
- -- number of the day in the year (1.1. = 1)
- departureDay INTEGER (1..366) OPTIONAL,
- departureTime INTEGER (0..1440) OPTIONAL,
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- station where the delay became relevant
- stationCodeTable CodeTableType DEFAULT stationUIC,
- stationNum INTEGER (1..9999999) OPTIONAL,
- stationIA5 IA5String OPTIONAL,
-
- -- delay in minutes at the mentioned station
- delay INTEGER (1..999),
-
- -- indication that the train was cancelled
- trainCancelled BOOLEAN,
-
- -- type of confirmation provided
- confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
-
- -- affected original ticket(s)
- affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
-
- -- info text
- infoText UTF8String OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL
- ,...
- }
-
- ConfirmationType ::= ENUMERATED {
- trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
- travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
- trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
- ,...
- }
-
-
- -- ########################################################################################
- -- Details of the issuer and the issue of the ticket
- -- - details on the issuer
- -- - indication of test tickets (specimen)
- -- - payment details: method of payment, currency
- -- - proprietary PNR of the issuer to be used to identify the sale within
- -- the issuers ecosystem
- -- - web link to display more information for the customer
- -- - proprietary extension data
- -- ########################################################################################
- IssuingData ::= SEQUENCE {
-
- -- provider of the signature (RICS code)
- securityProviderNum INTEGER (1..32000) OPTIONAL,
- securityProviderIA5 IA5String OPTIONAL,
-
- -- issuer of the transport document if the issuer is different from the security provider
- -- (RICS code)
- issuerNum INTEGER (1..32000) OPTIONAL,
- issuerIA5 IA5String OPTIONAL,
-
- -- issuing time stamp in UTC
- -- number of year
- issuingYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- issuingDay INTEGER (1..366),
- -- The number of the minutes of issue might be used in case of account
- -- based ticketing whith a delay of n minutes for the replication of central
- -- booking data to the control devices (e.g. at SBB)
- -- The time can be compared with the last synchronization time of
- -- the control device
- issuingTime INTEGER (0..1440) OPTIONAL,
-
- -- name of the issuer (E.g. short name mentioned in RICS code table)
- issuerName UTF8String OPTIONAL,
-
- -- specimen indicates a test specimen not valid for travelling
- specimen BOOLEAN,
-
- -- secure paper indicates that this barcode is issued with a secure paper ticket
- -- to ensure the uniqueness of the ticket. This allows to use the same control
- -- procedure as for e-tickets also for anonymous tickets
- -- the double use of the ticket is in this case excluded by the secure paper
- securePaperTicket BOOLEAN,
-
- -- indicates that the ticket is valid for traveling or still needs activation
- activated BOOLEAN,
-
- -- currency of the price: ISO4217 currency codes
- currency IA5String (SIZE(3)) DEFAULT "EUR",
-
- -- fraction of the prices included
- currencyFract INTEGER (1..3) DEFAULT 2,
-
- -- PNR used by the issuer to identify the document
- issuerPNR IA5String OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL,
-
- -- location of sale in case of a sale on board of a train
- -- numeric train number or aphanumeric id of the train where the ticket was sold
- issuedOnTrainNum INTEGER OPTIONAL,
- issuedOnTrainIA5 IA5String OPTIONAL,
- -- line number
- issuedOnLine INTEGER OPTIONAL,
-
- -- point of sale
- pointOfSale GeoCoordinateType OPTIONAL
- ,...
- }
-
- -- ###################################################################################
- -- data supporting the control process
- -- - list of items which the travelder can use to identify himself or the unique
- -- usage of the ticket
- -- (card ids, parts or identity card numbers, credit card numbers,..)
- -- - hints on the validation to be made on board
- --
- -- ###################################################################################
- ControlData ::= SEQUENCE {
-
- -- cards that can be used to identify the ticket holder
- identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
-
- -- idcard id must be checked to identify the traveler
- identificationByIdCard BOOLEAN,
-
- -- passport id must be checked to identify the traveler
- identificationByPassportId BOOLEAN,
-
- -- other items which could be used to identify the ticket holder
- -- (for future use, code list to be defined)
- identificationItem INTEGER OPTIONAL,
-
- -- validation of the passport is required (e.g. in case of Eurail)
- passportValidationRequired BOOLEAN,
-
- -- online validation of the ticket required
- onlineValidationRequired BOOLEAN,
-
- -- percentage of the tickets to be validated in more detail
- -- (i.e. via online check or detailed checks lateron)
- randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
-
- -- manual validation of the traveler age required (in case of reductions)
- ageCheckRequired BOOLEAN,
-
- -- manual validation of the travelers reduction card required (in case of reductions)
- reductionCardCheckRequired BOOLEAN,
-
- -- controler info text
- infoText UTF8String OPTIONAL,
-
- -- additional tickets that should be controlled
- includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
-
- -- proprietary data defined bilaterally
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ################################################################################
- -- Traveler data
- -- these data do not include tariff details of the booked tariffs,
- -- tariff data are included in the transport document details and might
- -- have a reference to the traveler defined here.
- -- - personal data of the travellers
- -- - the index of the list can be used to identify the
- -- traveler within other contexts (e.g. in assigned tariffs)
- -- ################################################################################
- TravelerData ::= SEQUENCE {
- -- traveler list
- traveler SEQUENCE OF TravelerType OPTIONAL,
-
- -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
- preferredLanguage IA5String (SIZE(2)) OPTIONAL,
-
- -- name of the group in case of a group ticket
- groupName UTF8String OPTIONAL
- ,...
- }
-
- -- ####################################################################################
- -- the following part contains the different transport document specifications
- -- ####################################################################################
-
-
- -- ####################################################################################
- -- reservations of seats , couchettes and berths
- -- included are the data defined in:
- -- - leaflet 918.1 for reservation data exchange
- -- - a few additional data currently used by some railways via different interfaces
- -- - information on trach an dplafoorm where the coach stops
- -- - additional second coach for large groups
- -- ####################################################################################
- ReservationData ::= SEQUENCE {
-
- -- train number - numeric or alphanumeric
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- departure date in local time
- -- number of the days calculated from the issuing date
- departureDate INTEGER (-1..370) DEFAULT 0,
-
-
- -- reservation reference according ton 918.1 in case ade via Hermes
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code to be used as standard)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- serviceBrand INTEGER (0..32000) OPTIONAL,
- serviceBrandAbrUTF8 UTF8String OPTIONAL,
- serviceBrandNameUTF8 UTF8String OPTIONAL,
-
- -- service code list from 918.1 (seat couchette,..)
- service ServiceType DEFAULT seat,
-
- -- code table used to encode stations
- stationCodeTable CodeTableType DEFAULT stationUICReservation,
-
- -- origin station code
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- -- destination station code
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- -- origin station name
- fromStationNameUTF8 UTF8String OPTIONAL,
-
- -- destination station name
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- departure time
- departureTime INTEGER (0..1440),
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- arrival date and time in local time
- -- number of days counted from the departure date
- -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
- arrivalDate INTEGER (0..20) DEFAULT 0,
- arrivalTime INTEGER (0..1440) OPTIONAL,
- arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omitted in case it is the same as for depature
-
- -- responsible carriers on the route
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- travel class
- classCode TravelClassType DEFAULT second,
-
- -- service level code list from 918.1
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- places
- places PlacesType OPTIONAL,
-
- -- additional places in a second coach
- additionalPlaces PlacesType OPTIONAL,
-
- --bicycle places
- bicyclePlaces PlacesType OPTIONAL,
-
- -- compartment details (open space, wheelchair,..)
- compartmentDetails CompartmentDetailsType OPTIONAL,
-
- -- number of persons on the ticket without place numbers (on IRT)
- numberOfOverbooked INTEGER (0..200) DEFAULT 0,
-
- -- description of berths
- berth SEQUENCE OF BerthDetailData OPTIONAL,
-
- -- tariffs included (Adult, Children,... )
- tariff SEQUENCE OF TariffType OPTIONAL,
-
- -- type of the price (supplement,... )
- priceType PriceTypeType DEFAULT travelPrice,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- -- type of supplement - code list from 018.1
- typeOfSupplement INTEGER (0..9) DEFAULT 0,
-
- numberOfSupplements INTEGER (0..200) DEFAULT 0,
-
- -- luggage restrictions and registered luggage
- -- in case the luggage restrictions are general and do not depend on the
- -- ticket type they should not be included
- luggage LuggageRestrictionType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
-
- -- bilaterally agreed proprietary extension
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #################################################################################
- -- details on the VAT included to be used in after sale processes
- -- #################################################################################
- VatDetailType ::= SEQUENCE {
-
- -- ISO 3166 numeric country code
- country INTEGER (1..999),
-
- -- 1/10th of a percent
- percentage INTEGER (0..999),
-
- -- amount of VAT, the currency and the currency fraction is included in the issuing data
- amount INTEGER OPTIONAL,
-
- -- european tax id of the company paying VAT
- vatId IA5String OPTIONAL
-
- }
-
-
- -- #################################################################################
- -- reservations of car carriage
- -- included are the data defined in:
- -- - leaflet 918.1 for reservation data exchange
- -- - a few additional data currently used by some railways via different interfaces
- -- #################################################################################
- CarCarriageReservationData ::= SEQUENCE {
-
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
-
- -- loading / unloading of the car in local date and time
- -- number of the days calculated from the issuing date
- beginLoadingDate INTEGER (-1..370) DEFAULT 0,
- beginLoadingTime INTEGER (0..1440) OPTIONAL,
- endLoadingTime INTEGER (0..1440) OPTIONAL,
- loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- reservation reference according on 918.1 in case ade via Hermes
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- serviceBrand INTEGER (1..32000) OPTIONAL,
- serviceBrandAbrUTF8 UTF8String OPTIONAL,
- serviceBrandNameUTF8 UTF8String OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUICReservation,
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- coach IA5String OPTIONAL,
- place IA5String OPTIONAL,
-
- compartmentDetails CompartmentDetailsType OPTIONAL,
-
- -- description of the car
- numberPlate IA5String,
- trailerPlate IA5String OPTIONAL,
- carCategory INTEGER (0..9),
- boatCategory INTEGER (0..6) OPTIONAL,
- textileRoof BOOLEAN,
- roofRackType RoofRackType DEFAULT norack,
-
- -- heigth of a roof rack in cm
- roofRackHeight INTEGER (0..99) OPTIONAL,
-
- -- number of boats on a rack
- attachedBoats INTEGER (0..2) OPTIONAL,
-
- -- number of biycles on a rack
- attachedBicycles INTEGER (0..4) OPTIONAL,
-
- -- number of surf boards on a rack
- attachedSurfboards INTEGER (0..5) OPTIONAL,
-
- -- reference to an entry on the loading list
- loadingListEntry INTEGER (0..999) OPTIONAL,
- loadingDeck LoadingDeckType DEFAULT upper,
-
- -- responsible carriers on the route (RICS codes)
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- tariff TariffType,
- priceType PriceTypeType DEFAULT travelPrice,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
- -- #####################################################################################
- -- data for open tickets (NRT and group tickets)
- -- included are the data defined in:
- -- - the ticket layout (leaflet 918.8)
- -- - the ticket bar code version 3 (leaflet 918.9)
- -- - additional data based on 108.1 with some extensions as 108.1
- -- does not provide well structured data,
- -- especially concerning regional validity
- --
- -- #####################################################################################
-
- OpenTicketData ::= SEQUENCE {
-
- -- reference must be given either in numeric or alphanumeric format
- referenceNum INTEGER OPTIONAL,
- referenceIA5 IA5String OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
- -- issuer code using the default code table of the product owner
- extIssuerId INTEGER OPTIONAL,
- -- authorization id provided to the issuer by the product owner
- issuerAutorizationId INTEGER OPTIONAL,
-
- -- ticket includes the return trip
- returnIncluded BOOLEAN,
-
- -- for tickets valid in regions without from or to stations no station is provided
- stationCodeTable CodeTableType DEFAULT stationUIC,
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- -- for tickets valid in regions without from or to stations no station is provided
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validRegionDesc UTF8String OPTIONAL,
- -- specification of the ordered sequence of valid regions
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- -- return route description
- -- the return route description can be omitted if it is identical to the
- -- inversed outbound validRegion sequence
- returnDescription ReturnRouteDescriptionType OPTIONAL,
-
- -- temporal validity data in local time of the location where the jouney starts
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- number of days from valid-from date, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
- -- list of activated days in case the entire ticket is not activated
- -- the day is given by the number of days from the first day of validity
- -- 1 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- classCode TravelClassType DEFAULT second,
-
- -- servicelevel code according to leaflet 918.1 to encode other products
- -- (e.g. PREMIUM, ...)
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- carriers involved in the transport (RICS codes)
- -- the indication of carriers is mandatory on international routes,
- -- they can be listed here but can also be included in viaDetails
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
-
- -- list of service brands for which the ticket is valid
- -- in case the included service brands are listed all other brands are excluded
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- list of service brands for which the ticket is not valid
- -- service brand: code list https://uic.org/service-brand-code-list
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
- -- additional included open tickets
- -- e.g. to include local city traffic on parts of a the route
- includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
-
- -- in case the luggage restrictions are general and do not depend
- -- on the ticket type they should not be included
- luggage LuggageRestrictionType OPTIONAL,
-
-
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
-
- -- ####################################################################################
- -- data for passes
- -- included are the data defined in:
- -- - the ticket layout (leaflet 918.8)
- -- - the ticket bar code version 3 (leaflet 918.8)
- -- ####################################################################################
- PassData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceNum INTEGER OPTIONAL,
- referenceIA5 IA5String OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- type of the pass, code list provided by the product owner
- -- in case of Eurail:
- -- 1 = Interrail
- -- 2 = Eurail
- -- 3 = Eurail Global (all countries)
- passType INTEGER (1..250) OPTIONAL,
-
- -- literal name of the pass
- passDescription UTF8String OPTIONAL,
-
- classCode TravelClassType DEFAULT second,
-
- -- begin of validity (local time)
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- end of validity (local time)
- -- number of days from valid from day, 0 = valid on valid-from-date
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omitted in case it is the same as for depature
-
-
-
- -- additional validity periods and excluded time ranges
- validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
-
- -- max number of days of validity in case the valid from day is open
- numberOfValidityDays INTEGER (0..370) OPTIONAL,
-
- -- max number of possible trips to be activated
- numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
- numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
-
- -- list of activated days in case the entire ticket is not activated
- -- the day is given by the number of days from the first day of validity
- -- 0 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- -- included countries, code table according to UIC leaflet 918.9
- countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
-
- -- included carriers (RICS codes)
- includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- excluded carriers (RICS codes)
- excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- region description to cover local zones
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
-
- price INTEGER OPTIONAL,
-
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- ValidityPeriodDetailType ::= SEQUENCE {
- validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
- excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
- }
-
- ValidityPeriodType ::= SEQUENCE {
- -- number of days from issuing date (local date)
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- number of days from valid from day, 0 = valid on valid from date
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
- }
-
- TimeRangeType ::= SEQUENCE {
- fromTime INTEGER (0..1440),
- untilTime INTEGER (0..1440)
- }
-
- -- ######################################################################################
- -- data for vouchers
- -- included are quite basic further study is required
- -- ######################################################################################
- VoucherData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- begin / end of validity in local date time
- -- number of year
- validFromYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- validFromDay INTEGER (0..370),
- -- end of validity
- -- number of year
- validUntilYear INTEGER (2016..2269),
- -- number of the day in the year (1.1. = 1)
- validUntilDay INTEGER (0..370),
-
- value INTEGER DEFAULT 0,
-
- -- type of the voucher, code list defined by the product owner
- type INTEGER (1..32000) OPTIONAL,
-
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
- -- ###################################################################################
- -- data for FIP tickets
- -- included are data from the FIP ticket layout,
- -- ###################################################################################
- FIPTicketData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- first day of validity in UTC
- --- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- -- last day of validity
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
-
- -- activated days: list of days for which the ticket is valid
- -- the day is given by the number of days from the first day of validity
- -- 0 = first day of validity
- activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
-
- -- included carriers
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- number of travel days allowed
- numberOfTravelDays INTEGER (1..200),
- includesSupplements BOOLEAN,
-
- -- travel class
- classCode TravelClassType DEFAULT second,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #####################################################################################
- -- data station passage and access
- -- ticket used to enter, exit or pass a station without travelling by train.
- -- E.g. for staff working in a station.
- -- #####################################################################################
- StationPassageData ::= SEQUENCE {
-
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- productName UTF8String OPTIONAL,
-
- -- code table used to encode he stations
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- list of station where the passage is allowed
- stationNum SEQUENCE OF INTEGER OPTIONAL,
- stationIA5 SEQUENCE OF IA5String OPTIONAL,
- -- station names
- stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
-
- -- list of areas in a station where the access is allowed
- areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
- areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
- -- area names
- areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
-
- -- begin of validity in local date and time
- -- number of days from issuing date
- validFromDay INTEGER (-1..700),
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- -- end of validity
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- -- number of days for station passage in case the number of days
- -- is limited and less that the validity period
- numberOfDaysValid INTEGER OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- data for customer cards
- -- included are data from:
- -- - �BB requirements on card data
- -- - DB Bahncard as HandyTicket
- -- note: customer data are included in the traveler data structure
- -- ######################################################################################
- CustomerCardData ::= SEQUENCE {
-
- -- customer details
- -- optional, as there might be an anonymous cards
- customer TravelerType OPTIONAL,
-
- -- card id might be numerical or alphanumerical
- cardIdIA5 IA5String OPTIONAL,
- cardIdNum INTEGER OPTIONAL,
-
- -- begin / end of validity in local date time
- -- number of year
- validFromYear INTEGER (2016..2269),
- --- number of the day in the year (1.1. = 1)
- validFromDay INTEGER (0..370) OPTIONAL,
-
- --- number of year from valid from year onwards
- validUntilYear INTEGER (0..250) DEFAULT 0,
- --- number of the day in the year (1.1. = 1)
- validUntilDay INTEGER (0..370) OPTIONAL,
-
- classCode TravelClassType OPTIONAL,
-
- -- code of the card type code list defined by the issuer
- cardType INTEGER (1..1000) OPTIONAL,
-
- -- readable description of the card type
- cardTypeDescr UTF8String OPTIONAL,
-
- -- customer status code
- -- 1 = basic
- -- 2 = premium
- -- 3 = silver
- -- 4 = gold
- -- 5 = platinum
- -- 6 = senator
- -- > 50 - code table of the card issuer
- customerStatus INTEGER OPTIONAL,
-
- -- readable customer status "e.g. gold",
- customerStatusDescr IA5String OPTIONAL,
-
- -- list of included services,
- -- 1 = Rail Plus
- -- 2 = access to launch
- -- > 50 code list of the issuer
- includedServices SEQUENCE OF INTEGER OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- data for customer cards
- -- included are data from:
- -- - DB parking ground reservation
- -- #######################################################################################
- ParkingGroundData ::= SEQUENCE {
-
- -- booking reference
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- parkingGroundId IA5String,
-
- -- parking date in local date time
- -- number of days from the issuing date
- fromParkingDate INTEGER (-1..370),
- -- number of days from the from parking date in case it is different from that date
- untilParkingDate INTEGER (0..370) DEFAULT 0,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- code needed to access the parking lot
- accessCode IA5String OPTIONAL,
-
- location UTF8String,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- in case the parking ground is associated with a station
- stationNum INTEGER OPTIONAL,
- stationIA5 UTF8String OPTIONAL,
-
- specialInformation UTF8String OPTIONAL,
- entryTrack UTF8String OPTIONAL,
- numberPlate IA5String OPTIONAL,
-
- price INTEGER OPTIONAL,
- vatDetail SEQUENCE OF VatDetailType OPTIONAL,
-
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- #######################################################################
- -- data for countermarks issued with group tickets
- -- included are data from:
- -- - version 3 bar code (leaflet 918.9)
- -- - printed layout (leaflet 918.8)
- -- ########################################################################
- CountermarkData ::= SEQUENCE {
-
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- reference of the group ticket
- ticketReferenceIA5 IA5String OPTIONAL,
- ticketReferenceNum INTEGER OPTIONAL,
-
- -- sequential number of the countermark
- numberOfCountermark INTEGER (1..200),
- -- total number of countermarks
- totalOfCountermarks INTEGER (1..200),
- -- name of the group
- groupName UTF8String,
-
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validRegionDesc UTF8String OPTIONAL,
- -- specification of the ordered sequence of valid regions
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
-
- -- ticket includes the return trip
- returnIncluded BOOLEAN,
- -- retrurn route description
- -- can be omitted if it is identical to the inversed outbound validRegion sequence
- returnDescription ReturnRouteDescriptionType OPTIONAL,
-
- -- local date
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
-
- -- number of days from valid from day, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- classCode TravelClassType DEFAULT second,
-
- -- valid carriers
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brands where the ticket is valid
- -- in case this list is provided the ticket is invalid on all other service brands
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- service brands where the ticket is not valid
- -- in case this list is provided the ticket is valid on all other service brands
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- infoText UTF8String OPTIONAL,
-
- extension ExtensionData OPTIONAL
- ,...
- }
-
-
- -- ###########################################################################################
- -- generic non standard extension element
- -- the generic non - standard element contains:
- -- - an extension id to distinguish different extensions
- -- - the extension data as binary data
- -- proprietary extensions are by definition proprietary. This standard provides
- -- the means to identify these extensions
- -- within the data and to skip these data.
- -- the evaluation of these data and the unique identification of the extensions
- -- via the extension id is in the
- -- responsibility of the railways which use these extensions.
- -- ###########################################################################################
- ExtensionData ::= SEQUENCE {
- extensionId IA5String,
- extensionData OCTET STRING
- }
-
- -- ############################################################################################
- -- type definitions
- -- ############################################################################################
-
- -- #############################################################################################
- -- included open ticke for a part of the travel (e.g. local city trafic)
- -- - data identically already included in the covering open ticket do not need to be
- -- repeated here
- -- - main source are the data required for included regional and city traffic tickets
- -- #############################################################################################
- IncludedOpenTicketType ::= SEQUENCE {
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- product id to identify the issued product codelist defined by the product owner
- productIdNum INTEGER (0..32000) OPTIONAL,
- productIdIA5 IA5String OPTIONAL,
-
- -- issuer code using the default code table of the product owner (today used e.g. by VDV)
- externalIssuerId INTEGER OPTIONAL,
- -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
- issuerAutorizationId INTEGER OPTIONAL,
-
- -- regional validity data
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- specification of the ordered sequence of valid regions, ordered in the direction of travel
- validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
-
- -- temporal validity data in local date and time
- -- number of days from issuing date
- validFromDay INTEGER (-1..700) DEFAULT 0,
- validFromTime INTEGER (0..1440) OPTIONAL,
- validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
-
- -- number of days from valid-from date, 0 = first day of validity
- validUntilDay INTEGER (0..370) DEFAULT 0,
- validUntilTime INTEGER (0..1440) OPTIONAL,
- validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
- -- should be omtted in case it is the same as for depature
-
-
- -- travel class to be given in case it differs from the class of the main ticket
- classCode TravelClassType OPTIONAL,
- -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
- -- to be provided in case it differs from the main ticket
- serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
-
- -- valid carriers (RICS codes)
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- service brands where the ticket is valid
- -- in case this list is provided the ticket is invalid on all other service brands
- -- service brand: code list https://uic.org/service-brand-code-list
- includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- -- service brands where the ticket is not valid
- -- in case this list is provided the ticket is valid on all other service brands
- excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
-
- tariffs SEQUENCE OF TariffType OPTIONAL,
- infoText UTF8String OPTIONAL,
- extension ExtensionData OPTIONAL
- ,...
- }
-
- -- ######################################################################################
- -- tariff data for open tickets
- -- information included are:
- -- - number of passengers
- -- - optionally a link to the traveler data
- -- #######################################################################################
- TariffType ::= SEQUENCE {
-
- -- number of passengers using the tariff
- numberOfPassengers INTEGER (1..200) DEFAULT 1,
-
- -- type indication youth, adult, senior,..
- passengerType PassengerType OPTIONAL,
-
- -- age restrictions of the tariff
- ageBelow INTEGER (1..64) OPTIONAL,
- ageAbove INTEGER (1..128) OPTIONAL,
-
-
- -- named traveler list
- -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
- -- the number indicates the position in the traveler list starting from 1
- travelerid SEQUENCE OF INTEGER (0..254) OPTIONAL,
-
- -- restriction on country of residence
- -- this tariff is restricted by the country of residence given in the traveler data
- -- (e.g. Eurail tickets are not valid in the contry of residence)
- restrictedToCountryOfResidence BOOLEAN,
-
- -- section in case the tariff applies to a part of the route only
- restrictedToRouteSection RouteSectionType OPTIONAL,
-
- -- details on series according to lesaflet 108.1
- seriesDataDetails SeriesDetailType OPTIONAL,
-
- -- tariff code
- tariffIdNum INTEGER OPTIONAL,
- tariffIdIA5 IA5String OPTIONAL,
-
- -- tariff description
- tariffDesc UTF8String OPTIONAL,
-
- -- reduction cards applied (incl. dicount cards, loaylty cards relevant for the tariff)
- reductionCard SEQUENCE OF CardReferenceType OPTIONAL
- ,...
- }
-
- SeriesDetailType ::= SEQUENCE {
-
- -- data related to tariffs based on series according UIC leaflet 108.1
- -- supplying carrier according to UIC leaflet 108.1 (RICS code)
- supplyingCarrier INTEGER (1..32000) OPTIONAL,
-
- -- offer identifier of the carrier according to UIC leaflet 108.1
- offerIdentification INTEGER (1..99) OPTIONAL,
-
- -- series of the carrier according to UIC leaflet 108.1
- series INTEGER OPTIONAL
- }
-
-
- RouteSectionType ::= SEQUENCE {
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL
- }
-
-
- -- #######################################################################################
- -- customer card reference
- -- #######################################################################################
- CardReferenceType ::= SEQUENCE {
-
- -- issuer of the card
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- cardIssuerNum INTEGER (1..32000) OPTIONAL,
- cardIssuerIA5 IA5String OPTIONAL,
-
- cardIdNum INTEGER OPTIONAL,
- cardIdIA5 IA5String OPTIONAL,
-
- -- Name of the card e.g. "VISA-CARD"
- cardName UTF8String OPTIONAL,
-
- -- type of the card, code list defined by the issuer
- cardType INTEGER OPTIONAL,
-
- -- in case only the leading part of the card number is provided
- leadingCardIdNum INTEGER OPTIONAL,
- leadingCardIdIA5 IA5String OPTIONAL,
-
-
- -- in case only the trailing part of the card number is provided
- trailingCardIdNum INTEGER OPTIONAL,
- trailingCardIdIA5 IA5String OPTIONAL
-
- ,...
- }
-
- -- #######################################################################################
- -- traveler data
- -- - traveler data might contain all traveler details which are independent
- -- from the type of travel document
- -- e.g. it can include the date of birth as this is part of the traveler
- -- but not the indication "Senior" as this is tariff dependent
- --
- -- #######################################################################################
- TravelerType ::= SEQUENCE {
-
- firstName UTF8String OPTIONAL,
- secondName UTF8String OPTIONAL,
- lastName UTF8String OPTIONAL,
- idCard IA5String OPTIONAL,
- passportId IA5String OPTIONAL,
- title IA5String (SIZE(1..3)) OPTIONAL,
- gender GenderType OPTIONAL,
-
- -- customer id might be numerical or alphanumerical
- customerIdIA5 IA5String OPTIONAL,
- customerIdNum INTEGER OPTIONAL,
-
- -- date of birth
- -- number of year
- yearOfBirth INTEGER (1901..2155) OPTIONAL,
- -- number of the day in the year (1.1. = 1)
- dayOfBirth INTEGER (0..370) OPTIONAL,
-
- -- indicates the ticket holder/group leader in case of groups
- ticketHolder BOOLEAN,
-
- passengerType PassengerType OPTIONAL,
-
- passengerWithReducedMobility BOOLEAN OPTIONAL,
-
- -- country of residence (numeric ISO country code)
- -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
- countryOfResidence INTEGER (1..999) OPTIONAL,
-
- countryOfPassport INTEGER (1..999) OPTIONAL,
- countryOfIdCard INTEGER (1..999) OPTIONAL,
-
- status SEQUENCE OF CustomerStatusType OPTIONAL
- ,...
- }
-
- CustomerStatusType ::= SEQUENCE {
-
- -- compagny providing the status, default is the issuer
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- statusProviderNum INTEGER (1..32000) OPTIONAL,
- statusProviderIA5 IA5String OPTIONAL,
-
- -- customer status code
- -- 1 = basic
- -- 2 = premium
- -- 3 = silver
- -- 4 = gold
- -- 5 = platinum
- -- 6 = senator
- -- > 50 - code table of the card issuer
- customerStatus INTEGER OPTIONAL,
-
- -- customer status "gold"
- customerStatusDescr IA5String OPTIONAL
- }
-
-
- ReturnRouteDescriptionType ::= SEQUENCE {
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL,
-
- -- description for manual evaluation in case structured data are not available
- validReturnRegionDesc UTF8String OPTIONAL,
-
- -- specification of the ordered sequence of valid regions for the return trip
- validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
- ,...
-
- }
-
- -- ######################################################################################
- -- regional validity of an open ticket
- -- specification of the regional validity.
- -- ######################################################################################
-
- RegionalValidityType ::= CHOICE {
- trainLink TrainLinkType,
- viaStations ViaStationType,
- zones ZoneType,
- lines LineType,
- polygone PolygoneType
- ,...
- }
-
-
-
- -- #######################################################################################
- -- train link data
- -- includes a restriction of an open ticket valid only on a specific train
- -- and date on a part of the route
- -- #######################################################################################
- TrainLinkType ::= SEQUENCE {
-
- trainNum INTEGER OPTIONAL,
- trainIA5 IA5String OPTIONAL,
-
- -- local date at the station where the train link starts
- -- days from the issuing date onwards
- travelDate INTEGER (-1..370),
- departureTime INTEGER (0..1440), -- time in minutes
- departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
- -- (UTC = local + offset * 15 Minutes)
-
- fromStationNum INTEGER (1..9999999) OPTIONAL,
- fromStationIA5 IA5String OPTIONAL,
-
- toStationNum INTEGER (1..9999999) OPTIONAL,
- toStationIA5 IA5String OPTIONAL,
-
- fromStationNameUTF8 UTF8String OPTIONAL,
- toStationNameUTF8 UTF8String OPTIONAL
-
- }
-
-
-
- -- ######################################################################################
- -- regional validity using a set of lines
- -- - based on data used in regional city trafic enviromnemnts
- -- ######################################################################################
- LineType ::= SEQUENCE {
-
- -- local service provider / carrier within the zone
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- carrierNum INTEGER (1..32000) OPTIONAL,
- carrierIA5 IA5String OPTIONAL,
-
- -- ids of the valid lines known by the local carriers in that zone
- lineId SEQUENCE OF INTEGER OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
-
- -- in case the zone must be entered via a specific station
- -- (e.g. local city trafic at the end of a journey
- -- starting from the main train station)
- entryStationNum INTEGER (1..9999999) OPTIONAL,
- entryStationIA5 IA5String OPTIONAL,
-
- -- in case the zone must be left via a specific station
- -- (e.g. local city trafic at the beginning of a journey
- -- terminating at the main train station)
- terminatingStationNum INTEGER (1..9999999) OPTIONAL,
- terminatingStationIA5 IA5String OPTIONAL,
-
- -- code of the local city in case the zone is part of regional city transport
- -- code list of the local carrier
- city INTEGER (1..9999999) OPTIONAL,
-
- -- binary encoding of zones, encoding speciofication provided by
- -- the local service provider
- binaryZoneId OCTET STRING OPTIONAL
- ,...
- }
-
-
- -- #################################################################################
- -- regional validity in a zone
- -- - based on data used in regional city trafic enviromnemnts
- -- #################################################################################
- ZoneType ::= SEQUENCE {
-
- -- local service provider / carrier within the zone
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- carrierNum INTEGER (1..32000) OPTIONAL,
- carrierIA5 IA5String OPTIONAL,
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- in case the zone must be entered via a specific station
- -- (e.g. local city trafic at the end of a journey starting
- -- from the main train station)
- entryStationNum INTEGER (1..9999999) OPTIONAL,
- entryStationIA5 IA5String OPTIONAL,
-
- -- in case the zone must be left via a specific station
- -- (e.g. local city trafic at the beginning of a journey
- -- terminating at the main train station)
- terminatingStationNum INTEGER (1..9999999) OPTIONAL,
- terminatingStationIA5 IA5String OPTIONAL,
-
- -- code of the local city in case the zone is part of regional
- -- city transport code list of the local carrier
- city INTEGER OPTIONAL,
-
- -- ids of the valid zones known by the local carriers in that zone
- zoneId SEQUENCE OF INTEGER OPTIONAL,
-
- -- binary encoding of zones, encoding specification provided by
- -- the local service provider
- binaryZoneId OCTET STRING OPTIONAL,
-
- -- EU NUTS code for a region
- nutsCode IA5String OPTIONAL
- ,...
- }
-
-
- -- ##################################################################################
- -- via station
- -- includes a description of of the route by via stations.
- -- Via stations follow the description in leaflet 108.1:
- -- via stations can e mandatory to pass (but there does not need to be a
- -- train stop at this stations): visible route description: "*station*"
- -- there can be a list of alternative routes:
- -- visible route description: "*(station1/station2)*"
- -- there can also be alternative routes:
- -- "*(station1*station2/station3*station4)*" although the
- -- definition in 108.2 is not very precice on this option
- -- ###################################################################################
- ViaStationType ::= SEQUENCE {
-
- stationCodeTable CodeTableType DEFAULT stationUIC,
- -- mandatory via station
- stationNum INTEGER (1..9999999) OPTIONAL,
- stationIA5 IA5String OPTIONAL,
-
- -- list of alternative routes, one of these has to be taken
- alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
-
- -- list of stations along the route
- route SEQUENCE OF ViaStationType OPTIONAL,
- border BOOLEAN,
-
- -- carrier responsible for the transport starting at this station (RICS-Code)
- -- in case the carrier is included here it might be omitted
- -- in the carrier list of the region data
- carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
- carrierIA5 SEQUENCE OF IA5String OPTIONAL,
-
- -- the route id as series number as defined in 108.1 data
- seriesId INTEGER OPTIONAL,
-
- -- route id of the route code list defined by the carrier on that route
- routeId INTEGER OPTIONAL
- ,...
- }
-
-
- PolygoneType ::= SEQUENCE {
- firstEdge GeoCoordinateType,
- edges SEQUENCE OF DeltaCoordinates
- }
-
-
- -- ###########################################################################################
- -- TokenType provides an additional identifier
- -- known use cases
- -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
- -- ###########################################################################################
- TokenType ::= SEQUENCE {
- -- provider of the token
- tokenProviderNum INTEGER OPTIONAL,
- tokenProviderIA5 IA5String OPTIONAL,
-
- -- in case the provider has multiple tokens
- tokenSpecification IA5String OPTIONAL,
- token OCTET STRING
- }
-
- -- ###########################################################################################
- -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
- -- (requirement from Eurail)
- -- use cases
- -- - DB Alleo (open ticket + reservation)
- -- - reservation of trailer and car carriage and traveller reservation
- -- - link between open ticket and bicycle reservations or pass
- -- - open ticket and vouchers for meals
- -- ###########################################################################################
- TicketLinkType ::= SEQUENCE {
-
- -- data to reference the external ticket
- -- reference must be given in numeric or alphanumeric format
- referenceIA5 IA5String OPTIONAL,
- referenceNum INTEGER OPTIONAL,
-
- issuerName UTF8String OPTIONAL, -- name of the issuer
-
- issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
- -- the issuer PNR
-
- -- organization responsible for the product definition
- -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
- productOwnerNum INTEGER (1..32000) OPTIONAL,
- productOwnerIA5 IA5String OPTIONAL,
-
- -- type of linked ticket
- ticketType TicketType DEFAULT openTicket,
-
- -- type of link
- linkMode LinkMode DEFAULT issuedTogether
- ,...
- }
-
- -- ############################################################################################
- -- code table used fort station codes
- -- defines the code table used e.g. to define station code
- -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
- -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
- -- ############################################################################################
-
- CodeTableType ::= ENUMERATED {
- -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
- stationUIC (0),
- -- standard UIC station code for reservation
- stationUICReservation (1),
- -- future standard ERA station code
- stationERA (2),
- -- local carrier code list
- -- e.g. in case of stations / stops of non-railways stops (city trafic)
- localCarrierStationCodeTable (3),
-
- -- non standard code to be used within the issuer eco system only
- -- not applicable for multi carrier travel documents
- -- or in case issuer and carrier are different
- proprietaryIssuerStationCodeTable (4)
-
- }
-
-
- ServiceType ::= ENUMERATED {
- seat (0),
- couchette (1),
- berth (2),
- carcarriage (3)
- }
-
-
- PassengerType ::= ENUMERATED {
- adult (0),
- senior (1),
- child (2),
- youth (3),
- dog (4),
- bicycle (5),
- freeAddonPassenger (6),
- freeAddonChild (7)
- ,...
- }
-
- TicketType ::= ENUMERATED {
- openTicket (0),
- pass (1),
- reservation (2),
- carCarriageReservation (3)
- ,...
- }
-
- LinkMode ::= ENUMERATED {
- issuedTogether (0),
- onlyValidInCombination (1)
- ,...
- }
-
-
- -- ####################################################################################
- -- place data corresponding to leaflet 918.1
- -- placeString = place number ranges in case of groups
- -- ####################################################################################
- PlacesType ::= SEQUENCE {
- coach IA5String OPTIONAL,
-
- -- printable place string ("15-18, 21, 22" )
- placeString IA5String OPTIONAL,
-
- -- printable place description
- placeDescription UTF8String OPTIONAL,
-
- -- individual places
- placeIA5 SEQUENCE OF IA5String OPTIONAL,
- placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
- }
-
- PriceTypeType ::= ENUMERATED {
- noPrice (0),
- reservationFee (1),
- supplement (2),
- travelPrice (3)
- }
-
- BerthTypeType ::= ENUMERATED {
- single (0),
- special (1),
- double (2),
- t2 (3),
- t3 (4),
- t4 (5)
- }
-
- CompartmentGenderType ::= ENUMERATED {
- unspecified (0),
- family (1),
- female (2),
- male (3),
- mixed (4)
- ,...
- }
-
- GenderType ::= ENUMERATED {
- unspecified (0),
- female (1),
- male (2),
- other (3)
- ,...
- }
-
- TravelClassType ::= ENUMERATED {
- notApplicable (0),
- first (1),
- second (2),
- tourist (3),
- comfort (4),
- premium (5),
- business (6),
- all (7)
- ,...
- }
-
- -- ########################################################################################
- -- sleeper compartment types corresponding to leaflet 918.1
- -- ########################################################################################
- BerthDetailData ::= SEQUENCE {
- berthType BerthTypeType,
- numberOfBerths INTEGER (1..999),
- gender CompartmentGenderType DEFAULT family
- ,...
- }
-
- -- ####################################################################################
- -- compartment details corresponding to leaflet 918.1
- -- ####################################################################################
- CompartmentDetailsType ::= SEQUENCE {
- coachType INTEGER (1..99) OPTIONAL,
- compartmentType INTEGER (1..99) OPTIONAL,
- specialAllocation INTEGER (1..99) OPTIONAL,
- coachTypeDescr UTF8String OPTIONAL,
- compartmentTypeDescr UTF8String OPTIONAL,
- specialAllocationDescr UTF8String OPTIONAL,
- position CompartmentPositionType DEFAULT unspecified
- ,...
- }
-
-
- -- #####################################################################################
- -- luggage restrictions
- -- the basis for these data is week:
- -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
- -- a definition of hand luggaage
- -- SCIC referes to special conditions on registered lluggage, but SCIC NRT does
- -- not contain definitions on that and UIC 108.1 does not
- -- contain data structures for luggage
- -- - current THALYS luggage resrictions
- -- #####################################################################################
- LuggageRestrictionType ::= SEQUENCE {
- -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
- maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
- -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
- maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
- registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
- ,...
-
- }
-
- RegisteredLuggageType ::= SEQUENCE {
- -- id of the additional registered luggage
- registrationId IA5String OPTIONAL,
- -- maximum weight in kg
- maxWeight INTEGER (1..99) OPTIONAL,
- -- sum of length with and height in cm
- maxSize INTEGER (1..300) OPTIONAL
- ,...
-
- }
-
- -- ##########################################################################################
- -- generic type for geo coordinates
- -- ##########################################################################################
- GeoCoordinateType ::= SEQUENCE {
- geoUnit GeoUnitType DEFAULT milliDegree,
- coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
- -- separate hemishpere flag reduces the data size
- hemisphereLongitude HemisphereLongitudeType DEFAULT north,
- -- separate hemishpere flag reduces the data size
- hemisphereLatitude HemisphereLatitudeType DEFAULT east,
- longitude INTEGER,
- latitude INTEGER,
- accuracy GeoUnitType OPTIONAL
- }
-
- DeltaCoordinates ::= SEQUENCE {
- -- logitude difference to a reference point
- longitude INTEGER,
- -- latitude difference to a reference point
- latitude INTEGER
- }
-
- GeoCoordinateSystemType ::= ENUMERATED {
- wgs84 (0), -- WGS 84 standard system
- grs80 (1) -- (outdated) GRS 80 coordinate system
- }
-
- GeoUnitType ::= ENUMERATED {
- microDegree (0), -- approx. 11 cm on earth surface
- tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
- milliDegree (2), -- approx 110 meter on earth surface
- centiDegree (3),
- deciDegree (4)
- }
-
- HemisphereLongitudeType ::= ENUMERATED {
- north (0),
- south (1)
- }
-
- HemisphereLatitudeType ::= ENUMERATED {
- east (0),
- west (1)
- }
-
- LoadingDeckType ::= ENUMERATED {
- unspecified (0),
- upper (1),
- lower (2)
- }
-
- CompartmentPositionType ::= ENUMERATED {
- unspecified (0),
- upperLevel (1),
- lowerLevel (2)
- }
-
- RoofRackType ::= ENUMERATED {
- norack (0),
- roofRailing (1),
- luggageRack (2),
- skiRack (3),
- boxRack (4),
- rackWithOneBox (5),
- rackWithTwoBoxes (6),
- bicycleRack (7),
- otherRack (8)
- ,...
- }
-
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Tue Aug 11 11:40:28 CEST 2015
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- ##############################################################################################
+-- #
+-- # Final version 1.3 - value 13 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # BOOLEAN is always non optional
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1440 = 24:00,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this is does not rovide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # If these date values are given as the number of days from the issuing date the following rule applies:
+-- #
+-- # The difference in days is calculated by ignoring the time zone information in the case no time zone offset is provided.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05
+-- # local date (CET): 01.01.2018 00:05
+-- # -> difference in days = 1
+-- #
+-- # example 1: (1.1.2018 22:05 UTC == 01.01.2018 23:05 CET) :
+-- # issuing date (UTC): 31.12.2017 22:05
+-- # local date (CET): 01.01.2018 23:05
+-- # -> difference in days = 0
+-- #
+-- # The difference in days is calculated from dates only, ignoring the time and time zone information.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
+-- # issuingYear = 2017
+-- # issuingDay = 365
+-- # issuingTime = 1385
+-- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
+-- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
+-- # departureTime = 15
+-- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
+-- #
+-- #
+-- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
+-- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
+-- # issuingYear = 2018
+-- # issuingDay = 1
+-- # issuingTime = 5
+-- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
+-- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
+-- # departureTime = 1325
+-- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
+-- #
+-- # departureDate can become -1 with a departure west of the GMT zone only
+-- #
+-- # Tickets might cover multiple time zones where valid from and until is not linked to a departure or arrival (e.g. Eurail Pass).
+-- # In this case the date times are to be interpreted as local in any time zone and the utcOffset must not be
+-- # provided for these local date times
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extesions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date of the delayed train in local time
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1440) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing whith a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1440) OPTIONAL,
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for travelling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or aphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the travelder can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- idcard id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks lateron)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time
+ departureTime INTEGER (0..1440),
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- arrival date and time in local time
+ -- number of days counted from the departure date
+ -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalDate INTEGER (0..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1440) OPTIONAL,
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for depature
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 018.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading / unloading of the car in local date and time
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1440) OPTIONAL,
+ endLoadingTime INTEGER (0..1440) OPTIONAL,
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- reservation reference according on 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- heigth of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- temporal validity data in local time of the location where the jouney starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 1 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes,
+ -- they can be listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for depature
+
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ fromTime INTEGER (0..1440),
+ untilTime INTEGER (0..1440)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date time
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- first day of validity in UTC
+ --- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without travelling by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700),
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- begin / end of validity in local date time
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ --- number of year from valid from year onwards
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in local date time
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-1..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- local date
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..32000) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- temporal validity data in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1440) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (0..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1440) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omtted in case it is the same as for depature
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ travelerid SEQUENCE OF INTEGER (0..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to lesaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. dicount cards, loaylty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ dayOfBirth INTEGER (0..370) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ departureTime INTEGER (0..1440), -- time in minutes
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers in that zone
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city trafic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER (1..9999999) OPTIONAL,
+
+ -- binary encoding of zones, encoding speciofication provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city trafic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precice on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city trafic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggaage
+ -- SCIC referes to special conditions on registered lluggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage resrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
END \ No newline at end of file
diff --git a/misc/uicRailTicketData_v2.0.0.asn b/misc/uicRailTicketData_v2.0.0.asn
new file mode 100644
index 0000000..924a415
--- /dev/null
+++ b/misc/uicRailTicketData_v2.0.0.asn
@@ -0,0 +1,2040 @@
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Tue Aug 11 11:40:28 CEST 2015
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- changes:
+-- product id 1 bit more 65535
+-- open ticket transport mode EN 1545-1
+-- allowing -1 in differences of days between dates (validity of tickets crossing time zones)
+
+-- ##############################################################################################
+-- #
+-- # Draft version 2.0 - value 2 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # Optional BOOLEANs have three values: "true", "false", "unknown" = the Boolean is absent from the data.
+-- #
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1439 = 23:59,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this does not provide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # The difference in days is calculated from dates only, ignoring the time and time zone information.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
+-- # issuingYear = 2017
+-- # issuingDay = 365
+-- # issuingTime = 1385
+-- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
+-- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
+-- # departureTime = 15
+-- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
+-- #
+-- #
+-- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
+-- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
+-- # issuingYear = 2018
+-- # issuingDay = 1
+-- # issuingTime = 5
+-- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
+-- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
+-- # departureTime = 1325
+-- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
+-- #
+-- # departureDate can become -1 with a departure west of the GMT zone only
+-- #
+-- #
+-- #
+-- #
+-- #
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extensions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date of the delayed train in local time
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1439) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing with a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1439) OPTIONAL,
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for travelling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or alphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the traveler can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- id-card id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks later-on)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time
+ departureTime INTEGER (0..1439),
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- arrival date and time in local time
+ -- number of days counted from the departure date
+ -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1439) OPTIONAL,
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 918.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading / unloading of the car in local date and time
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1439) OPTIONAL,
+ endLoadingTime INTEGER (0..1439) OPTIONAL,
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- reservation reference according on 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- height of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip - should be set to false if it is not relevant (e.g. zones)
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- temporal validity data in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- here it is possible to list the activated days of the ticket:
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes, they can be
+ -- listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ fromTime INTEGER (0..1439),
+ untilTime INTEGER (0..1439)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin of validity in UTC
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- first day of validity in UTC
+ --- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without travelling by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700),
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- valid from date in UTC
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ --- number of year from valid from year onwards
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in local date time
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-1..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- local date
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- temporal validity data in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- !!! new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ -- change V2 0 -> 1..
+ travelerid SEQUENCE OF INTEGER (1..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to leaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. discount cards, loyalty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ monthOfBirth INTEGER (1..12) OPTIONAL,
+ dayOfBirthInMonth INTEGER (1..31) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ departureTime INTEGER (0..1439), -- time in minutes
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers on that line
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the line must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the line must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the line is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city traffic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precice on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city traffic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7),
+ premiumFirst (8),
+ standardFirst (9),
+ premiumSecond (10),
+ standardSecond (11)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggage
+ -- SCIC refers to special conditions on registered luggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage restrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
+END \ No newline at end of file
diff --git a/misc/uicRailTicketData_v2.0.1.asn b/misc/uicRailTicketData_v2.0.1.asn
new file mode 100644
index 0000000..16c376b
--- /dev/null
+++ b/misc/uicRailTicketData_v2.0.1.asn
@@ -0,0 +1,2042 @@
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Tue Aug 11 11:40:28 CEST 2015
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- changes:
+-- product id 1 bit more 65535
+-- open ticket transport mode EN 1545-1
+-- allowing -1 in differences of days between dates (validity of tickets crossing time zones)
+
+-- ##############################################################################################
+-- #
+-- # Draft version 2.0 - value 2 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # Optional BOOLEANs have three values: "true", "false", "unknown" = the Boolean is absent from the data.
+-- #
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1439 = 23:59,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this does not provide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # The difference in days is calculated from dates only, ignoring the time and time zone information.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
+-- # issuingYear = 2017
+-- # issuingDay = 365
+-- # issuingTime = 1385
+-- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
+-- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
+-- # departureTime = 15
+-- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
+-- #
+-- #
+-- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
+-- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
+-- # issuingYear = 2018
+-- # issuingDay = 1
+-- # issuingTime = 5
+-- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
+-- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
+-- # departureTime = 1325
+-- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
+-- #
+-- # departureDate can become -1 with a departure west of the GMT zone only
+-- #
+-- #
+-- # Tickets might cover multiple time zones where valid from and until is not linked to a departure or arrival (e.g. Eurail Pass).
+-- # In this case the date times are to be interpreted as local in any time zone and the utcOffset must not be
+-- # provided for these local date times
+-- #
+-- #
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extensions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date of the delayed train in local time
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1439) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing with a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1439) OPTIONAL,
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for travelling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or alphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the traveler can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- id-card id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks later-on)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time
+ departureTime INTEGER (0..1439),
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- arrival date and time in local time
+ -- number of days counted from the departure date
+ -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1439) OPTIONAL,
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 918.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading / unloading of the car in local date and time
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1439) OPTIONAL,
+ endLoadingTime INTEGER (0..1439) OPTIONAL,
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- reservation reference according on 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- height of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip - should be set to false if it is not relevant (e.g. zones)
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- temporal validity data in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- here it is possible to list the activated days of the ticket:
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes, they can be
+ -- listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ fromTime INTEGER (0..1439),
+ untilTime INTEGER (0..1439)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date time
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- first day of validity in UTC
+ --- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without travelling by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700),
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- begin / end of validity in local date time
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ --- number of year from valid from year onwards
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in local date time
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-1..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- local date
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- temporal validity data in local date and time
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+
+ -- number of days from valid-from date, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- !!! new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ -- change V2 0 -> 1..
+ travelerid SEQUENCE OF INTEGER (1..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to leaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. discount cards, loyalty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ monthOfBirth INTEGER (1..12) OPTIONAL,
+ dayOfBirthInMonth INTEGER (1..31) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ departureTime INTEGER (0..1439), -- time in minutes
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers on that line
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the line must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the line must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the line is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city traffic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precice on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city traffic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7),
+ premiumFirst (8),
+ standardFirst (9),
+ premiumSecond (10),
+ standardSecond (11)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggage
+ -- SCIC refers to special conditions on registered luggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage restrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
+END \ No newline at end of file
diff --git a/misc/uicRailTicketData_v2.0.2.asn b/misc/uicRailTicketData_v2.0.2.asn
new file mode 100644
index 0000000..d7067ca
--- /dev/null
+++ b/misc/uicRailTicketData_v2.0.2.asn
@@ -0,0 +1,2113 @@
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Tue Aug 11 11:40:28 CEST 2015
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- changes:
+-- product id 1 bit more 65535
+-- open ticket transport mode EN 1545-1
+-- allowing -1 in differences of days between dates (validity of tickets crossing time zones)
+
+-- ##############################################################################################
+-- #
+-- # version 2.0 - value 2 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- # 2.0.2 - improved description on times and time zones to be used
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # Optional BOOLEANs have three values: "true", "false", "unknown" = the Boolean is absent from the data.
+-- #
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1439 = 23:59,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this does not provide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # The difference in days is calculated from dates only, ignoring the time and time zone information.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
+-- # issuingYear = 2017
+-- # issuingDay = 365
+-- # issuingTime = 1385
+-- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
+-- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
+-- # departureTime = 15
+-- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
+-- #
+-- #
+-- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
+-- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
+-- # issuingYear = 2018
+-- # issuingDay = 1
+-- # issuingTime = 5
+-- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
+-- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
+-- # departureTime = 1325
+-- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
+-- #
+-- # departureDate can become -1 with a departure west of the GMT zone only
+-- #
+-- #
+-- # Tickets might cover multiple time zones where valid from and until is not linked to a specific time zone (e.g. Eurail Pass valid for whole Europe).
+-- # In this case the date times are to be interpreted as local at the actual place where the traveler is and the ticket is checked. The utcOffset must not be
+-- # provided for these local date times.
+-- #
+-- # !!In general the issuing date and time is always UTC whereas the other dates and times are always local.!!
+-- #
+-- # It is RECOMMENDED not to use the utcOffset until there is a need to do so.
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extensions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- planned departure date of the delayed train in local time at the station where delay
+ -- became relevant (see below)
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1439) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing with a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1439) OPTIONAL,
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for travelling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or alphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the traveler can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- id-card id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks later-on)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time at the departure station
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time in local time at the departure station
+ departureTime INTEGER (0..1439),
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ departureUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- arrival date and time in local time at the arrival station
+ -- number of days counted from the departure date
+ -- !!! proposal for change: arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- times to be shown on a ticket should always be the local times
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 918.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading of the car in local date and time at the loading station
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1439) OPTIONAL,
+ endLoadingTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- times to be shown on a ticket should always be the local times
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- reservation reference according on 918.1 in case made via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- height of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip - should be set to false if it is not relevant (e.g. zones)
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- here it is possible to list the activated days of the ticket:
+ -- day the ticket is activated. The activation is valid from 00:00 to 23:59 in the time zone of the current location of the traveler
+ -- thereby the activation might include more or less that 24 hours in case time zone borders are crossed
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes, they can be
+ -- listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ -- in case the valid until time is not provided the valid until time is 23.59 (local time)
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+
+ -- here it is possible to list the activated days of the ticket:
+ -- day the ticket is activated. The activation is valid from 00:00 to 23:59 in the time zone of the current location of the traveler
+ -- thereby the activation might include more or less that 24 hours in case time zone borders are crossed
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- local time
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ -- local time
+ fromTime INTEGER (0..1439),
+ -- local time
+ untilTime INTEGER (0..1439)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date time wherever the traveler is located
+ -- valid from 00:00 to 23:59
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date time wherever the traveler is located
+ -- valid from 00:00 to 23:59
+ --- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid in local date time wherever the traveler is located
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without travel ing by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time of the station
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700),
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for begin of validity (might be different in case of changes to summer time)
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- begin / end of validity in local date time wherever the traveler is located
+ -- begin of validity time is 00:00
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ -- number of year from valid from year onwards
+ -- end of validity time is 23:59
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in local date time of the time zone of the parking
+ -- validity is the whole day depending on opening hours of the parking facility
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-1..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-1..700) DEFAULT 0,
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- !!! new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ -- change V2 0 -> 1..
+ travelerid SEQUENCE OF INTEGER (1..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to leaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. discount cards, loyalty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ monthOfBirth INTEGER (1..12) OPTIONAL,
+ dayOfBirthInMonth INTEGER (1..31) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts (fromStation)
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ -- time in minutes, local time at the station where the train link starts
+ departureTime INTEGER (0..1439),
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ departureUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers on that line
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the line must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the line must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the line is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city traffic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precice on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city traffic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7),
+ premiumFirst (8),
+ standardFirst (9),
+ premiumSecond (10),
+ standardSecond (11)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggage
+ -- SCIC refers to special conditions on registered luggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage restrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
+END \ No newline at end of file
diff --git a/misc/uicRailTicketData_v3.0.0.asn b/misc/uicRailTicketData_v3.0.0.asn
new file mode 100644
index 0000000..455bd8d
--- /dev/null
+++ b/misc/uicRailTicketData_v3.0.0.asn
@@ -0,0 +1,2180 @@
+-- Creator: ASN.1 Editor (http://asneditor.sourceforge.net)
+-- Author: ClemensGantert
+-- Created: Mon Jun 28 14:14:28 CEST 2021
+ASN-Module DEFINITIONS AUTOMATIC TAGS ::= BEGIN
+
+-- imports and exports
+-- EXPORTS ALL;
+
+
+-- changes:
+-- product id 1 bit more 65535
+-- open ticket transport mode EN 1545-1
+-- allowing -1 in differences of days between dates (validity of tickets crossing time zones)
+
+-- ##############################################################################################
+-- #
+-- # version 3.0.0 - value 3 in the UIC bar code version element
+-- # (see element 2 in U_FLEX record definition in leaflet 918.9)
+-- #
+-- ##############################################################################################
+
+
+-- ##############################################################################################
+-- #
+-- # Naming and encoding conventions
+-- #
+-- # Elements included as String and as Numeric values:
+-- # Some elements are included in different formats to reduce the data size.
+-- # These elements must be included only once.
+-- # These elements are named with the same name and appendix
+-- # Num (numeric values)
+-- # IA5 (String values according to ASN IA5String (7Bit))
+-- # Example:
+-- # trainNum - in case of a numeric train number
+-- # trainIA5 - in case of a alphanumeric train Id
+-- #
+-- #
+-- # RICS codes must be used to encode companies (issuer, product owner, ...) where available
+-- # other codes are possible based on bilateral agreements
+-- # the format is kept more flexible to cover upcoming extensions of the RICS code by ERA
+-- #
+-- # Stations can be coded using the UIC and upcoming ERA code lists. Proprietary codes are
+-- # possible based on bilateral agreements. Format: 1..9999999 or alphanumeric without
+-- # special character (IA5String)
+-- #
+-- #
+-- # ! INTEGERS must not exceed the value of 9,223,372,036,854,775,807 (64 bit) even in case
+-- # ! they are unrestricted!!!
+-- # !
+-- # ! Some elements like ReferenceNum or cardIdNum are defined as an unrestricted integer.
+-- # ! Unlike other numerical values the cardIdNum and referenceNum can be larger than a usual 32 bit Integer
+-- # ! Some ASN.1 implementation tools are limited to 32 bit integers which is too small.
+-- # ! Please ensure to use a tool capable of dealing with larger numbers.
+-- #
+-- # Optional BOOLEANs have three values: "true", "false", "unknown" = the Boolean is absent from the data.
+-- #
+-- #
+-- # Encoding of time:
+-- # time is encoded as the number of minutes of the day 0 = 00:00, 1439 = 23:59,
+-- # time data elements end with "time" in their name
+-- #
+-- # Encoding of date:
+-- # .........................................................................................................
+-- # The issuing date is given in UTC, but some other date values are given in local time where the exact time zone is not known.
+-- #
+-- # For local dates the date is associated with the corresponding location:
+-- # e.g.:
+-- # valid from date -> location where the journey starts
+-- # valid until date -> location where the journey covered by the ticket ends
+-- #
+-- # there could be rare cases where this does not provide a unique interpretation:
+-- # e.g. open ticket or pass without start and end location for a collection of zones or countries with different time zones.
+-- # in these cases the fare conditions must clarify the rules for these cases (e.g. by allowing to use the
+-- # ticket a few hours after the end of validity).
+-- #
+-- # The difference in days is calculated from dates only, ignoring the time and time zone information.
+-- #
+-- # example 1: (31.12.2017 23:05 UTC == 01.01.2018 00:05 CET) :
+-- # issuing date (UTC): 31.12.2017 23:05 == 01.01.2018 00:05 CET
+-- # issuingYear = 2017
+-- # issuingDay = 365
+-- # issuingTime = 1385
+-- # local departure date (CET): 01.01.2018 00:15 == 31.12.2017 23:15 UTC
+-- # departureDate = 1 (= 01.01.2018 - 31.12.2017)
+-- # departureTime = 15
+-- # departureUTCOffset = -4 (UTC = local + offset * 15 Minutes)
+-- #
+-- #
+-- # example 2: (01.01.2018 00:05 UTC == 31.12.2017 20:05 AST)
+-- # issuing date (UTC): 01.01.2018 00:05 UTC == 31.12.2017 20:05 AST
+-- # issuingYear = 2018
+-- # issuingDay = 1
+-- # issuingTime = 5
+-- # local departure date (AST): 31.12.2017 22:05 AST == 1.1.2018 02:05 UTC
+-- # departureDate = -1 (= 31.12.2017 - 01.01.2018)
+-- # departureTime = 1325
+-- # departureUTCOffset = 16 (UTC = local + offset * 15 Minutes)
+-- #
+-- # departureDate can become -1 with a departure west of the GMT zone only
+-- #
+-- #
+-- # Tickets might cover multiple time zones where valid from and until is not linked to a specific time zone (e.g. Eurail Pass valid for whole Europe).
+-- # In this case the date times are to be interpreted as local at the actual place where the traveler is and the ticket is checked. The utcOffset must not be
+-- # provided for these local date times.
+-- #
+-- # !!In general the issuing date and time is always UTC whereas the other dates and times are always local.!!
+-- #
+-- # It is RECOMMENDED not to use the utcOffset until there is a need to do so.
+-- #
+-- # ASN.1 Extensions:
+-- #
+-- # The specification makes use of extension (",...").
+-- # These extensions might be defined in future versions of the UIC specification
+-- # Implementations must support the extension feature of ASN.1, at least they must be able to ignore extensions while decoding the data
+-- # ASN.1 extensions will be defined by UIC. It is not allowed to define bilateral extensions.
+-- #
+-- # Bilateral Extensions:
+-- # Bilateral extensions can be included in the data element "ExtensionData".
+-- #
+-- #
+-- #
+-- #########################################################################################
+
+
+-- ############################################################################################
+
+
+-- type assignments
+
+ -- #########################################################################################
+ -- the basic entry point of the data structure
+ -- the data include:
+ -- -issuer informations
+ -- -the details of the transport document
+ -- -informations required for the control process
+ -- -informations on the travelers independent from the transport document
+ -- -proprietary extensions
+ --
+ -- ##########################################################################################
+ UicRailTicketData ::= SEQUENCE {
+ -- data specific to the issuer
+ issuingDetail IssuingData,
+
+ -- data on the travelers
+ travelerDetail TravelerData OPTIONAL,
+
+ -- data of the transport document
+ --!!! proposal: replace this by a comment in the lealet on the total size of the barcode: more than one document to be used on bilateral agreement only
+ transportDocument SEQUENCE OF DocumentData OPTIONAL,
+
+ -- data specific to support the ticket control process
+ controlDetail ControlData OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension SEQUENCE OF ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ###########################################################################################
+ -- the choice on the different transport documents that can be included in the bar code data:
+ -- - reservation of seat / couchette or berths (IRT, RES, BOA)
+ -- - reservation of car carriage (VET)
+ -- - open ticket (NRT including NRT group ticket) (NRT, GRT, SUP, UPD, COI)
+ -- - Rail passes (including Eurail, Interail and local passes) (RPT)
+ -- - Voucher (TRV)
+ -- - Customer Cards (including bonus cards and reduction cards)
+ -- - counter marks issued for group tickets
+ -- - parking ground tickets
+ -- - FIP tickets
+ -- - station access / station passage tickets
+ -- - proprietary documents as an extension
+ -- ############################################################################################
+ DocumentData ::= SEQUENCE {
+
+ -- token
+ -- specific id to be exchanged with the ticket (e.g. id of the phone in case of tickets linked to a phone)
+ token TokenType OPTIONAL,
+
+ -- choice of the ticket
+ ticket CHOICE
+ {
+
+ -- Reservation (without car carriage) (IRT and RES)
+ reservation ReservationData,
+
+
+ -- Reservation of car carriage
+ carCarriageReservation CarCarriageReservationData,
+
+ -- open ticket specification (NRT)
+ openTicket OpenTicketData,
+
+ -- pass specification (RPT) including Eurail and Interrail
+ pass PassData,
+
+ -- voucher
+ voucher VoucherData,
+
+ -- customer card either to identify a customer and / or to provide reductions
+ customerCard CustomerCardData,
+
+ -- countermark to accompagny a group ticket
+ counterMark CountermarkData,
+
+ -- car parking slot
+ parkingGround ParkingGroundData,
+
+ -- FIP duty ticket
+ fipTicket FIPTicketData,
+
+ -- ticket to pass the gates at a station
+ stationPassage StationPassageData,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData,
+
+ -- delay confirmation
+ delayConfirmation DelayConfirmation
+
+ ,...
+ }
+ ,...
+ }
+
+ -- ########################################################################################
+ -- confirmation of the delay of a train
+ --
+ -- ########################################################################################
+ DelayConfirmation ::= SEQUENCE {
+
+ -- reference of the delay confirmation
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- train number of the delayed train - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- planned departure date of the delayed train in local time at the station where delay
+ -- became relevant (see below)
+ -- number of year
+ departureYear INTEGER (2016..2269) OPTIONAL,
+ -- number of the day in the year (1.1. = 1)
+ departureDay INTEGER (1..366) OPTIONAL,
+ departureTime INTEGER (0..1439) OPTIONAL,
+ departureUTCOffset INTEGER (-60..60) OPTIONAL, -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+
+ -- station where the delay became relevant
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- delay in minutes at the mentioned station
+ delay INTEGER (1..999),
+
+ -- indication that the train was cancelled
+ trainCancelled BOOLEAN,
+
+ -- type of confirmation provided
+ confirmationType ConfirmationType DEFAULT travelerDelayConfirmation,
+
+ -- affected original ticket(s)
+ affectedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- info text
+ infoText UTF8String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ ConfirmationType ::= ENUMERATED {
+ trainDelayConfirmation (0), -- confirmation of train delay, whether the traveler was on board in unconfirmed
+ travelerDelayConfirmation (1), -- confirmation that the traveler was on board of the delayed train
+ trainLinkedTicketDelay (2) -- confirmation that a ticket linked to the delayed train was issued
+ ,...
+ }
+
+
+ -- ########################################################################################
+ -- Details of the issuer and the issue of the ticket
+ -- - details on the issuer
+ -- - indication of test tickets (specimen)
+ -- - payment details: method of payment, currency
+ -- - proprietary PNR of the issuer to be used to identify the sale within
+ -- the issuers ecosystem
+ -- - web link to display more information for the customer
+ -- - proprietary extension data
+ -- ########################################################################################
+ IssuingData ::= SEQUENCE {
+
+ -- provider of the signature (RICS code)
+ securityProviderNum INTEGER (1..32000) OPTIONAL,
+ securityProviderIA5 IA5String OPTIONAL,
+
+ -- issuer of the transport document if the issuer is different from the security provider
+ -- (RICS code)
+ issuerNum INTEGER (1..32000) OPTIONAL,
+ issuerIA5 IA5String OPTIONAL,
+
+ -- issuing time stamp in UTC
+ -- number of year
+ issuingYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ issuingDay INTEGER (1..366),
+ -- The number of the minutes of issue might be used in case of account
+ -- based ticketing with a delay of n minutes for the replication of central
+ -- booking data to the control devices (e.g. at SBB)
+ -- The time can be compared with the last synchronization time of
+ -- the control device
+ issuingTime INTEGER (0..1439),
+
+ -- name of the issuer (E.g. short name mentioned in RICS code table)
+ issuerName UTF8String OPTIONAL,
+
+ -- specimen indicates a test specimen not valid for traveling
+ specimen BOOLEAN,
+
+ -- secure paper indicates that this barcode is issued with a secure paper ticket
+ -- to ensure the uniqueness of the ticket. This allows to use the same control
+ -- procedure as for e-tickets also for anonymous tickets
+ -- the double use of the ticket is in this case excluded by the secure paper
+ securePaperTicket BOOLEAN,
+
+ -- indicates that the ticket is valid for traveling or still needs activation
+ activated BOOLEAN,
+
+ -- currency of the price: ISO4217 currency codes
+ currency IA5String (SIZE(3)) DEFAULT "EUR",
+
+ -- fraction of the prices included
+ currencyFract INTEGER (1..3) DEFAULT 2,
+
+ -- PNR used by the issuer to identify the document
+ issuerPNR IA5String OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL,
+
+ -- location of sale in case of a sale on board of a train
+ -- numeric train number or alphanumeric id of the train where the ticket was sold
+ issuedOnTrainNum INTEGER OPTIONAL,
+ issuedOnTrainIA5 IA5String OPTIONAL,
+ -- line number
+ issuedOnLine INTEGER OPTIONAL,
+
+ -- point of sale
+ pointOfSale GeoCoordinateType OPTIONAL
+ ,...
+ }
+
+ -- ###################################################################################
+ -- data supporting the control process
+ -- - list of items which the traveler can use to identify himself or the unique
+ -- usage of the ticket
+ -- (card ids, parts or identity card numbers, credit card numbers,..)
+ -- - hints on the validation to be made on board
+ --
+ -- ###################################################################################
+ ControlData ::= SEQUENCE {
+
+ -- cards that can be used to identify the ticket holder
+ identificationByCardReference SEQUENCE OF CardReferenceType OPTIONAL,
+
+ -- id-card id must be checked to identify the traveler
+ identificationByIdCard BOOLEAN,
+
+ -- passport id must be checked to identify the traveler
+ identificationByPassportId BOOLEAN,
+
+ -- other items which could be used to identify the ticket holder
+ -- (for future use, code list to be defined)
+ identificationItem INTEGER OPTIONAL,
+
+ -- validation of the passport is required (e.g. in case of Eurail)
+ passportValidationRequired BOOLEAN,
+
+ -- online validation of the ticket required
+ onlineValidationRequired BOOLEAN,
+
+ -- percentage of the tickets to be validated in more detail
+ -- (i.e. via online check or detailed checks later-on)
+ randomDetailedValidationRequired INTEGER (0..99) OPTIONAL,
+
+ -- manual validation of the traveler age required (in case of reductions)
+ ageCheckRequired BOOLEAN,
+
+ -- manual validation of the travelers reduction card required (in case of reductions)
+ reductionCardCheckRequired BOOLEAN,
+
+ -- controler info text
+ infoText UTF8String OPTIONAL,
+
+ -- additional tickets that should be controlled
+ includedTickets SEQUENCE OF TicketLinkType OPTIONAL,
+
+ -- proprietary data defined bilaterally
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ################################################################################
+ -- Traveler data
+ -- these data do not include tariff details of the booked tariffs,
+ -- tariff data are included in the transport document details and might
+ -- have a reference to the traveler defined here.
+ -- - personal data of the travellers
+ -- - the index of the list can be used to identify the
+ -- traveler within other contexts (e.g. in assigned tariffs)
+ -- ################################################################################
+ TravelerData ::= SEQUENCE {
+ -- traveler list
+ traveler SEQUENCE OF TravelerType OPTIONAL,
+
+ -- ISO 639-1 coding of the language preferred for the traveler / ticket holder
+ preferredLanguage IA5String (SIZE(2)) OPTIONAL,
+
+ -- name of the group in case of a group ticket
+ groupName UTF8String OPTIONAL
+ ,...
+ }
+
+ -- ####################################################################################
+ -- the following part contains the different transport document specifications
+ -- ####################################################################################
+
+
+ -- ####################################################################################
+ -- reservations of seats , couchettes and berths
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- - information on trach an dplafoorm where the coach stops
+ -- - additional second coach for large groups
+ -- ####################################################################################
+ ReservationData ::= SEQUENCE {
+
+ -- train number - numeric or alphanumeric
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- departure date in local time at the departure station
+ -- number of the days calculated from the issuing date
+ departureDate INTEGER (-1..370) DEFAULT 0,
+
+ -- reservation reference according ton 918.1 in case ade via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code to be used as standard)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (0..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ -- service code list from 918.1 (seat couchette,..)
+ service ServiceType DEFAULT seat,
+
+ -- code table used to encode stations
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ -- origin station code
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- destination station code
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ -- origin station name
+ fromStationNameUTF8 UTF8String OPTIONAL,
+
+ -- destination station name
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- departure time in local time at the departure station
+ departureTime INTEGER (0..1439),
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ departureUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- arrival date and time in local time at the arrival station
+ -- number of days counted from the departure date
+ arrivalDate INTEGER (-1..20) DEFAULT 0,
+ arrivalTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- times to be shown on a ticket should always be the local times
+ arrivalUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- responsible carriers on the route
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+
+ -- service level code list from 918.1
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- places
+ places PlacesType OPTIONAL,
+
+ -- additional places in a second coach
+ additionalPlaces PlacesType OPTIONAL,
+
+ --bicycle places
+ bicyclePlaces PlacesType OPTIONAL,
+
+ -- compartment details (open space, wheelchair,..)
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- number of persons on the ticket without place numbers (on IRT)
+ numberOfOverbooked INTEGER (0..200) DEFAULT 0,
+
+ -- description of berths
+ berth SEQUENCE OF BerthDetailData OPTIONAL,
+
+ -- tariffs included (Adult, Children,... )
+ tariff SEQUENCE OF TariffType OPTIONAL,
+
+ -- type of the price (supplement,... )
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ -- type of supplement - code list from 918.1
+ typeOfSupplement INTEGER (0..9) DEFAULT 0,
+
+ numberOfSupplements INTEGER (0..200) DEFAULT 0,
+
+ -- luggage restrictions and registered luggage
+ -- in case the luggage restrictions are general and do not depend on the
+ -- ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+
+ -- bilaterally agreed proprietary extension
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #################################################################################
+ -- details on the VAT included to be used in after sale processes
+ -- #################################################################################
+ VatDetailType ::= SEQUENCE {
+
+ -- ISO 3166 numeric country code
+ country INTEGER (1..999),
+
+ -- 1/10th of a percent
+ percentage INTEGER (0..999),
+
+ -- amount of VAT, the currency and the currency fraction is included in the issuing data
+ amount INTEGER OPTIONAL,
+
+ -- european tax id of the company paying VAT
+ vatId IA5String OPTIONAL
+
+ }
+
+
+ -- #################################################################################
+ -- reservations of car carriage
+ -- included are the data defined in:
+ -- - leaflet 918.1 for reservation data exchange
+ -- - a few additional data currently used by some railways via different interfaces
+ -- #################################################################################
+ CarCarriageReservationData ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+
+ -- loading of the car in local date and time at the loading station
+ -- number of the days calculated from the issuing date
+ beginLoadingDate INTEGER (-1..370) DEFAULT 0,
+ beginLoadingTime INTEGER (0..1439) OPTIONAL,
+ endLoadingTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- times to be shown on a ticket should always be the local times
+ loadingUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- reservation reference according on 918.1 in case made via Hermes
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ serviceBrand INTEGER (1..32000) OPTIONAL,
+ serviceBrandAbrUTF8 UTF8String OPTIONAL,
+ serviceBrandNameUTF8 UTF8String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUICReservation,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ coach IA5String OPTIONAL,
+ place IA5String OPTIONAL,
+
+ compartmentDetails CompartmentDetailsType OPTIONAL,
+
+ -- description of the car
+ numberPlate IA5String,
+ trailerPlate IA5String OPTIONAL,
+ carCategory INTEGER (0..9),
+ boatCategory INTEGER (0..6) OPTIONAL,
+ textileRoof BOOLEAN,
+ roofRackType RoofRackType DEFAULT norack,
+
+ -- height of a roof rack in cm
+ roofRackHeight INTEGER (0..99) OPTIONAL,
+
+ -- number of boats on a rack
+ attachedBoats INTEGER (0..2) OPTIONAL,
+
+ -- number of biycles on a rack
+ attachedBicycles INTEGER (0..4) OPTIONAL,
+
+ -- number of surf boards on a rack
+ attachedSurfboards INTEGER (0..5) OPTIONAL,
+
+ -- reference to an entry on the loading list
+ loadingListEntry INTEGER (0..999) OPTIONAL,
+ loadingDeck LoadingDeckType DEFAULT upper,
+
+ -- responsible carriers on the route (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ tariff TariffType,
+ priceType PriceTypeType DEFAULT travelPrice,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- data for open tickets (NRT and group tickets)
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.9)
+ -- - additional data based on 108.1 with some extensions as 108.1
+ -- does not provide well structured data,
+ -- especially concerning regional validity
+ --
+ -- #####################################################################################
+
+ OpenTicketData ::= SEQUENCE {
+
+ -- reference must be given either in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- to support other ticket content (e.g. VDV, UTPF, V�V, CALYPSO)
+ -- issuer code using the default code table of the product owner
+ extIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the product owner
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- ticket includes the return trip - should be set to false if it is not relevant (e.g. zones)
+ returnIncluded BOOLEAN,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ -- for tickets valid in regions without from or to stations no station is provided
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ -- return route description
+ -- the return route description can be omitted if it is identical to the
+ -- inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- here it is possible to list the activated days of the ticket:
+ -- day the ticket is activated. The activation is valid from 00:00 to 23:59 in the time zone of the current location of the traveler
+ -- thereby the activation might include more or less that 24 hours in case time zone borders are crossed
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- servicelevel code according to leaflet 918.1 to encode other products
+ -- (e.g. PREMIUM, ...)
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- carriers involved in the transport (RICS codes)
+ -- the indication of carriers is mandatory on international routes, they can be
+ -- listed here but can also be included in viaDetails
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+
+ -- list of service brands for which the ticket is valid
+ -- in case the included service brands are listed all other brands are excluded
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- list of service brands for which the ticket is not valid
+ -- service brand: code list https://uic.org/service-brand-code-list
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ -- additional included open tickets
+ -- e.g. to include local city traffic on parts of a the route
+ includedAddOns SEQUENCE OF IncludedOpenTicketType OPTIONAL,
+
+ -- in case the luggage restrictions are general and do not depend
+ -- on the ticket type they should not be included
+ luggage LuggageRestrictionType OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+
+ -- ####################################################################################
+ -- data for passes
+ -- included are the data defined in:
+ -- - the ticket layout (leaflet 918.8)
+ -- - the ticket bar code version 3 (leaflet 918.8)
+ -- ####################################################################################
+ PassData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceNum INTEGER OPTIONAL,
+ referenceIA5 IA5String OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- type of the pass, code list provided by the product owner
+ -- in case of Eurail:
+ -- 1 = Interrail
+ -- 2 = Eurail
+ -- 3 = Eurail Global (all countries)
+ passType INTEGER (1..250) OPTIONAL,
+
+ -- literal name of the pass
+ passDescription UTF8String OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- begin of validity (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- end of validity (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ -- in case the valid until time is not provided the valid until time is 23.59 (local time)
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- additional validity periods and excluded time ranges
+ validityPeriodDetails ValidityPeriodDetailType OPTIONAL,
+
+ -- max number of days of validity in case the valid from day is open
+
+ numberOfValidityDays INTEGER (0..370) OPTIONAL,
+
+ trainValidity TrainValidityType OPTIONAL,
+
+ -- max number of possible trips to be activated
+ numberOfPossibleTrips INTEGER (1..250) OPTIONAL,
+ numberOfDaysOfTravel INTEGER (1..250) OPTIONAL,
+
+ -- here it is possible to list the activated days of the ticket:
+ -- day the ticket is activated. The activation is valid from 00:00 to 23:59 in the time zone of the current location of the traveler
+ -- thereby the activation might include more or less that 24 hours in case time zone borders are crossed
+ -- travel days of a ticket might be subject to a separate activation to be valid for traveling
+ -- list of activated days in case the entire ticket is not activated
+ -- the day is given by the number of days from the first day of validity
+ -- change in V2 1 -> 0..370
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included countries, code table according to UIC leaflet 918.9
+ countries SEQUENCE OF INTEGER (1..250) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- region description to cover local zones
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+
+ price INTEGER OPTIONAL,
+
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ TrainValidityType ::= SEQUENCE {
+ -- validity for travel depending on the boarding or arrival time to be within the given time range
+
+ -- begin of time range (local time)
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- end of time range (local time)
+ -- number of days from valid from day, 0 = valid on valid-from-date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ -- in case the valid until time is not provided the valid until time is 23.59 (local time)
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- included carriers (RICS codes)
+ includedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ includedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- excluded carriers (RICS codes)
+ excludedCarrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedCarrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ boardingOrArrival BoardingOrArrivalRestrictionType DEFAULT boarding,
+ ...
+
+ }
+
+ ValidityPeriodDetailType ::= SEQUENCE {
+ validityPeriod SEQUENCE OF ValidityPeriodType OPTIONAL,
+ excludedTimeRange SEQUENCE OF TimeRangeType OPTIONAL
+ }
+
+ ValidityPeriodType ::= SEQUENCE {
+
+ -- number of days from issuing date (local date)
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- local time
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- number of days from valid from day, 0 = valid on valid from date
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL
+
+ }
+
+ TimeRangeType ::= SEQUENCE {
+ -- local time
+ fromTime INTEGER (0..1439),
+ -- local time
+ untilTime INTEGER (0..1439)
+ }
+
+ -- ######################################################################################
+ -- data for vouchers
+ -- included are quite basic further study is required
+ -- ######################################################################################
+ VoucherData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date wherever the traveler is located
+ -- valid from 00:00 to 23:59
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370),
+ -- end of validity
+ -- number of year
+ validUntilYear INTEGER (2016..2269),
+ -- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370),
+
+ value INTEGER DEFAULT 0,
+
+ -- type of the voucher, code list defined by the product owner
+ type INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+ -- ###################################################################################
+ -- data for FIP tickets
+ -- included are data from the FIP ticket layout,
+ -- ###################################################################################
+ FIPTicketData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- begin / end of validity in local date time wherever the traveler is located
+ -- valid from 00:00 to 23:59
+ --- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- last day of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+
+ -- activated days: list of days for which the ticket is valid in local date wherever the traveler is located
+ -- the day is given by the number of days from the first day of validity
+ -- 0 = first day of validity
+ activatedDay SEQUENCE OF INTEGER (0..370) OPTIONAL,
+
+ -- included carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- number of travel days allowed
+ numberOfTravelDays INTEGER (1..200),
+ includesSupplements BOOLEAN,
+
+ -- travel class
+ classCode TravelClassType DEFAULT second,
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #####################################################################################
+ -- data station passage and access
+ -- ticket used to enter, exit or pass a station without traveling by train.
+ -- E.g. for staff working in a station.
+ -- #####################################################################################
+ StationPassageData ::= SEQUENCE {
+
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ productName UTF8String OPTIONAL,
+
+ -- code table used to encode he stations
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- list of station where the passage is allowed
+ stationNum SEQUENCE OF INTEGER OPTIONAL,
+ stationIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- station names
+ stationNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- list of areas in a station where the access is allowed
+ areaCodeNum SEQUENCE OF INTEGER OPTIONAL,
+ areaCodeIA5 SEQUENCE OF IA5String OPTIONAL,
+ -- area names
+ areaNameUTF8 SEQUENCE OF UTF8String OPTIONAL,
+
+ -- begin of validity in local date and time of the station
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700),
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- end of validity
+ -- number of days from valid from day, 0 = first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- should be omitted in case it is the same as for begin of validity (might be different in case of changes to summer time)
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- number of days for station passage in case the number of days
+ -- is limited and less that the validity period
+ numberOfDaysValid INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - �BB requirements on card data
+ -- - DB Bahncard as HandyTicket
+ -- note: customer data are included in the traveler data structure
+ -- ######################################################################################
+ CustomerCardData ::= SEQUENCE {
+
+ -- customer details
+ -- optional, as there might be an anonymous cards
+ customer TravelerType OPTIONAL,
+
+ -- card id might be numerical or alphanumerical
+ cardIdIA5 IA5String OPTIONAL,
+ cardIdNum INTEGER OPTIONAL,
+
+ -- begin / end of validity in local date wherever the traveler is located
+ -- begin of validity time is 00:00
+ -- number of year
+ validFromYear INTEGER (2016..2269),
+ --- number of the day in the year (1.1. = 1)
+ validFromDay INTEGER (0..370) OPTIONAL,
+
+ -- number of year from valid from year onwards
+ -- end of validity time is 23:59
+ validUntilYear INTEGER (0..250) DEFAULT 0,
+ --- number of the day in the year (1.1. = 1)
+ validUntilDay INTEGER (0..370) OPTIONAL,
+
+ classCode TravelClassType OPTIONAL,
+
+ -- code of the card type code list defined by the issuer
+ cardType INTEGER (1..1000) OPTIONAL,
+
+ -- readable description of the card type
+ cardTypeDescr UTF8String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- readable customer status "e.g. gold",
+ customerStatusDescr IA5String OPTIONAL,
+
+ -- list of included services,
+ -- 1 = Rail Plus
+ -- 2 = access to launch
+ -- > 50 code list of the issuer
+ includedServices SEQUENCE OF INTEGER OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- data for customer cards
+ -- included are data from:
+ -- - DB parking ground reservation
+ -- #######################################################################################
+ ParkingGroundData ::= SEQUENCE {
+
+ -- booking reference
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ parkingGroundId IA5String,
+
+ -- parking date in time zone of the parking
+ -- validity is the whole day depending on opening hours of the parking facility
+ -- number of days from the issuing date
+ fromParkingDate INTEGER (-367..370),
+ -- number of days from the from parking date in case it is different from that date
+ untilParkingDate INTEGER (0..370) DEFAULT 0,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product code list defined by the product owner
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- code needed to access the parking lot
+ accessCode IA5String OPTIONAL,
+
+ location UTF8String,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the parking ground is associated with a station
+ stationNum INTEGER OPTIONAL,
+ stationIA5 UTF8String OPTIONAL,
+
+ specialInformation UTF8String OPTIONAL,
+ entryTrack UTF8String OPTIONAL,
+ numberPlate IA5String OPTIONAL,
+
+ price INTEGER OPTIONAL,
+ vatDetail SEQUENCE OF VatDetailType OPTIONAL,
+
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- #######################################################################
+ -- data for countermarks issued with group tickets
+ -- included are data from:
+ -- - version 3 bar code (leaflet 918.9)
+ -- - printed layout (leaflet 918.8)
+ -- ########################################################################
+ CountermarkData ::= SEQUENCE {
+
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- reference of the group ticket
+ ticketReferenceIA5 IA5String OPTIONAL,
+ ticketReferenceNum INTEGER OPTIONAL,
+
+ -- sequential number of the countermark
+ numberOfCountermark INTEGER (1..200),
+ -- total number of countermarks
+ totalOfCountermarks INTEGER (1..200),
+ -- name of the group
+ groupName UTF8String,
+
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validRegionDesc UTF8String OPTIONAL,
+ -- specification of the ordered sequence of valid regions
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- ticket includes the return trip
+ returnIncluded BOOLEAN,
+ -- retrurn route description
+ -- can be omitted if it is identical to the inversed outbound validRegion sequence
+ returnDescription ReturnRouteDescriptionType OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ classCode TravelClassType DEFAULT second,
+
+ -- valid carriers
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ infoText UTF8String OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+
+ -- ###########################################################################################
+ -- generic non standard extension element
+ -- the generic non - standard element contains:
+ -- - an extension id to distinguish different extensions
+ -- - the extension data as binary data
+ -- proprietary extensions are by definition proprietary. This standard provides
+ -- the means to identify these extensions
+ -- within the data and to skip these data.
+ -- the evaluation of these data and the unique identification of the extensions
+ -- via the extension id is in the
+ -- responsibility of the railways which use these extensions.
+ -- ###########################################################################################
+ ExtensionData ::= SEQUENCE {
+ extensionId IA5String,
+ extensionData OCTET STRING
+ }
+
+ -- ############################################################################################
+ -- type definitions
+ -- ############################################################################################
+
+ -- #############################################################################################
+ -- included open ticke for a part of the travel (e.g. local city trafic)
+ -- - data identically already included in the covering open ticket do not need to be
+ -- repeated here
+ -- - main source are the data required for included regional and city traffic tickets
+ -- #############################################################################################
+ IncludedOpenTicketType ::= SEQUENCE {
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- product id to identify the issued product codelist defined by the product owner
+ -- !!! productIdNum extended
+ productIdNum INTEGER (0..65535) OPTIONAL,
+ productIdIA5 IA5String OPTIONAL,
+
+ -- issuer code using the default code table of the product owner (today used e.g. by VDV)
+ externalIssuerId INTEGER OPTIONAL,
+ -- authorization id provided to the issuer by the poroduct owner (today used e.g. by VDV)
+ issuerAutorizationId INTEGER OPTIONAL,
+
+ -- regional validity data
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- specification of the ordered sequence of valid regions, ordered in the direction of travel
+ validRegion SEQUENCE OF RegionalValidityType OPTIONAL,
+
+
+ -- date/time validity in local time of the location where the journey starts
+ -- number of days from issuing date
+ validFromDay INTEGER (-367..700) DEFAULT 0,
+ -- in case the valid from time is not provided the valid from time is 00.00 (local time)
+ -- in case UTC offset is provided (NOT RECOMMENDED) the local date time in the time zone of validity region. The region where the ticket is valid must not cover more than one time zone
+ -- in case no UTC offset is provided (RECOMMENDED) the local date time in the time zone of the current location of the traveler
+ validFromTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ validFromUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ -- date/time validity in local time of the location where the journey ends
+ -- number of days from valid-from date, 0 = valid until day is equal to the first day of validity
+ validUntilDay INTEGER (-1..370) DEFAULT 0,
+ validUntilTime INTEGER (0..1439) OPTIONAL,
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ -- the UTC offset can be used to calculate the duration of the travel
+ -- if UTC offset is used in control devices the usage of UTC offset has to be agreed bilateral to be mandatory
+ -- times to be shown on a ticket should always be the local times
+ -- should be omitted in case it is the same as for departure
+ validUntilUTCOffset INTEGER (-60..60) OPTIONAL,
+
+
+ -- travel class to be given in case it differs from the class of the main ticket
+ classCode TravelClassType OPTIONAL,
+ -- servicelevel code according to leaflet 918.1 to encode other products (e.g. PREMIUM, ...)
+ -- to be provided in case it differs from the main ticket
+ serviceLevel IA5String (SIZE(1..2)) OPTIONAL,
+
+ -- valid carriers (RICS codes)
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- service brands where the ticket is valid
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands where the ticket is not valid
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ tariffs SEQUENCE OF TariffType OPTIONAL,
+ infoText UTF8String OPTIONAL,
+
+ -- included or excluded transport modes
+ -- code list: EN 1545-1 (transport type code)
+ -- !!! new data elements
+ includedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+ excludedTransportType SEQUENCE OF INTEGER (0..31) OPTIONAL,
+
+ extension ExtensionData OPTIONAL
+ ,...
+ }
+
+ -- ######################################################################################
+ -- tariff data for open tickets
+ -- information included are:
+ -- - number of passengers
+ -- - optionally a link to the traveler data
+ -- #######################################################################################
+ TariffType ::= SEQUENCE {
+
+ -- number of passengers using the tariff
+ numberOfPassengers INTEGER (1..200) DEFAULT 1,
+
+ -- type indication youth, adult, senior,..
+ passengerType PassengerType OPTIONAL,
+
+ -- age restrictions of the tariff
+ ageBelow INTEGER (1..64) OPTIONAL,
+ ageAbove INTEGER (1..128) OPTIONAL,
+
+
+ -- named traveler list
+ -- link to the traveler in case the travelers have to be named (e.g. Eurail passes)
+ -- the number indicates the position in the traveler list starting from 1
+ -- change V2 0 -> 1..
+ travelerid SEQUENCE OF INTEGER (1..254) OPTIONAL,
+
+ -- restriction on country of residence
+ -- this tariff is restricted by the country of residence given in the traveler data
+ -- (e.g. Eurail tickets are not valid in the contry of residence)
+ restrictedToCountryOfResidence BOOLEAN,
+
+ -- section in case the tariff applies to a part of the route only
+ restrictedToRouteSection RouteSectionType OPTIONAL,
+
+ -- details on series according to leaflet 108.1
+ seriesDataDetails SeriesDetailType OPTIONAL,
+
+ -- tariff code
+ tariffIdNum INTEGER OPTIONAL,
+ tariffIdIA5 IA5String OPTIONAL,
+
+ -- tariff description
+ tariffDesc UTF8String OPTIONAL,
+
+ -- reduction cards applied (incl. discount cards, loyalty cards relevant for the tariff)
+ reductionCard SEQUENCE OF CardReferenceType OPTIONAL
+ ,...
+ }
+
+ SeriesDetailType ::= SEQUENCE {
+
+ -- data related to tariffs based on series according UIC leaflet 108.1
+ -- supplying carrier according to UIC leaflet 108.1 (RICS code)
+ supplyingCarrier INTEGER (1..32000) OPTIONAL,
+
+ -- offer identifier of the carrier according to UIC leaflet 108.1
+ offerIdentification INTEGER (1..99) OPTIONAL,
+
+ -- series of the carrier according to UIC leaflet 108.1
+ series INTEGER OPTIONAL
+ }
+
+
+ RouteSectionType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL, -- IA5 or Num not both
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+ }
+
+
+ -- #######################################################################################
+ -- customer card reference
+ -- #######################################################################################
+ CardReferenceType ::= SEQUENCE {
+
+ -- issuer of the card
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ cardIssuerNum INTEGER (1..32000) OPTIONAL,
+ cardIssuerIA5 IA5String OPTIONAL,
+
+ cardIdNum INTEGER OPTIONAL,
+ cardIdIA5 IA5String OPTIONAL,
+
+ -- Name of the card e.g. "VISA-CARD"
+ cardName UTF8String OPTIONAL,
+
+ -- type of the card, code list defined by the issuer
+ cardType INTEGER OPTIONAL,
+
+ -- in case only the leading part of the card number is provided
+ leadingCardIdNum INTEGER OPTIONAL,
+ leadingCardIdIA5 IA5String OPTIONAL,
+
+
+ -- in case only the trailing part of the card number is provided
+ trailingCardIdNum INTEGER OPTIONAL,
+ trailingCardIdIA5 IA5String OPTIONAL
+
+ ,...
+ }
+
+ -- #######################################################################################
+ -- traveler data
+ -- - traveler data might contain all traveler details which are independent
+ -- from the type of travel document
+ -- e.g. it can include the date of birth as this is part of the traveler
+ -- but not the indication "Senior" as this is tariff dependent
+ --
+ -- #######################################################################################
+ TravelerType ::= SEQUENCE {
+
+ firstName UTF8String OPTIONAL,
+ secondName UTF8String OPTIONAL,
+ lastName UTF8String OPTIONAL,
+ idCard IA5String OPTIONAL,
+ passportId IA5String OPTIONAL,
+ title IA5String (SIZE(1..3)) OPTIONAL,
+ gender GenderType OPTIONAL,
+
+ -- customer id might be numerical or alphanumerical
+ customerIdIA5 IA5String OPTIONAL,
+ customerIdNum INTEGER OPTIONAL,
+
+ -- date of birth
+ -- number of year
+ yearOfBirth INTEGER (1901..2155) OPTIONAL,
+ monthOfBirth INTEGER (1..12) OPTIONAL,
+ dayOfBirthInMonth INTEGER (1..31) OPTIONAL,
+
+ -- indicates the ticket holder/group leader in case of groups
+ ticketHolder BOOLEAN,
+
+ passengerType PassengerType OPTIONAL,
+
+ passengerWithReducedMobility BOOLEAN OPTIONAL,
+
+ -- country of residence (numeric ISO country code)
+ -- to be used in case there product restrictions on the country of residence (e.g. Eurail passes)
+ countryOfResidence INTEGER (1..999) OPTIONAL,
+
+ countryOfPassport INTEGER (1..999) OPTIONAL,
+ countryOfIdCard INTEGER (1..999) OPTIONAL,
+
+ status SEQUENCE OF CustomerStatusType OPTIONAL
+ ,...
+ }
+
+ CustomerStatusType ::= SEQUENCE {
+
+ -- compagny providing the status, default is the issuer
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ statusProviderNum INTEGER (1..32000) OPTIONAL,
+ statusProviderIA5 IA5String OPTIONAL,
+
+ -- customer status code
+ -- 1 = basic
+ -- 2 = premium
+ -- 3 = silver
+ -- 4 = gold
+ -- 5 = platinum
+ -- 6 = senator
+ -- > 50 - code table of the card issuer
+ customerStatus INTEGER OPTIONAL,
+
+ -- customer status "gold"
+ customerStatusDescr IA5String OPTIONAL
+ }
+
+
+ ReturnRouteDescriptionType ::= SEQUENCE {
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL,
+
+ -- description for manual evaluation in case structured data are not available
+ validReturnRegionDesc UTF8String OPTIONAL,
+
+ -- specification of the ordered sequence of valid regions for the return trip
+ validReturnRegion SEQUENCE OF RegionalValidityType OPTIONAL
+ ,...
+
+ }
+
+ -- ######################################################################################
+ -- regional validity of an open ticket
+ -- specification of the regional validity.
+ -- ######################################################################################
+
+ RegionalValidityType ::= CHOICE {
+ trainLink TrainLinkType,
+ viaStations ViaStationType,
+ zones ZoneType,
+ lines LineType,
+ polygone PolygoneType
+ ,...
+ }
+
+
+
+ -- #######################################################################################
+ -- train link data
+ -- includes a restriction of an open ticket valid only on a specific train
+ -- and date on a part of the route
+ -- #######################################################################################
+ TrainLinkType ::= SEQUENCE {
+
+ trainNum INTEGER OPTIONAL,
+ trainIA5 IA5String OPTIONAL,
+
+ -- local date at the station where the train link starts (fromStation)
+ -- days from the issuing date onwards
+ travelDate INTEGER (-1..370),
+ -- time in minutes, local time at the station where the train link starts
+ departureTime INTEGER (0..1439),
+ -- offset in units of 15 minutes from local time to UTC
+ -- (UTC = local + offset * 15 Minutes)
+ departureUTCOffset INTEGER (-60..60) OPTIONAL,
+
+ fromStationNum INTEGER (1..9999999) OPTIONAL,
+ fromStationIA5 IA5String OPTIONAL,
+
+ toStationNum INTEGER (1..9999999) OPTIONAL,
+ toStationIA5 IA5String OPTIONAL,
+
+ fromStationNameUTF8 UTF8String OPTIONAL,
+ toStationNameUTF8 UTF8String OPTIONAL
+
+ }
+
+
+
+ -- ######################################################################################
+ -- regional validity using a set of lines
+ -- - based on data used in regional city trafic enviromnemnts
+ -- ######################################################################################
+ LineType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ -- ids of the valid lines known by the local carriers on that line
+ lineId SEQUENCE OF INTEGER OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+
+ -- in case the line must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey
+ -- starting from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the line must be left via a specific station
+ -- (e.g. local city trafic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the line is part of regional city transport
+ -- code list of the local carrier
+ city INTEGER OPTIONAL
+ ,...
+ }
+
+
+ -- #################################################################################
+ -- regional validity in a zone
+ -- - based on data used in regional city trafic enviromnemnts
+ -- #################################################################################
+ ZoneType ::= SEQUENCE {
+
+ -- local service provider / carrier within the zone
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ carrierNum INTEGER (1..32000) OPTIONAL,
+ carrierIA5 IA5String OPTIONAL,
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- in case the zone must be entered via a specific station
+ -- (e.g. local city traffic at the end of a journey starting
+ -- from the main train station)
+ entryStationNum INTEGER (1..9999999) OPTIONAL,
+ entryStationIA5 IA5String OPTIONAL,
+
+ -- in case the zone must be left via a specific station
+ -- (e.g. local city traffic at the beginning of a journey
+ -- terminating at the main train station)
+ terminatingStationNum INTEGER (1..9999999) OPTIONAL,
+ terminatingStationIA5 IA5String OPTIONAL,
+
+ -- code of the local city in case the zone is part of regional
+ -- city transport code list of the local carrier
+ city INTEGER OPTIONAL,
+
+ -- ids of the valid zones known by the local carriers in that zone
+ zoneId SEQUENCE OF INTEGER OPTIONAL,
+
+ -- binary encoding of zones, encoding specification provided by
+ -- the local service provider
+ binaryZoneId OCTET STRING OPTIONAL,
+
+ -- EU NUTS code for a region
+ nutsCode IA5String OPTIONAL
+ ,...
+ }
+
+
+ -- ##################################################################################
+ -- via station
+ -- includes a description of of the route by via stations.
+ -- Via stations follow the description in leaflet 108.1:
+ -- via stations can e mandatory to pass (but there does not need to be a
+ -- train stop at this stations): visible route description: "*station*"
+ -- there can be a list of alternative routes:
+ -- visible route description: "*(station1/station2)*"
+ -- there can also be alternative routes:
+ -- "*(station1*station2/station3*station4)*" although the
+ -- definition in 108.2 is not very precise on this option
+ -- ###################################################################################
+ ViaStationType ::= SEQUENCE {
+
+ stationCodeTable CodeTableType DEFAULT stationUIC,
+ -- mandatory via station
+ stationNum INTEGER (1..9999999) OPTIONAL,
+ stationIA5 IA5String OPTIONAL,
+
+ -- list of alternative routes, one of these has to be taken
+ alternativeRoutes SEQUENCE OF ViaStationType OPTIONAL,
+
+ -- list of stations along the route
+ route SEQUENCE OF ViaStationType OPTIONAL,
+ border BOOLEAN,
+
+ -- carrier responsible for the transport starting at this station (RICS-Code)
+ -- in case the carrier is included here it might be omitted
+ -- in the carrier list of the region data
+ carrierNum SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+ carrierIA5 SEQUENCE OF IA5String OPTIONAL,
+
+ -- the route id as series number as defined in 108.1 data
+ seriesId INTEGER OPTIONAL,
+
+ -- route id of the route code list defined by the carrier on that route
+ routeId INTEGER OPTIONAL,
+
+ -- service brands valid for the route
+ -- in case this list is provided the ticket is invalid on all other service brands
+ -- service brand: code list https://uic.org/service-brand-code-list
+ includedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL,
+
+ -- service brands valid for the route
+ -- in case this list is provided the ticket is valid on all other service brands
+ excludedServiceBrands SEQUENCE OF INTEGER (1..32000) OPTIONAL
+
+ ,...
+ }
+
+
+ PolygoneType ::= SEQUENCE {
+ firstEdge GeoCoordinateType,
+ edges SEQUENCE OF DeltaCoordinates
+ }
+
+
+ -- ###########################################################################################
+ -- TokenType provides an additional identifier
+ -- known use cases
+ -- - identified of the mobile phone for tickets linked with a specific phone (e.g. VDV standard)
+ -- ###########################################################################################
+ TokenType ::= SEQUENCE {
+ -- provider of the token
+ tokenProviderNum INTEGER OPTIONAL,
+ tokenProviderIA5 IA5String OPTIONAL,
+
+ -- in case the provider has multiple tokens
+ tokenSpecification IA5String OPTIONAL,
+ token OCTET STRING
+ }
+
+ -- ###########################################################################################
+ -- TicketLinkType is used to define a link from the ticket in the bar code to another ticket
+ -- (requirement from Eurail)
+ -- use cases
+ -- - DB Alleo (open ticket + reservation)
+ -- - reservation of trailer and car carriage and traveller reservation
+ -- - link between open ticket and bicycle reservations or pass
+ -- - open ticket and vouchers for meals
+ -- ###########################################################################################
+ TicketLinkType ::= SEQUENCE {
+
+ -- data to reference the external ticket
+ -- reference must be given in numeric or alphanumeric format
+ referenceIA5 IA5String OPTIONAL,
+ referenceNum INTEGER OPTIONAL,
+
+ issuerName UTF8String OPTIONAL, -- name of the issuer
+
+ issuerPNR IA5String OPTIONAL, -- in case the ticket can also be identified via
+ -- the issuer PNR
+
+ -- organization responsible for the product definition
+ -- (RICS Code / proprietary code in case no RICS code is defined, proprietary codes must ensure to be unique)
+ productOwnerNum INTEGER (1..32000) OPTIONAL,
+ productOwnerIA5 IA5String OPTIONAL,
+
+ -- type of linked ticket
+ ticketType TicketType DEFAULT openTicket,
+
+ -- type of link
+ linkMode LinkMode DEFAULT issuedTogether
+ ,...
+ }
+
+ -- ############################################################################################
+ -- code table used fort station codes
+ -- defines the code table used e.g. to define station code
+ -- - stationUIC = station codes as used in UIC leaflet 108.1 for open tickets
+ -- - stationUICReservation = station codes as used in Reservation leaflets 918.1 and 108.2
+ -- ############################################################################################
+
+ CodeTableType ::= ENUMERATED {
+ -- standard UIC station code from MERITS (UIC country code + 5 digit local code)
+ stationUIC (0),
+ -- standard UIC station code for reservation
+ stationUICReservation (1),
+ -- future standard ERA station code
+ stationERA (2),
+ -- local carrier code list
+ -- e.g. in case of stations / stops of non-railways stops (city traffic)
+ localCarrierStationCodeTable (3),
+
+ -- non standard code to be used within the issuer eco system only
+ -- not applicable for multi carrier travel documents
+ -- or in case issuer and carrier are different
+ proprietaryIssuerStationCodeTable (4)
+
+ }
+
+
+ ServiceType ::= ENUMERATED {
+ seat (0),
+ couchette (1),
+ berth (2),
+ carcarriage (3)
+ }
+
+
+ PassengerType ::= ENUMERATED {
+ adult (0),
+ senior (1),
+ child (2),
+ youth (3),
+ dog (4),
+ bicycle (5),
+ freeAddonPassenger (6),
+ freeAddonChild (7)
+ ,...
+ }
+
+ TicketType ::= ENUMERATED {
+ openTicket (0),
+ pass (1),
+ reservation (2),
+ carCarriageReservation (3)
+ ,...
+ }
+
+ LinkMode ::= ENUMERATED {
+ issuedTogether (0),
+ onlyValidInCombination (1)
+ ,...
+ }
+
+
+ -- ####################################################################################
+ -- place data corresponding to leaflet 918.1
+ -- placeString = place number ranges in case of groups
+ -- ####################################################################################
+ PlacesType ::= SEQUENCE {
+ coach IA5String OPTIONAL,
+
+ -- printable place string ("15-18, 21, 22" )
+ placeString IA5String OPTIONAL,
+
+ -- printable place description
+ placeDescription UTF8String OPTIONAL,
+
+ -- individual places
+ placeIA5 SEQUENCE OF IA5String OPTIONAL,
+ placeNum SEQUENCE OF INTEGER (1..254) OPTIONAL
+ }
+
+ PriceTypeType ::= ENUMERATED {
+ noPrice (0),
+ reservationFee (1),
+ supplement (2),
+ travelPrice (3)
+ }
+
+ BerthTypeType ::= ENUMERATED {
+ single (0),
+ special (1),
+ double (2),
+ t2 (3),
+ t3 (4),
+ t4 (5)
+ }
+
+ CompartmentGenderType ::= ENUMERATED {
+ unspecified (0),
+ family (1),
+ female (2),
+ male (3),
+ mixed (4)
+ ,...
+ }
+
+ GenderType ::= ENUMERATED {
+ unspecified (0),
+ female (1),
+ male (2),
+ other (3)
+ ,...
+ }
+
+ TravelClassType ::= ENUMERATED {
+ notApplicable (0),
+ first (1),
+ second (2),
+ tourist (3),
+ comfort (4),
+ premium (5),
+ business (6),
+ all (7),
+ premiumFirst (8),
+ standardFirst (9),
+ premiumSecond (10),
+ standardSecond (11)
+ ,...
+ }
+
+ -- ########################################################################################
+ -- sleeper compartment types corresponding to leaflet 918.1
+ -- ########################################################################################
+ BerthDetailData ::= SEQUENCE {
+ berthType BerthTypeType,
+ numberOfBerths INTEGER (1..999),
+ gender CompartmentGenderType DEFAULT family
+ ,...
+ }
+
+ -- ####################################################################################
+ -- compartment details corresponding to leaflet 918.1
+ -- ####################################################################################
+ CompartmentDetailsType ::= SEQUENCE {
+ coachType INTEGER (1..99) OPTIONAL,
+ compartmentType INTEGER (1..99) OPTIONAL,
+ specialAllocation INTEGER (1..99) OPTIONAL,
+ coachTypeDescr UTF8String OPTIONAL,
+ compartmentTypeDescr UTF8String OPTIONAL,
+ specialAllocationDescr UTF8String OPTIONAL,
+ position CompartmentPositionType DEFAULT unspecified
+ ,...
+ }
+
+
+ -- #####################################################################################
+ -- luggage restrictions
+ -- the basis for these data is week:
+ -- SCIC mentions a maximum of three pieces of hand luggage but does not includes
+ -- a definition of hand luggage
+ -- SCIC refers to special conditions on registered luggage, but SCIC NRT does
+ -- not contain definitions on that and UIC 108.1 does not
+ -- contain data structures for luggage
+ -- - current THALYS luggage restrictions
+ -- #####################################################################################
+ LuggageRestrictionType ::= SEQUENCE {
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxHandLuggagePieces INTEGER(0..99) DEFAULT 3,
+ -- allowed hand luggage pieces on this ticket (3 = default in current NRT tariff)
+ maxNonHandLuggagePieces INTEGER(0..99) DEFAULT 1,
+ registeredLuggage SEQUENCE OF RegisteredLuggageType OPTIONAL
+ ,...
+
+ }
+
+ RegisteredLuggageType ::= SEQUENCE {
+ -- id of the additional registered luggage
+ registrationId IA5String OPTIONAL,
+ -- maximum weight in kg
+ maxWeight INTEGER (1..99) OPTIONAL,
+ -- sum of length with and height in cm
+ maxSize INTEGER (1..300) OPTIONAL
+ ,...
+
+ }
+
+ -- ##########################################################################################
+ -- generic type for geo coordinates
+ -- ##########################################################################################
+ GeoCoordinateType ::= SEQUENCE {
+ geoUnit GeoUnitType DEFAULT milliDegree,
+ coordinateSystem GeoCoordinateSystemType DEFAULT wgs84,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLongitude HemisphereLongitudeType DEFAULT north,
+ -- separate hemishpere flag reduces the data size
+ hemisphereLatitude HemisphereLatitudeType DEFAULT east,
+ longitude INTEGER,
+ latitude INTEGER,
+ accuracy GeoUnitType OPTIONAL
+ }
+
+ DeltaCoordinates ::= SEQUENCE {
+ -- logitude difference to a reference point
+ longitude INTEGER,
+ -- latitude difference to a reference point
+ latitude INTEGER
+ }
+
+ GeoCoordinateSystemType ::= ENUMERATED {
+ wgs84 (0), -- WGS 84 standard system
+ grs80 (1) -- (outdated) GRS 80 coordinate system
+ }
+
+ GeoUnitType ::= ENUMERATED {
+ microDegree (0), -- approx. 11 cm on earth surface
+ tenthmilliDegree (1), -- 1 / 10000 degree is approx. 11 meter on earth surface
+ milliDegree (2), -- approx 110 meter on earth surface
+ centiDegree (3),
+ deciDegree (4)
+ }
+
+ HemisphereLongitudeType ::= ENUMERATED {
+ north (0),
+ south (1)
+ }
+
+ HemisphereLatitudeType ::= ENUMERATED {
+ east (0),
+ west (1)
+ }
+
+ LoadingDeckType ::= ENUMERATED {
+ unspecified (0),
+ upper (1),
+ lower (2)
+ }
+
+ CompartmentPositionType ::= ENUMERATED {
+ unspecified (0),
+ upperLevel (1),
+ lowerLevel (2)
+ }
+
+ RoofRackType ::= ENUMERATED {
+ norack (0),
+ roofRailing (1),
+ luggageRack (2),
+ skiRack (3),
+ boxRack (4),
+ rackWithOneBox (5),
+ rackWithTwoBoxes (6),
+ bicycleRack (7),
+ otherRack (8)
+ ,...
+ }
+
+ BoardingOrArrivalRestrictionType ::= ENUMERATED {
+ boarding (0),
+ arrival (1),
+ ...
+ }
+END \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/Decoder.java b/src/main/java/org/uic/barcode/Decoder.java
index fe53ed0..09ee839 100644
--- a/src/main/java/org/uic/barcode/Decoder.java
+++ b/src/main/java/org/uic/barcode/Decoder.java
@@ -3,6 +3,7 @@ package org.uic.barcode;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
import java.security.PublicKey;
import java.security.SignatureException;
import java.util.zip.DataFormatException;
@@ -89,6 +90,34 @@ public class Decoder {
}
}
+
+ /**
+ * Validate level 1.
+ *
+ * @param key the public key
+ * @param signingAlg the signing algorithm OID
+ * @param security provider in case a dedicated provider must be used (otherwise null)
+ * @return the return code indicating errors
+ * @throws InvalidKeyException the invalid key exception
+ * @throws NoSuchAlgorithmException the no such algorithm exception
+ * @throws SignatureException the signature exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws UnsupportedOperationException the unsupported operation exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws EncodingFormatException the encoding format exception
+ */
+ public int validateLevel1(PublicKey key, String signingAlg, Provider provider) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException, IllegalArgumentException, UnsupportedOperationException, IOException, EncodingFormatException {
+ if (!isStaticHeader(data)) {
+ return dynamicFrame.validateLevel1(key, provider) ;
+ } else {
+ if (staticFrame.verifyByAlgorithmOid(key,signingAlg, provider)) {
+ return Constants.LEVEL1_VALIDATION_OK;
+ } else {
+ return Constants.LEVEL1_VALIDATION_FRAUD;
+ }
+ }
+ }
+
/**
* Validate level 2.
*
@@ -101,6 +130,20 @@ public class Decoder {
return Constants.LEVEL2_VALIDATION_NO_SIGNATURE;
}
}
+
+ /*
+ * Validate level 2.
+ * @param prov - provider of the java security implementation in case a dedicated provider must be used
+ * @return the return code indicating errors
+ */
+ public int validateLevel2(Provider prov) {
+ if (!isStaticHeader(data)) {
+ return dynamicFrame.validateLevel2(prov) ;
+ } else {
+ return Constants.LEVEL2_VALIDATION_NO_SIGNATURE;
+ }
+ }
+
/**
* Decode.
diff --git a/src/main/java/org/uic/barcode/Encoder.java b/src/main/java/org/uic/barcode/Encoder.java
index d971214..e906881 100644
--- a/src/main/java/org/uic/barcode/Encoder.java
+++ b/src/main/java/org/uic/barcode/Encoder.java
@@ -2,6 +2,7 @@ package org.uic.barcode;
import java.io.IOException;
import java.security.PrivateKey;
+import java.security.Provider;
import java.security.PublicKey;
import org.uic.barcode.asn1.datatypesimpl.OctetString;
@@ -120,6 +121,20 @@ public class Encoder {
dynamicFrame.signLevel2(key);
}
}
+
+ /**
+ * Signing level 2 of a dynamic bar code
+ *
+ * @param key the key
+ * @param provider - provider of the java security implementation to be used
+ * @throws Exception the exception
+ */
+ public void signLevel2(PrivateKey key, Provider prov) throws Exception {
+ if (dynamicFrame != null) {
+ dynamicFrame.signLevel2(key, prov);
+ }
+ }
+
/**
* Sets the level 1 algorithm Is.
@@ -193,7 +208,7 @@ public class Encoder {
/**
* Sign level 1 of a dynamic bar code or a static bar code.
*
- * @param securityProvider the security provider
+ * @param securityProvider the security provider (RICS code of the company responsible for the security)
* @param key the key
* @param signingAlg the signing algorithm (OID)
* @param keyId the key id
@@ -216,6 +231,33 @@ public class Encoder {
}
/**
+ * Sign level 1 of a dynamic bar code or a static bar code.
+ *
+ * @param securityProvider the security provider (RICS code of the company responsible for the security)
+ * @param key the key
+ * @param signingAlg the signing algorithm (OID)
+ * @param keyId the key id
+ * @param provider - the provider of the java security implementation
+ * @throws Exception the exception
+ */
+ public void signLevel1(String securityProvider,PrivateKey key,String signingAlg, String keyId, Provider prov) throws Exception {
+ if (dynamicFrame != null) {
+ dynamicFrame.getLevel2SignedData().getLevel1Data().setSecurityProvider(securityProvider);
+ dynamicFrame.getLevel2SignedData().getLevel1Data().setLevel1SigningAlg(signingAlg);
+ dynamicFrame.getLevel2SignedData().getLevel1Data().setKeyId(Long.parseLong(keyId));
+ dynamicFrame.getLevel2SignedData().signLevel1(key, prov);
+ } else if (staticFrame != null) {
+ staticFrame.setSignatureKey(keyId);
+ staticFrame.setSecurityProvider(securityProvider);
+ if (staticFrame.getHeaderRecord()!= null && staticFrame.getHeaderRecord().getIssuer() == null) {
+ staticFrame.getHeaderRecord().setIssuer(securityProvider);
+ }
+ staticFrame.signByAlgorithmOID(key,signingAlg,prov);
+ }
+ }
+
+
+ /**
* Sets the static header parameter.
*
* @param ticketId the ticket id
diff --git a/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java b/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java
index ce6d1b3..ae352d1 100644
--- a/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java
+++ b/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java
@@ -11,7 +11,6 @@ import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
import org.uic.barcode.asn1.datatypes.RestrictedString;
import org.uic.barcode.asn1.datatypes.Sequence;
import org.uic.barcode.asn1.uper.UperEncoder;
-import org.uic.barcode.dynamicContent.DynamicContent;
import org.uic.barcode.dynamicFrame.DataType;
diff --git a/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java b/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java
index 375e2c6..6cc1eaa 100644
--- a/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java
+++ b/src/main/java/org/uic/barcode/dynamicFrame/DynamicFrame.java
@@ -4,6 +4,7 @@ import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
+import java.security.Provider;
import java.security.PublicKey;
import java.security.Signature;
import java.security.SignatureException;
@@ -111,9 +112,22 @@ public class DynamicFrame extends Object{
*
*/
public int validateLevel2() {
+
+ return validateLevel2(null);
+
+ }
+
+ /**
+ * Verify the level 2 signature
+ *
+ * Note: an appropriate security provider (e.g. BC) must be registered before
+ *
+ */
+ public int validateLevel2(Provider prov) {
String level2KeyAlg = this.getLevel2SignedData().getLevel1Data().level2KeyAlg;
+
if (level2KeyAlg == null || level2KeyAlg.length() == 0) {
return Constants.LEVEL2_VALIDATION_NO_KEY;
@@ -122,9 +136,7 @@ public class DynamicFrame extends Object{
if (this.level2Signature.toByteArray() == null || this.level2Signature.toByteArray().length == 0) {
return Constants.LEVEL2_VALIDATION_NO_SIGNATURE;
}
-
-
-
+
String keyAlgName = null;
try {
keyAlgName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, level2KeyAlg);
@@ -134,28 +146,36 @@ public class DynamicFrame extends Object{
if (keyAlgName == null || keyAlgName.length() == 0) {
return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED;
}
-
+
PublicKey key = null;
try {
- key = KeyFactory.getInstance(keyAlgName).generatePublic(new X509EncodedKeySpec(this.getLevel2SignedData().getLevel1Data().level2publicKey.toByteArray()));
+ byte[] keyBytes = this.getLevel2SignedData().getLevel1Data().level2publicKey.toByteArray();
+ X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
+ key = KeyFactory.getInstance(keyAlgName).generatePublic(keySpec);
} catch (InvalidKeySpecException | NoSuchAlgorithmException e1) {
return Constants.LEVEL2_VALIDATION_KEY_ALG_NOT_IMPLEMENTED;
}
//find the algorithm name for the signature OID
- String algo = null;
+ String level2SigAlg = this.getLevel2SignedData().getLevel1Data().level2SigningAlg;
+
+ String sigAlgName = null;
try {
- algo = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,this.getLevel2SignedData().getLevel1Data().level2SigningAlg);
+ sigAlgName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_SIGNATURE_ALG,level2SigAlg);
} catch (Exception e1) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
- if (algo == null) {
+ if (sigAlgName == null) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
Signature sig;
try {
- sig = Signature.getInstance(algo);
+ if (prov == null) {
+ sig = Signature.getInstance(sigAlgName);
+ } else {
+ sig = Signature.getInstance(sigAlgName, prov);
+ }
} catch (NoSuchAlgorithmException e) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
@@ -166,7 +186,8 @@ public class DynamicFrame extends Object{
}
try {
- sig.update(UperEncoder.encode(level2SignedData));
+ byte[] data = UperEncoder.encode(level2SignedData);
+ sig.update(data);
} catch (SignatureException e) {
return Constants.LEVEL2_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
} catch (IllegalArgumentException e) {
@@ -193,7 +214,7 @@ public class DynamicFrame extends Object{
* Note: an appropriate security provider (e.g. BC) must be registered before
*
*/
- public int validateLevel1(PublicKey key) {
+ public int validateLevel1(PublicKey key, Provider prov) {
if (this.level2SignedData == null) {
return Constants.LEVEL1_VALIDATION_NO_SIGNATURE;
@@ -219,7 +240,12 @@ public class DynamicFrame extends Object{
Signature sig;
try {
- sig = Signature.getInstance(algo);
+ if (prov != null) {
+ sig = Signature.getInstance(algo, prov);
+ } else {
+ sig = Signature.getInstance(algo);
+
+ }
} catch (NoSuchAlgorithmException e) {
return Constants.LEVEL1_VALIDATION_SIG_ALG_NOT_IMPLEMENTED;
}
@@ -251,6 +277,18 @@ public class DynamicFrame extends Object{
}
}
+ /**
+ * Verify the level 1 signature
+ *
+ * Note: an appropriate security provider (e.g. BC) must be registered before
+ *
+ */
+ public int validateLevel1(PublicKey key) {
+
+ return validateLevel1(key, null);
+
+ }
+
public void signLevel2(PrivateKey key) throws Exception {
//find the algorithm name for the signature OID
@@ -259,9 +297,23 @@ public class DynamicFrame extends Object{
sig.initSign(key);
byte[] data = level2SignedData.encode();
sig.update(data);
+ byte[] signature = sig.sign();
+ this.level2Signature = new OctetString(signature);
+
+ }
+
+ public void signLevel2(PrivateKey key, Provider prov) throws Exception {
+
+ //find the algorithm name for the signature OID
+ String algo = AlgorithmNameResolver.getSignatureAlgorithmName(this.getLevel2SignedData().getLevel1Data().level2SigningAlg);
+ Signature sig = Signature.getInstance(algo,prov);
+ sig.initSign(key);
+ byte[] data = level2SignedData.encode();
+ sig.update(data);
this.level2Signature = new OctetString(sig.sign());
}
+
public void addLevel2DynamicData(UicDynamicContentDataFDC1 dynamicData) {
this.getLevel2SignedData().setLevel2Data( dynamicData.getDataType());
diff --git a/src/main/java/org/uic/barcode/dynamicFrame/Level2DataType.java b/src/main/java/org/uic/barcode/dynamicFrame/Level2DataType.java
index dbd25ce..8c3cd60 100644
--- a/src/main/java/org/uic/barcode/dynamicFrame/Level2DataType.java
+++ b/src/main/java/org/uic/barcode/dynamicFrame/Level2DataType.java
@@ -1,6 +1,7 @@
package org.uic.barcode.dynamicFrame;
import java.security.PrivateKey;
+import java.security.Provider;
import java.security.Signature;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -95,6 +96,26 @@ public class Level2DataType {
this.level1Signature = new OctetString(sig.sign());
}
+ /**
+ * Sign the contained data block.
+ *
+ * Note: an appropriate security provider (e.g. BC) must be registered before
+ *
+ * @param key the key
+ * @param security provider - security provider that must be sued to create the signature
+ * @return
+ * @return the byte[]
+ * @throws Exception
+ */
+ public void signLevel1(PrivateKey key, Provider prov) throws Exception {
+ //find the algorithm name for the signature OID
+ String algo = AlgorithmNameResolver.getSignatureAlgorithmName(getLevel1Data().level1SigningAlg);
+ Signature sig = Signature.getInstance(algo, prov);
+ sig.initSign(key);
+ byte[] data = level1Data.encode();
+ sig.update(data);
+ this.level1Signature = new OctetString(sig.sign());
+ }
}
diff --git a/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java b/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java
index 2759bf0..8dc1adb 100644
--- a/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java
+++ b/src/main/java/org/uic/barcode/staticFrame/StaticFrame.java
@@ -677,6 +677,39 @@ public class StaticFrame {
sig.update(getDataForSignature());
return sig.verify(this.getSignature());
}
+
+ /**
+ * Verify the signature
+ *
+ * Note: an appropriate security provider (e.g. BC) must be registered before
+ *
+ * @param key the key
+ * @param singningAlg the Object ID of the signing algorithm
+ * @param a dedicated security provider to validate the signature
+ * @return true, if successful
+ * @throws InvalidKeyException the invalid key exception
+ * @throws NoSuchAlgorithmException the no such algorithm exception
+ * @throws SignatureException the signature exception
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws UnsupportedOperationException the unsupported operating exception
+ * @throws EncodingFormatException
+ * @throws IOException
+ */
+ public boolean verifyByAlgorithmOid(PublicKey key, String signingAlg, Provider prov) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException, IllegalArgumentException, UnsupportedOperationException, IOException, EncodingFormatException {
+ //find the algorithm name for the signature OID
+ String algo = null;
+ Service service = prov.getService("Signature",signingAlg);
+ if (service != null) {
+ algo = service.getAlgorithm();
+ }
+ if (algo == null) {
+ throw new NoSuchAlgorithmException("No service for algorithm found: " + signingAlg);
+ }
+ Signature sig = Signature.getInstance(algo);
+ sig.initVerify(key);
+ sig.update(getDataForSignature());
+ return sig.verify(this.getSignature());
+ }
/**
* Sign the contained data block.
@@ -695,14 +728,51 @@ public class StaticFrame {
public void signByAlgorithmOID(PrivateKey key,String signingAlg) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, IOException, EncodingFormatException {
//find the algorithm name for the signature OID
String algo = null;
+ algo = getAlgo(signingAlg);
+ if (algo == null) {
+ throw new NoSuchAlgorithmException("No service for algorthm found: " + signingAlg);
+ }
+ Signature sig = Signature.getInstance(algo);
+ sig.initSign(key);
+ signedData = getDataForSignature();
+ sig.update(signedData);
+ signature = sig.sign();
+ }
+
+ private String getAlgo(String signingAlg) {
Provider[] provs = Security.getProviders();
for (Provider prov : provs) {
Service service = prov.getService("Signature",signingAlg);
if (service != null) {
- algo = service.getAlgorithm();
- break;
+ return service.getAlgorithm();
}
}
+ return null;
+ }
+
+
+
+ /**
+ * Sign the contained data block.
+ *
+ * Note: an appropriate security provider (e.g. BC) must be registered before
+ *
+ * @param key the key
+ * @param singningAlg the Object ID of the signing algorithm
+ * @return
+ * @throws NoSuchAlgorithmException the no such algorithm exception
+ * @throws InvalidKeyException the invalid key exception
+ * @throws SignatureException the signature exception
+ * @throws EncodingFormatException
+ * @throws IOException
+ */
+ public void signByAlgorithmOID(PrivateKey key,String signingAlg, Provider prov) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, IOException, EncodingFormatException {
+ //find the algorithm name for the signature OID
+ String algo = null;
+ Service service = prov.getService("Signature",signingAlg);
+ if (service != null) {
+ algo = service.getAlgorithm();
+ }
if (algo == null) {
throw new NoSuchAlgorithmException("No service for algorthm found: " + signingAlg);
}
@@ -713,6 +783,7 @@ public class StaticFrame {
signature = sig.sign();
}
+
/**
* Sign the contained data block.
*
diff --git a/src/main/java/org/uic/barcode/ticket/UicRailTicketCoder.java b/src/main/java/org/uic/barcode/ticket/UicRailTicketCoder.java
index 62fda2d..e9d2eb4 100644
--- a/src/main/java/org/uic/barcode/ticket/UicRailTicketCoder.java
+++ b/src/main/java/org/uic/barcode/ticket/UicRailTicketCoder.java
@@ -10,8 +10,10 @@ import java.io.InputStream;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoder;
import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV2;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoder;
import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV2;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
/**
@@ -44,7 +46,14 @@ public class UicRailTicketCoder {
return uicEncoder.encode(uicRailTicket);
+ } else if (version == 3) {
+
+ Api2OpenAsnEncoderV3 uicEncoder = new Api2OpenAsnEncoderV3();
+
+ return uicEncoder.encode(uicRailTicket);
+
}
+
throw new EncodingFormatException(String.format("Encoding version %d not supported", version));
@@ -86,7 +95,19 @@ public class UicRailTicketCoder {
return;
+
+ } else if (version == 3) {
+
+ Api2OpenAsnEncoderV3 uicEncoder = new Api2OpenAsnEncoderV3();
+
+ org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData asnUicRailTicketData = uicEncoder.populateToAsn1Model(uicRailTicket);
+
+ outputStream.write(asnUicRailTicketData.encode());
+
+ return;
+
}
+
throw new EncodingFormatException(String.format("Encoding version %d not supported", version));
@@ -118,7 +139,16 @@ public class UicRailTicketCoder {
return uicRailTicket;
+ } else if (version == 3) {
+
+ OpenAsn2ApiDecoderV3 uicDecoder = new OpenAsn2ApiDecoderV3();
+
+ IUicRailTicket uicRailTicket = uicDecoder.decodeFromAsn(byteData);
+
+ return uicRailTicket;
+
}
+
throw new EncodingFormatException(String.format("Encoding version %d not supported", version));
@@ -135,7 +165,7 @@ public class UicRailTicketCoder {
*/
public IUicRailTicket decodeFromAsn (InputStream input, int version) throws IOException, EncodingFormatException{
- if (version != 1 && version != 2 && version != 13) {
+ if (version != 1 && version != 2 && version != 13 && version != 3) {
throw new EncodingFormatException(String.format("Encoding version %d not supported", version));
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java
index 8142ee1..d88d4dd 100644
--- a/src/main/java/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java
@@ -54,7 +54,7 @@ public class ParkingGroundData extends Object {
@Asn1Optional public Long fromParkingDate;
@FieldOrder(order = 4)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long toParkingDate;
@FieldOrder(order = 5)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java
index 0eec185..b917bf8 100644
--- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java
@@ -50,7 +50,7 @@ public class ParkingGroundData extends Object {
public String parkingGroundId = "";
@FieldOrder(order = 3)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long fromParkingDate;
@FieldOrder(order = 4)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthDetailData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthDetailData.java
new file mode 100644
index 0000000..c2949ec
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthDetailData.java
@@ -0,0 +1,79 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class BerthDetailData extends Object {
+ public BerthDetailData() {
+ }
+
+ @FieldOrder(order = 0)
+ public BerthTypeType berthType;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1, maxValue=999)
+ public Long numberOfBerths;
+
+ @FieldOrder(order = 2)
+ @Asn1Default(value="family")
+ @Asn1Optional public CompartmentGenderType gender;
+
+
+ public BerthTypeType getBerthType() {
+ return this.berthType;
+ }
+
+ public Long getNumberOfBerths() {
+ return this.numberOfBerths;
+ }
+
+ public CompartmentGenderType getGender() {
+
+ if (gender == null){
+ return CompartmentGenderType.family;
+ } else {
+ return this.gender;
+ }
+ }
+
+ public void setBerthType(BerthTypeType berthType) {
+
+ this.berthType = berthType;
+ }
+
+ public void setNumberOfBerths(Long numberOfBerths) {
+ this.numberOfBerths = numberOfBerths;
+ }
+
+ public void setGender(CompartmentGenderType gender) {
+ this.gender = gender;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthTypeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthTypeType.java
new file mode 100644
index 0000000..1da99bf
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BerthTypeType.java
@@ -0,0 +1,41 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum BerthTypeType {
+ single("single"),
+ special("special"),
+ double_("double_"),
+ t2("t2"),
+ t3("t3"),
+ t4("t4");
+
+
+ public String text;
+
+ BerthTypeType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BoardingOrArrivalType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BoardingOrArrivalType.java
new file mode 100644
index 0000000..3693730
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/BoardingOrArrivalType.java
@@ -0,0 +1,39 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum BoardingOrArrivalType {
+ boarding("boarding"),
+ arrival("arrival");
+
+ public String text;
+
+ BoardingOrArrivalType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java
new file mode 100644
index 0000000..9b4ce84
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java
@@ -0,0 +1,734 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+
+
+@Sequence
+@HasExtensionMarker
+public class CarCarriageReservationData extends Object {
+ public CarCarriageReservationData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger trainNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trainIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long beginLoadingDate;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long beginLoadingTime;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long endLoadingTime;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long loadingUTCOffset;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 8)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 10)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 11)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long serviceBrand;
+
+ @FieldOrder(order = 13)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String serviceBrandAbrUTF8;
+
+ @FieldOrder(order = 14)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String serviceBrandNameUTF8;
+
+ @FieldOrder(order = 15)
+ @Asn1Default("stationUICReservation")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 16)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 17)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 18)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 19)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 20)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 21)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ @FieldOrder(order = 22)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String coach;
+
+ @FieldOrder(order = 23)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String place;
+
+ @FieldOrder(order = 24)
+ @Asn1Optional public CompartmentDetailsType compartmentDetails;
+
+ @FieldOrder(order = 25)
+ @RestrictedString(CharacterRestriction.IA5String)
+ public String numberPlate;
+
+ @FieldOrder(order = 26)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trailerPlate;
+
+ @FieldOrder(order = 27)
+ @IntRange(minValue=0,maxValue=9)
+ public Long carCategory;
+
+ @FieldOrder(order = 28)
+ @IntRange(minValue=0,maxValue=6)
+ @Asn1Optional public Long boatCategory;
+
+ @FieldOrder(order = 29)
+ public Boolean textileRoof = false;
+
+ @FieldOrder(order = 30)
+ @Asn1Default(value ="norack")
+ @Asn1Optional public RoofRackType roofRackType;
+
+ @FieldOrder(order = 31)
+ @IntRange(minValue=0,maxValue=99)
+ @Asn1Optional public Long roofRackHeight;
+
+ @FieldOrder(order = 32)
+ @IntRange(minValue=0,maxValue=2)
+ @Asn1Optional public Long attachedBoats;
+
+ @FieldOrder(order = 33)
+ @IntRange(minValue=0,maxValue=4)
+ @Asn1Optional public Long attachedBicycles;
+
+ @FieldOrder(order = 34)
+ @IntRange(minValue=0,maxValue=5)
+ @Asn1Optional public Long attachedSurfboards;
+
+ @FieldOrder(order = 35)
+ @IntRange(minValue=0,maxValue=999)
+ @Asn1Optional public Long loadingListEntry;
+
+ @FieldOrder(order = 36)
+ @Asn1Default(value="upper")
+ @Asn1Optional public LoadingDeckType loadingDeck;
+
+ @FieldOrder(order = 37)
+ @Asn1Optional public SequenceOfCarrierNum carrierNum;
+
+ @FieldOrder(order = 38)
+ @Asn1Optional public SequenceOfStringIA5 carrierIA5;
+
+ @FieldOrder(order = 39)
+ public TariffType tariff;
+
+ @FieldOrder(order = 40)
+ @Asn1Default(value="travelPrice")
+ @Asn1Optional public PriceTypeType priceType;
+
+ @FieldOrder(order = 41)
+ @Asn1Optional Asn1BigInteger price;
+
+ @FieldOrder(order = 42)
+ @Asn1Optional SequenceOfVatDetail vatDetails;
+
+ @FieldOrder(order = 43)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 44)
+ @Asn1Optional public ExtensionData extension;
+
+ public Long getTrainNum() {
+ if (this.trainNum == null) return null;
+ return Asn1BigInteger.toLong(this.trainNum);
+ }
+
+ public String getTrainIA5() {
+
+ return this.trainIA5;
+ }
+
+ public Long getBeginLoadingDate() {
+
+ return this.beginLoadingDate;
+ }
+
+ public Long getBeginLoadingTime() {
+
+ if (beginLoadingTime == null) return new Long(0);
+ return beginLoadingTime;
+ }
+
+ public Long getEndLoadingTime() {
+
+ return this.endLoadingTime;
+ }
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Long getReferenceNum() {
+ return Asn1BigInteger.toLong(this.referenceNum);
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getServiceBrand() {
+
+ return this.serviceBrand;
+ }
+
+ public String getServiceBrandAbrUTF8() {
+
+ return this.serviceBrandAbrUTF8;
+ }
+
+ public String getServiceBrandNameUTF8() {
+
+ return this.serviceBrandNameUTF8;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUICReservation;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public String getCoach() {
+
+ return this.coach;
+ }
+
+ public String getPlace() {
+
+ return this.place;
+ }
+
+ public CompartmentDetailsType getCompartmentDetails() {
+
+ return this.compartmentDetails;
+ }
+
+ public String getNumberPlate() {
+
+ return this.numberPlate;
+ }
+
+ public String getTrailerPlate() {
+
+ return this.trailerPlate;
+ }
+
+ public Long getCarCategory() {
+
+ return this.carCategory;
+ }
+
+ public Long getBoatCategory() {
+
+ return this.boatCategory;
+ }
+
+ public Boolean getTextileRoof() {
+
+ return this.textileRoof;
+ }
+
+ public RoofRackType getRoofRackType() {
+
+ if (this.roofRackType == null) return RoofRackType.norack;
+ return this.roofRackType;
+ }
+
+ public Long getRoofRackHeight() {
+
+ return this.roofRackHeight;
+ }
+
+ public Long getAttachedBoats() {
+
+ return this.attachedBoats;
+ }
+
+ public Long getAttachedBicycles() {
+
+ return this.attachedBicycles;
+ }
+
+ public Long getAttachedSurfboards() {
+
+ return this.attachedSurfboards;
+ }
+
+ public Long getLoadingListEntry() {
+
+ return this.loadingListEntry;
+ }
+
+ public LoadingDeckType getLoadingDeck() {
+
+ if (this.loadingDeck == null) return LoadingDeckType.upper;
+ return this.loadingDeck;
+ }
+
+ public SequenceOfCarrierNum getCarrierNum() {
+
+ return this.carrierNum;
+ }
+
+ public SequenceOfStringIA5 getCarrierIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public TariffType getTariff() {
+
+ return this.tariff;
+ }
+
+ public PriceTypeType getPriceType() {
+ if (this.priceType == null) return PriceTypeType.travelPrice;
+ return this.priceType;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setTrainNum(Long trainNum) {
+
+ this.trainNum = new Asn1BigInteger(trainNum);
+ }
+
+ public void setTrainIA5(String trainIA5) {
+
+ this.trainIA5 = trainIA5;
+ }
+
+ public void setBeginLoadingDate(Long beginLoadingDate) {
+
+ this.beginLoadingDate = beginLoadingDate;
+ }
+
+ public void setBeginLoadingTime(Long beginLoadingTime) {
+
+ this.beginLoadingTime = beginLoadingTime;
+ }
+
+ public void setEndLoadingTime(Long endLoadingTime) {
+ this.endLoadingTime = endLoadingTime;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setServiceBrand(Long serviceBrand) {
+
+ this.serviceBrand = serviceBrand;
+ }
+
+ public void setServiceBrandAbrUTF8(String serviceBrandAbrUTF8) {
+
+ this.serviceBrandAbrUTF8 = serviceBrandAbrUTF8;
+ }
+
+ public void setServiceBrandNameUTF8(String serviceBrandNameUTF8) {
+
+ this.serviceBrandNameUTF8 = serviceBrandNameUTF8;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+ public void setCoach(String coach) {
+
+ this.coach = coach;
+ }
+
+ public void setPlace(String place) {
+
+ this.place = place;
+ }
+
+ public void setCompartmentDetails(CompartmentDetailsType compartmentDetails) {
+
+ this.compartmentDetails = compartmentDetails;
+ }
+
+ public void setNumberPlate(String numberPlate) {
+
+ this.numberPlate = numberPlate;
+ }
+
+ public void setTrailerPlate(String trailerPlate) {
+
+ this.trailerPlate = trailerPlate;
+ }
+
+ public void setCarCategory(Long carCategory) {
+
+ this.carCategory = carCategory;
+ }
+
+ public void setBoatCategory(Long boatCategory) {
+
+ this.boatCategory = boatCategory;
+ }
+
+ public void setTextileRoof(Boolean textileRoof) {
+
+ this.textileRoof = textileRoof;
+ }
+
+ public void setRoofRackType(RoofRackType roofRackType) {
+
+ this.roofRackType = roofRackType;
+ }
+
+ public void setRoofRackHeight(Long roofRackHeight) {
+
+ this.roofRackHeight = roofRackHeight;
+ }
+
+ public void setAttachedBoats(Long attachedBoats) {
+
+ this.attachedBoats = attachedBoats;
+ }
+
+ public void setAttachedBicycles(Long attachedBicycles) {
+
+ this.attachedBicycles = attachedBicycles;
+ }
+
+ public void setAttachedSurfboards(Long attachedSurfboards) {
+
+ this.attachedSurfboards = attachedSurfboards;
+ }
+
+ public void setLoadingListEntry(Long loadingListEntry) {
+
+ this.loadingListEntry = loadingListEntry;
+ }
+
+ public void setLoadingDeck(LoadingDeckType loadingDeck) {
+
+ this.loadingDeck = loadingDeck;
+ }
+
+ public void setCarrierNum(SequenceOfCarrierNum carrierNum) {
+
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarrierNum(List<Long> longs) {
+ if (longs == null || longs.isEmpty()) return;
+ this.carrierNum = new SequenceOfCarrierNum(longs);
+ }
+
+
+ public void setCarrierIA5(SequenceOfStringIA5 carrierIA5) {
+
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setTariff(TariffType tariff) {
+
+ this.tariff = tariff;
+ }
+
+ public void setPriceType(PriceTypeType priceType) {
+
+ this.priceType = priceType;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public Long getPrice() {
+ return Asn1BigInteger.toLong(price);
+ }
+
+ public void setPrice(Long price) {
+ this.price = Asn1BigInteger.toAsn1(price);
+ }
+
+ public SequenceOfVatDetail getVatDetails() {
+ return vatDetails;
+ }
+
+ public void setVatDetails(SequenceOfVatDetail vatDetails) {
+ this.vatDetails = vatDetails;
+ }
+
+ public void addVatDetail(VatDetailType vatDetail) {
+ if (this.vatDetails == null) {
+ this.vatDetails = new SequenceOfVatDetail();
+ }
+ this.vatDetails.add(vatDetail);
+ }
+
+ public void setLoadingDates (Date beginLoading, Date endLoading, Date issuingDate){
+
+ if (issuingDate == null || beginLoading == null) return;
+
+ this.beginLoadingDate = DateTimeUtils.getDateDifference(issuingDate,beginLoading);
+ this.beginLoadingTime = DateTimeUtils.getTime(beginLoading);
+
+ if (endLoading != null) {
+ this.endLoadingTime = DateTimeUtils.getTime(endLoading);
+ }
+ }
+
+ public Date getBeginLoadingDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.beginLoadingDate == null) {
+ this.beginLoadingDate = 0L;
+ }
+
+ return DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.beginLoadingTime);
+
+ }
+
+ public Date getEndLoadingDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.beginLoadingDate == null) {
+ this.beginLoadingDate = 0L;
+ }
+
+ if (this.endLoadingTime == null) {
+ return null;
+ }
+
+ Date begin = DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.beginLoadingTime);
+ Date end = DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.endLoadingTime);
+
+ //max one day difference assumed
+ if (end.before(begin)) {
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ cal.setTime(end);
+ cal.add(Calendar.DAY_OF_YEAR,1);
+ return cal.getTime();
+ } else {
+ return end;
+ }
+
+ }
+
+ public Long getLoadingUTCOffset() {
+ return loadingUTCOffset;
+ }
+
+ public void setLoadingUTCOffset(Long loadingUTCOffset) {
+ this.loadingUTCOffset = loadingUTCOffset;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CardReferenceType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CardReferenceType.java
new file mode 100644
index 0000000..01778f3
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CardReferenceType.java
@@ -0,0 +1,182 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.math.BigInteger;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class CardReferenceType extends Object {
+ public CardReferenceType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger cardIssuerNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String cardIssuerIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger cardIdNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String cardIdIA5;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String cardName;
+
+ @FieldOrder(order = 5)
+ @Asn1Optional public Asn1BigInteger cardType;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public Asn1BigInteger leadingCardIdNum;
+
+ @FieldOrder(order = 7)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String leadingCardIdIA5;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public Asn1BigInteger trailingCardIdNum;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trailingCardIdIA5;
+
+ public Asn1BigInteger getCardIssuerNum() {
+
+ return this.cardIssuerNum;
+ }
+
+ public String getCardIssuerIA5() {
+
+ return this.cardIssuerIA5;
+ }
+
+ public Asn1BigInteger getCardIdNum() {
+
+ return this.cardIdNum;
+ }
+
+ public String getCardIdIA5() {
+
+ return this.cardIdIA5;
+ }
+
+ public String getCardName() {
+
+ return this.cardName;
+ }
+
+ public Asn1BigInteger getCardType() {
+ return this.cardType;
+ }
+
+ public BigInteger getLeadingCardIdNum() {
+ if (leadingCardIdNum != null) {
+ return leadingCardIdNum.toBigInteger();
+ }
+ return null;
+ }
+
+ public String getLeadingCardIdIA5() {
+
+ return this.leadingCardIdIA5;
+ }
+
+ public Long getTrailingCardIdNum() {
+
+ return Asn1BigInteger.toLong(this.trailingCardIdNum);
+ }
+
+ public String getTrailingCardIdIA5() {
+
+ return this.trailingCardIdIA5;
+ }
+
+ public void setCardIssuerNum(Long cardIssuerNum) {
+
+ this.cardIssuerNum = Asn1BigInteger.toAsn1(cardIssuerNum);
+ }
+
+ public void setCardIssuerIA5(String cardIssuerIA5) {
+
+ this.cardIssuerIA5 = cardIssuerIA5;
+ }
+
+ public void setCardIdNum(Asn1BigInteger asn1BigInteger) {
+
+ this.cardIdNum = asn1BigInteger;
+ }
+
+ public void setCardIdNum(Long cardIdNum) {
+
+ this.cardIdNum = new Asn1BigInteger(cardIdNum);
+ }
+
+ public void setCardIdIA5(String cardIdIA5) {
+
+ this.cardIdIA5 = cardIdIA5;
+ }
+
+ public void setCardName(String cardName) {
+
+ this.cardName = cardName;
+ }
+
+ public void setCardType(Long cardType) {
+
+ this.cardType = Asn1BigInteger.toAsn1(cardType);
+ }
+
+ public void setLeadingCardIdNum(Long leadingCardIdNum) {
+
+ this.leadingCardIdNum = Asn1BigInteger.toAsn1(leadingCardIdNum);
+ }
+
+ public void setLeadingCardIdIA5(String leadingCardIdIA5) {
+
+ this.leadingCardIdIA5 = leadingCardIdIA5;
+ }
+
+ public void setTrailingCardIdNum(Long trailingCardIdNum) {
+
+ this.trailingCardIdNum = Asn1BigInteger.toAsn1(trailingCardIdNum);
+ }
+
+ public void setTrailingCardIdIA5(String trailingCardIdIA5) {
+
+ this.trailingCardIdIA5 = trailingCardIdIA5;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CodeTableType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CodeTableType.java
new file mode 100644
index 0000000..f43ac08
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CodeTableType.java
@@ -0,0 +1,40 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+
+public enum CodeTableType {
+ stationUIC("stationUIC"),
+ stationUICReservation("stationUICReservation"),
+ stationERA("stationERA"),
+ localCarrierStationCodeTable("localCarrierStationCodeTable"),
+ proprietaryIssuerStationCodeTable("proprietaryIssuerStationCodeTable");
+
+ public String text;
+
+ CodeTableType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentDetailsType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentDetailsType.java
new file mode 100644
index 0000000..4dea1db
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentDetailsType.java
@@ -0,0 +1,136 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class CompartmentDetailsType extends Object {
+ public CompartmentDetailsType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=99)
+ @Asn1Optional public Long coachType;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1,maxValue=99)
+ @Asn1Optional public Long compartmentType;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=99)
+ @Asn1Optional public Long specialAllocation;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String coachTypeDescr;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String compartmentTypeDescr;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String specialAllocationDescr;
+
+ @FieldOrder(order = 6)
+ @Asn1Default(value="unspecified")
+ public CompartmentPositionType position;
+
+ public Long getCoachType() {
+
+ return this.coachType;
+ }
+
+ public Long getCompartmentType() {
+
+ return this.compartmentType;
+ }
+
+ public Long getSpecialAllocation() {
+
+ return this.specialAllocation;
+ }
+
+ public String getCoachTypeDescr() {
+
+ return this.coachTypeDescr;
+ }
+
+ public String getCompartmentTypeDescr() {
+
+ return this.compartmentTypeDescr;
+ }
+
+ public String getSpecialAllocationDescr() {
+
+ return this.specialAllocationDescr;
+ }
+
+ public CompartmentPositionType getPosition() {
+ if (position == null) return CompartmentPositionType.unspecified;
+ return this.position;
+ }
+
+ public void setCoachType(Long coachType) {
+ this.coachType = coachType;
+ }
+
+ public void setCompartmentType(Long compartmentType) {
+
+ this.compartmentType = compartmentType;
+ }
+
+ public void setSpecialAllocation(Long specialAllocation) {
+
+ this.specialAllocation = specialAllocation;
+ }
+
+ public void setCoachTypeDescr(String coachTypeDescr) {
+
+ this.coachTypeDescr = coachTypeDescr;
+ }
+
+ public void setCompartmentTypeDescr(String compartmentTypeDescr) {
+
+ this.compartmentTypeDescr = compartmentTypeDescr;
+ }
+
+ public void setSpecialAllocationDescr(String specialAllocationDescr) {
+
+ this.specialAllocationDescr = specialAllocationDescr;
+ }
+
+ public void setPosition(CompartmentPositionType position) {
+
+ this.position = position;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentGenderType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentGenderType.java
new file mode 100644
index 0000000..36423ae
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentGenderType.java
@@ -0,0 +1,42 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum CompartmentGenderType {
+ unspecified("unspecified"),
+ family("family"),
+ female("female"),
+ male("male"),
+ mixed("mixed");
+
+ public String text;
+
+ CompartmentGenderType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentPositionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentPositionType.java
new file mode 100644
index 0000000..e579cd2
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CompartmentPositionType.java
@@ -0,0 +1,38 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+
+public enum CompartmentPositionType {
+ unspecified("unspecified"),
+ upperLevel("upperLevel"),
+ lowerLevel("lowerLevel");
+
+ public String text;
+
+ CompartmentPositionType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ConfirmationTypeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ConfirmationTypeType.java
new file mode 100644
index 0000000..ae00f35
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ConfirmationTypeType.java
@@ -0,0 +1,42 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum ConfirmationTypeType {
+ trainDelayConfirmation ("trainDelayConfirmation"),
+ travelerDelayConfirmation ("travelerDelayConfirmation"),
+ trainLinkedTicketDelay ("trainLinkedTicketDelay");
+
+
+
+ public String text;
+
+ ConfirmationTypeType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ControlData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ControlData.java
new file mode 100644
index 0000000..7d0c60c
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ControlData.java
@@ -0,0 +1,200 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+
+@Sequence
+@HasExtensionMarker
+public class ControlData extends Object {
+ public ControlData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public SequenceOfCardReferenceType identificationByCardReference;
+
+ @FieldOrder(order = 1)
+ public Boolean identificationByIdCard = false;
+
+ @FieldOrder(order = 2)
+ public Boolean identificationByPassportId = false;
+
+ @FieldOrder(order = 3)
+ @Asn1Optional public Asn1BigInteger identificationItem;
+
+ @FieldOrder(order = 4)
+ public Boolean passportValidationRequired = false;
+
+ @FieldOrder(order = 5)
+ public Boolean onlineValidationRequired = false;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=0,maxValue=99)
+ @Asn1Optional public Long randomDetailedValidationRequired;
+
+ @FieldOrder(order = 7)
+ public Boolean ageCheckRequired = false;
+
+ @FieldOrder(order = 8)
+ public Boolean reductionCardCheckRequired = false;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public SequenceOfTicketLinkType includedTickets;
+
+ @FieldOrder(order = 11)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+
+ public SequenceOfCardReferenceType getIdentificationByCardReference() {
+
+ return this.identificationByCardReference;
+ }
+
+ public Boolean getIdentificationByIdCard() {
+
+ return this.identificationByIdCard;
+ }
+
+ public Boolean getIdentificationByPassportId() {
+
+ return this.identificationByPassportId;
+ }
+
+ public Long getIdentificationItem() {
+
+ return Asn1BigInteger.toLong(this.identificationItem);
+ }
+
+ public Boolean getPassportValidationRequired() {
+
+ return this.passportValidationRequired;
+ }
+
+ public Boolean getOnlineValidationRequired() {
+
+ return this.onlineValidationRequired;
+ }
+
+ public Long getRandomDetailedValidationRequired() {
+
+ return this.randomDetailedValidationRequired;
+ }
+
+ public Boolean getAgeCheckRequired() {
+
+ return this.ageCheckRequired;
+ }
+
+ public Boolean getReductionCardCheckRequired() {
+
+ return this.reductionCardCheckRequired;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public SequenceOfTicketLinkType getIncludedTickets() {
+
+ return this.includedTickets;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setIdentificationByCardReference(SequenceOfCardReferenceType identificationByCardReference) {
+
+ this.identificationByCardReference = identificationByCardReference;
+ }
+
+ public void setIdentificationByIdCard(Boolean identificationByIdCard) {
+
+ this.identificationByIdCard = identificationByIdCard;
+ }
+
+ public void setIdentificationByPassportId(Boolean identificationByPassportId) {
+
+ this.identificationByPassportId = identificationByPassportId;
+ }
+
+ public void setIdentificationItem(Long identificationItem) {
+
+ this.identificationItem = Asn1BigInteger.toAsn1(identificationItem);
+ }
+
+ public void setPassportValidationRequired(Boolean passportValidationRequired) {
+
+ this.passportValidationRequired = passportValidationRequired;
+ }
+
+ public void setOnlineValidationRequired(Boolean onlineValidationRequired) {
+
+ this.onlineValidationRequired = onlineValidationRequired;
+ }
+
+ public void setRandomDetailedValidationRequired(Long randomDetailedValidationRequired) {
+ this.randomDetailedValidationRequired = randomDetailedValidationRequired;
+ }
+
+ public void setAgeCheckRequired(Boolean ageCheckRequired) {
+ this.ageCheckRequired = ageCheckRequired;
+ }
+
+ public void setReductionCardCheckRequired(Boolean reductionCardCheckRequired) {
+
+ this.reductionCardCheckRequired = reductionCardCheckRequired;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setIncludedTickets(SequenceOfTicketLinkType includedTickets) {
+
+ this.includedTickets = includedTickets;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CountermarkData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CountermarkData.java
new file mode 100644
index 0000000..733ccf0
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CountermarkData.java
@@ -0,0 +1,578 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class CountermarkData extends Object {
+ public CountermarkData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String ticketReferenceIA5;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public Asn1BigInteger ticketReferenceNum;
+
+ @FieldOrder(order = 8)
+ @IntRange(minValue=1,maxValue=200)
+ @Asn1Optional public Long numberOfCountermark;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=1,maxValue=200)
+ @Asn1Optional public Long totalOfCountermarks;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String groupName;
+
+ @FieldOrder(order = 11)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 13)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 14)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 15)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 16)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 17)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ @FieldOrder(order = 18)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String validRegionDesc;
+
+ @FieldOrder(order = 19)
+ @Asn1Optional public SequenceOfRegionalValidityType validRegion;
+
+ @FieldOrder(order = 20)
+ public Boolean returnIncluded = false;
+
+ @FieldOrder(order = 21)
+ @Asn1Optional public ReturnRouteDescriptionType returnDescription;
+
+ @FieldOrder(order = 22)
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 23)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 24)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 25)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 26)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 27)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 28)
+ @Asn1Default(value="second")
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 29)
+ @Asn1Optional public SequenceOfCarrierNum carrierNum;
+
+ @FieldOrder(order = 30)
+ @Asn1Optional public SequenceOfStringIA5 carrierIA5;
+
+ @FieldOrder(order = 31)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 32)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+ @FieldOrder(order = 33)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 34)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Long getReferenceNum() {
+
+ return Asn1BigInteger.toLong(this.referenceNum);
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public String getTicketReferenceIA5() {
+
+ return this.ticketReferenceIA5;
+ }
+
+ public Long getTicketReferenceNum() {
+
+ return Asn1BigInteger.toLong(this.ticketReferenceNum);
+ }
+
+ public Long getNumberOfCountermark() {
+
+ return this.numberOfCountermark;
+ }
+
+ public Long getTotalOfCountermarks() {
+
+ return this.totalOfCountermarks;
+ }
+
+ public String getGroupName() {
+
+ return this.groupName;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public String getValidRegionDesc() {
+
+ return this.validRegionDesc;
+ }
+
+ public SequenceOfRegionalValidityType getValidRegion() {
+
+ return this.validRegion;
+ }
+
+ public Boolean getReturnIncluded() {
+
+ return this.returnIncluded;
+ }
+
+ public ReturnRouteDescriptionType getReturnDescription() {
+
+ return this.returnDescription;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public TravelClassType getClassCode() {
+
+ if (classCode == null){
+ return TravelClassType.second;
+ }
+
+ return this.classCode;
+ }
+
+ public SequenceOfCarrierNum getCarriersNum() {
+
+ return this.carrierNum;
+ }
+
+ public SequenceOfStringIA5 getCarriersIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public SequenceOfServiceBrands getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public SequenceOfServiceBrands getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setTicketReferenceIA5(String ticketReferenceIA5) {
+
+ this.ticketReferenceIA5 = ticketReferenceIA5;
+ }
+
+ public void setTicketReferenceNum(Long ticketReferenceNum) {
+
+ this.ticketReferenceNum = Asn1BigInteger.toAsn1(ticketReferenceNum);
+ }
+
+ public void setNumberOfCountermark(Long numberOfCountermark) {
+
+ this.numberOfCountermark = numberOfCountermark;
+ }
+
+ public void setTotalOfCountermarks(Long totalOfCountermarks) {
+
+ this.totalOfCountermarks = totalOfCountermarks;
+ }
+
+ public void setGroupName(String groupName) {
+
+ this.groupName = groupName;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+ public void setValidRegionDesc(String validRegionDesc) {
+
+ this.validRegionDesc = validRegionDesc;
+ }
+
+ public void setValidRegion(SequenceOfRegionalValidityType validRegion) {
+
+ this.validRegion = validRegion;
+ }
+
+ public void setReturnIncluded(Boolean returnIncluded) {
+
+ this.returnIncluded = returnIncluded;
+ }
+
+ public void setReturnDescription(ReturnRouteDescriptionType returnDescription) {
+
+ this.returnDescription = returnDescription;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+
+ this.classCode = classCode;
+ }
+
+ public void setCarriersNum(SequenceOfCarrierNum carrierNum) {
+
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarriersNum(List<Long> longs) {
+ if (longs == null) return;
+
+ this.carrierNum = new SequenceOfCarrierNum();
+ this.carrierNum.addAll(longs);
+ }
+
+ public void setCarriersIA5(SequenceOfStringIA5 carrierIA5) {
+
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java
new file mode 100644
index 0000000..312ec57
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java
@@ -0,0 +1,297 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+
+@Sequence
+@HasExtensionMarker
+public class CustomerCardData extends Object {
+ public CustomerCardData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public TravelerType customer;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String cardIdIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger cardIdNum;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=2016,maxValue=2269)
+ @Asn1Optional public Long validFromYear;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=700)
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=0,maxValue=250)
+ @Asn1Optional public Long validUntilYear;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=0,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 8)
+ @IntRange(minValue=0,maxValue=1000)
+ @Asn1Optional public Long cardType;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String cardTypeDescr;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public Asn1BigInteger customerStatus;
+
+ @FieldOrder(order = 11)
+ @Asn1Optional public String customerStatusDescr;
+
+ @FieldOrder(order = 12)
+ @Asn1Optional public SequenceOfUnrestrictedLong includedServices;
+
+ @FieldOrder(order = 13)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+
+ public TravelerType getCustomer() {
+
+ return this.customer;
+ }
+
+ public String getCardIdIA5() {
+
+ return this.cardIdIA5;
+ }
+
+ public Asn1BigInteger getCardIdNum() {
+
+ return this.cardIdNum;
+ }
+
+ public Long getValidFromYear() {
+
+ return this.validFromYear;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidUntilYear() {
+
+ return this.validUntilYear;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public TravelClassType getClassCode() {
+
+ return this.classCode;
+ }
+
+ public Long getCardType() {
+
+ return this.cardType;
+ }
+
+ public String getCardTypeDescr() {
+
+ return this.cardTypeDescr;
+ }
+
+ public Long getCustomerStatus() {
+
+ return Asn1BigInteger.toLong(this.customerStatus);
+ }
+
+ public String getCustomerStatusDescr() {
+
+ return this.customerStatusDescr;
+ }
+
+ public SequenceOfUnrestrictedLong getIncludedServices() {
+
+ return this.includedServices;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setCustomer(TravelerType customer) {
+
+ this.customer = customer;
+ }
+
+ public void setCardIdIA5(String cardIdIA5) {
+
+ this.cardIdIA5 = cardIdIA5;
+ }
+
+ public void setCardIdNum(Asn1BigInteger cardIdNum) {
+
+ this.cardIdNum = cardIdNum;
+ }
+
+ public void setCardIdNum(Long cardIdNum) {
+
+ this.cardIdNum = new Asn1BigInteger(cardIdNum);
+ }
+
+ public void setValidFromYear(Long validFromYear) {
+
+ this.validFromYear = validFromYear;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidUntilYear(Long validUntilYear) {
+
+ this.validUntilYear = validUntilYear;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+
+ this.classCode = classCode;
+ }
+
+ public void setCardType(Long cardType) {
+
+ this.cardType = cardType;
+ }
+
+ public void setCardTypeDescr(String cardTypeDescr) {
+
+ this.cardTypeDescr = cardTypeDescr;
+ }
+
+ public void setCustomerStatus(Long customerStatus) {
+
+ this.customerStatus = Asn1BigInteger.toAsn1(customerStatus);
+ }
+
+ public void setCustomerStatusDescr(String customerStatusDescr) {
+
+ this.customerStatusDescr = customerStatusDescr;
+ }
+
+ public void setIncludedServices(SequenceOfUnrestrictedLong includedServices) {
+
+ this.includedServices = includedServices;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setValidity (Date fromDate , Date untilDate){
+
+ Calendar fromCal = Calendar.getInstance();
+ fromCal.clear();
+ fromCal.setTime(fromDate);
+
+ this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
+ this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+
+ if (untilDate == null) return;
+
+ Calendar untilCal = Calendar.getInstance();
+ untilCal.clear();
+ untilCal.setTime(untilDate);
+
+ int untildays = untilCal.get(Calendar.DAY_OF_YEAR);
+
+ int yearDiff = untilCal.get(Calendar.YEAR) - fromCal.get(Calendar.YEAR);
+
+ this.validUntilYear = new Long( yearDiff);
+ this.validUntilDay = new Long (untildays);
+
+ }
+
+ public Date getValidFromDate (){
+
+ if (this.validFromYear == null || this.validFromDay == null) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.validFromYear.intValue());
+ cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
+ return cal.getTime();
+
+ }
+
+
+ public Date getValidUntilDate (){
+
+ if (this.validUntilYear == null || this.validUntilDay == null) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.validFromYear.intValue());
+ if (this.validUntilYear != null) {
+ cal.add(Calendar.YEAR, this.validUntilYear.intValue());
+ }
+ cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
+ return cal.getTime();
+
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerStatusType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerStatusType.java
new file mode 100644
index 0000000..8d58d06
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerStatusType.java
@@ -0,0 +1,93 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+
+@Sequence
+public class CustomerStatusType extends Object {
+ public CustomerStatusType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long statusProviderNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String statusProviderIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger customerStatus;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String customerStatusDescr;
+
+ public Long getStatusProviderNum() {
+
+ return this.statusProviderNum;
+ }
+
+ public String getStatusProviderIA5() {
+
+ return this.statusProviderIA5;
+ }
+
+ public Long getCustomerStatus() {
+
+ return Asn1BigInteger.toLong(this.customerStatus);
+ }
+
+ public String getCustomerStatusDescr() {
+
+ return this.customerStatusDescr;
+ }
+
+ public void setStatusProviderNum(Long statusProviderNum) {
+
+ this.statusProviderNum = statusProviderNum;
+ }
+
+ public void setStatusProviderIA5(String statusProviderIA5) {
+
+ this.statusProviderIA5 = statusProviderIA5;
+ }
+
+ public void setCustomerStatus(Long customerStatus) {
+
+ this.customerStatus = Asn1BigInteger.toAsn1(customerStatus);
+ }
+
+ public void setCustomerStatusDescr(String customerStatusDescr) {
+
+ this.customerStatusDescr = customerStatusDescr;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java
new file mode 100644
index 0000000..8d8b4c6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java
@@ -0,0 +1,339 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class DelayConfirmation extends Object {
+ public DelayConfirmation() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger trainNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trainIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=2016, maxValue=2269)
+ @Asn1Optional public Long plannedArrivalYear;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=1, maxValue=366)
+ @Asn1Optional public Long plannedArrivalDay;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=0, maxValue=1439)
+ @Asn1Optional public Long plannedArrivalTime;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long departureUTCOffset;
+
+ @FieldOrder(order = 8)
+ @Asn1Default(value="stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=1, maxValue=9999999)
+ @Asn1Optional public Long stationNum;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String stationIA5;
+
+ @FieldOrder(order = 11)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String stationNameUTF8;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=0, maxValue=999, hasExtensionMarker=false)
+ @Asn1Optional public Long delay;
+
+ @FieldOrder(order = 13)
+ @Asn1Optional public Boolean trainCancelled = false;
+
+ @FieldOrder(order = 14)
+ @Asn1Default(value="travelerDelayConfirmation")
+ @Asn1Optional public ConfirmationTypeType confirmationType;
+
+ @FieldOrder(order = 15)
+ @Asn1Optional public SequenceOfTicketLinkType affectedTickets;
+
+ @FieldOrder(order = 16)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public Long getTrainNum() {
+
+ return Asn1BigInteger.toLong(this.trainNum);
+ }
+
+ public String getTrainIA5() {
+
+ return this.trainIA5;
+ }
+
+ public Long getPlannedArrivalYear() {
+
+ return this.plannedArrivalYear;
+ }
+
+ public Long getPlannedArrivalDay() {
+
+ return this.plannedArrivalDay;
+ }
+
+ public Long getPlannedArrivalTime() {
+
+ return this.plannedArrivalTime;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null){
+ return CodeTableType.stationUIC;
+ }
+ return this.stationCodeTable;
+ }
+
+ public Long getStationNum() {
+
+ return this.stationNum;
+ }
+
+ public String getStationIA5() {
+
+ return this.stationIA5;
+ }
+
+ public String getStationNameUTF8() {
+
+ return this.stationNameUTF8;
+ }
+
+ public Long getDelay() {
+
+ return this.delay;
+ }
+
+ public Boolean getTrainCancelled() {
+
+ return this.trainCancelled;
+ }
+
+ public ConfirmationTypeType getConfirmationType() {
+
+ if (confirmationType == null){
+ return ConfirmationTypeType.trainDelayConfirmation;
+ }
+
+ return this.confirmationType;
+ }
+
+ public List<TicketLinkType> getAffectedTickets() {
+
+ return this.affectedTickets;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+ this.referenceNum = referenceNum;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setTrainNum(Asn1BigInteger trainNum) {
+
+ this.trainNum = trainNum;
+ }
+
+ public void setTrainIA5(String trainIA5) {
+
+ this.trainIA5 = trainIA5;
+ }
+
+ public void setPlannedArrivalYear(Long plannedArrivalYear) {
+
+ this.plannedArrivalYear = plannedArrivalYear;
+ }
+
+ public void setPlannedArrivalDay(Long plannedArrivalDay) {
+
+ this.plannedArrivalDay = plannedArrivalDay;
+ }
+
+ public void setPlannedArrivalTime(Long plannedArrivalTime) {
+
+ this.plannedArrivalTime = plannedArrivalTime;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setStationNum(Long stationNum) {
+
+ this.stationNum = stationNum;
+ }
+
+ public void setStationIA5(String stationIA5) {
+
+ this.stationIA5 = stationIA5;
+ }
+
+ public void setStationNameUTF8(String stationNameUTF8) {
+
+ this.stationNameUTF8 = stationNameUTF8;
+ }
+
+ public void setDelay(Long delay) {
+
+ this.delay = delay;
+ }
+
+ public void setTrainCancelled(Boolean trainCancelled) {
+
+ this.trainCancelled = trainCancelled;
+ }
+
+ public void setConfirmationType(ConfirmationTypeType confirmationType) {
+
+ this.confirmationType = confirmationType;
+ }
+
+ public void setAffectedTickets(SequenceOfTicketLinkType affectedTickets) {
+
+ this.affectedTickets = affectedTickets;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setPlannedArrivalDate(Date date){
+
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+
+ this.plannedArrivalYear = new Long( cal.get(Calendar.YEAR));
+ this.plannedArrivalDay = new Long (cal.get(Calendar.DAY_OF_YEAR));
+ int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
+ if (time > 0) {
+ this.plannedArrivalTime = new Long (time );
+ }
+
+ }
+
+ public Date getPlannedArrivalDate() {
+
+ if (this.plannedArrivalYear == null || this.plannedArrivalDay == null) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.plannedArrivalYear.intValue());
+ cal.set(Calendar.DAY_OF_YEAR, this.plannedArrivalDay.intValue());
+
+ if (this.plannedArrivalTime != null) {
+
+ int hours = this.plannedArrivalTime.intValue() / 60;
+ int minutes = this.plannedArrivalTime.intValue() % 60;
+ cal.set(Calendar.HOUR_OF_DAY, hours);
+ cal.set(Calendar.MINUTE,minutes);
+
+ }
+
+ return cal.getTime();
+ }
+
+ public Long getDepartureUTCOffset() {
+ return departureUTCOffset;
+ }
+
+ public void setDepartureUTCOffset(Long departureUTCOffset) {
+ this.departureUTCOffset = departureUTCOffset;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DeltaCoordinates.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DeltaCoordinates.java
new file mode 100644
index 0000000..1cc1cfb
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DeltaCoordinates.java
@@ -0,0 +1,58 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class DeltaCoordinates extends Object {
+ public DeltaCoordinates() {
+ }
+
+ @FieldOrder(order = 0)
+ public Asn1BigInteger longitude;
+
+ @FieldOrder(order = 1)
+ public Asn1BigInteger latitude;
+
+ public Asn1BigInteger getLongitude() {
+
+ return this.longitude;
+ }
+
+ public Asn1BigInteger getLatitude() {
+
+ return this.latitude;
+ }
+
+ public void setLongitude(Asn1BigInteger longitude) {
+
+ this.longitude = longitude;
+ }
+
+ public void setLatitude(Asn1BigInteger latitude) {
+
+ this.latitude = latitude;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DocumentData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DocumentData.java
new file mode 100644
index 0000000..e71f8ad
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DocumentData.java
@@ -0,0 +1,61 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class DocumentData extends Object {
+ public DocumentData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public TokenType token;
+
+ @FieldOrder(order = 1)
+ public TicketDetailData ticket;
+
+ public TokenType getToken() {
+
+ return this.token;
+ }
+
+ public TicketDetailData getTicket() {
+
+ return this.ticket;
+ }
+
+ public void setToken(TokenType token) {
+
+ this.token = token;
+ }
+
+ public void setTicket(TicketDetailData ticket) {
+
+ this.ticket = ticket;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ExtensionData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ExtensionData.java
new file mode 100644
index 0000000..5d6d4e9
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ExtensionData.java
@@ -0,0 +1,64 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.OctetString;
+
+
+@Sequence
+public class ExtensionData extends Object {
+ public ExtensionData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ public String extensionId;
+
+ @FieldOrder(order = 1)
+ public OctetString extensionData;
+
+ public String getExtensionId() {
+
+ return this.extensionId;
+ }
+
+ public byte[] getExtensionData() {
+
+ return extensionData.toByteArray();
+ }
+
+ public void setExtensionId(String extensionId) {
+
+ this.extensionId = extensionId;
+ }
+
+ public void setExtensionData(byte[] extensionData) {
+
+ this.extensionData = new OctetString(extensionData);
+
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/FIPTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/FIPTicketData.java
new file mode 100644
index 0000000..60d0005
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/FIPTicketData.java
@@ -0,0 +1,338 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class FIPTicketData extends Object {
+ public FIPTicketData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public SequenceOfActivatedDays activatedDay;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public SequenceOfCarrierNum carrierNum;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public SequenceOfStringIA5 carrierIA5;
+
+ @FieldOrder(order = 11)
+ @IntRange(minValue=1,maxValue=200)
+ public Long numberOfTravelDays;
+
+ @FieldOrder(order = 12)
+ public Boolean includesSupplements = false;
+
+ @FieldOrder(order = 13)
+ @Asn1Default(value="second")
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 14)
+ @Asn1Optional public ExtensionData extension;
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public List<Long> getActivatedDay() {
+
+ return this.activatedDay;
+ }
+
+ public List<Long> getCarrierNum() {
+
+ return this.carrierNum;
+ }
+
+ public List<String> getCarrierIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public Long getNumberOfTravelDays() {
+
+ return this.numberOfTravelDays;
+ }
+
+ public Boolean getIncludesSupplements() {
+
+ return this.includesSupplements;
+ }
+
+ public TravelClassType getClassCode() {
+ if (classCode == null) return TravelClassType.second;
+ return this.classCode;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+
+ this.referenceNum = referenceNum;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setActivatedDay(SequenceOfActivatedDays activatedDay) {
+
+ this.activatedDay = activatedDay;
+ }
+
+ public void setCarrierNum(SequenceOfCarrierNum carrierNum) {
+
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarrierIA5(SequenceOfStringIA5 carrierIA5) {
+
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setNumberOfTravelDays(Long numberOfTravelDays) {
+
+ this.numberOfTravelDays = numberOfTravelDays;
+ }
+
+ public void setIncludesSupplements(Boolean includesSupplements) {
+
+ this.includesSupplements = includesSupplements;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+ this.classCode = classCode;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay,0L);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, 1439L);
+
+ }
+
+ public void addActivatedDays(Collection<Long> days) {
+
+ if (days == null || days.isEmpty()) return;
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ for (Long l : days) {
+ this.activatedDay.add(l);
+ }
+
+ }
+
+ public void addActivatedDay(Date issuingDate, Date day){
+
+ Long dayDiff = DateTimeUtils.getDateDifference(issuingDate, day);
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ if (dayDiff != null) {
+ this.activatedDay.add(dayDiff);
+ }
+
+ }
+
+ /**
+ * Gets the activated days.
+ *
+ * @param issuingDate the issuing date
+ * @return the activated days
+ */
+ public Collection<Date> getActivatedDays(Date issuingDate) {
+
+ if (this.activatedDay == null) return null;
+
+ ArrayList<Date> dates = new ArrayList<Date>();
+
+ for (Long diff: this.getActivatedDay()) {
+
+ Date day = DateTimeUtils.getDate(this.getValidFromDate(issuingDate), diff, null);
+
+ if (day != null) {
+ dates.add(day);
+ }
+
+ }
+
+ return dates;
+
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GenderType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GenderType.java
new file mode 100644
index 0000000..76e5da8
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GenderType.java
@@ -0,0 +1,42 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum GenderType {
+ unspecified("unspecified"),
+ female("female"),
+ male("male"),
+ other("other");
+
+
+ public String text;
+
+ GenderType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateSystemType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateSystemType.java
new file mode 100644
index 0000000..4c3db54
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateSystemType.java
@@ -0,0 +1,38 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+
+public enum GeoCoordinateSystemType {
+ wgs84("wgs84"),
+ grs80("grs80");
+
+
+ public String text;
+
+ GeoCoordinateSystemType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateType.java
new file mode 100644
index 0000000..6c8612a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoCoordinateType.java
@@ -0,0 +1,144 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class GeoCoordinateType extends Object {
+ public GeoCoordinateType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Default(value="milliDegree")
+ @Asn1Optional public GeoUnitType geoUnit;
+
+ @FieldOrder(order = 1)
+ @Asn1Default(value="wgs84")
+ @Asn1Optional public GeoCoordinateSystemType coordinateSystem;
+
+ @FieldOrder(order = 2)
+ @Asn1Default(value="north")
+ @Asn1Optional public HemisphereLongitudeType hemisphereLongitude;
+
+ @FieldOrder(order = 3)
+ @Asn1Default(value="east")
+ @Asn1Optional public HemisphereLatitudeType hemisphereLatitude;
+
+ @FieldOrder(order = 4)
+ public Asn1BigInteger longitude;
+
+ @FieldOrder(order = 5)
+ public Asn1BigInteger latitude;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public GeoUnitType accuracy;
+
+ public GeoUnitType getGeoUnit() {
+
+ if (geoUnit == null){
+ return GeoUnitType.milliDegree;
+ }
+ return this.geoUnit;
+ }
+
+ public GeoCoordinateSystemType getCoordinateSystem() {
+
+ if (coordinateSystem == null) {
+ return GeoCoordinateSystemType.wgs84;
+ }
+
+ return this.coordinateSystem;
+ }
+
+ public HemisphereLongitudeType getHemisphereLongitude() {
+
+ if (hemisphereLongitude == null){
+ return HemisphereLongitudeType.north;
+ }
+
+ return this.hemisphereLongitude;
+ }
+
+ public HemisphereLatitudeType getHemisphereLatitude() {
+
+ if (hemisphereLatitude == null) {
+ return HemisphereLatitudeType.east;
+ }
+
+ return this.hemisphereLatitude;
+ }
+
+ public Long getLongitude() {
+
+ return Asn1BigInteger.toLong(this.longitude);
+ }
+
+ public Long getLatitude() {
+
+ return Asn1BigInteger.toLong(this.latitude);
+ }
+
+ public GeoUnitType getAccuracy() {
+
+ return this.accuracy;
+ }
+
+ public void setGeoUnit(GeoUnitType geoUnit) {
+
+ this.geoUnit = geoUnit;
+ }
+
+ public void setCoordinateSystem(GeoCoordinateSystemType coordinateSystem) {
+
+ this.coordinateSystem = coordinateSystem;
+ }
+
+ public void setHemisphereLongitude(HemisphereLongitudeType hemisphereLongitude) {
+
+ this.hemisphereLongitude = hemisphereLongitude;
+ }
+
+ public void setHemisphereLatitude(HemisphereLatitudeType hemisphereLatitude) {
+
+ this.hemisphereLatitude = hemisphereLatitude;
+ }
+
+ public void setLongitude(Long longitude) {
+
+ this.longitude = Asn1BigInteger.toAsn1(longitude);
+ }
+
+ public void setLatitude(Long latitude) {
+
+ this.latitude = Asn1BigInteger.toAsn1(latitude);
+ }
+
+ public void setAccuracy(GeoUnitType accuracy) {
+
+ this.accuracy = accuracy;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoUnitType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoUnitType.java
new file mode 100644
index 0000000..2a6a563
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/GeoUnitType.java
@@ -0,0 +1,40 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum GeoUnitType {
+ microDegree("microDegree"),
+ tenthmilliDegree("tenthmilliDegree"),
+ milliDegree("milliDegree"),
+ centiDegree("centiDegree"),
+ deciDegree("deciDegree");
+
+
+ public String text;
+
+ GeoUnitType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLatitudeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLatitudeType.java
new file mode 100644
index 0000000..b2b86c7
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLatitudeType.java
@@ -0,0 +1,37 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum HemisphereLatitudeType {
+ east("east"),
+ west("west");
+
+
+ public String text;
+
+ HemisphereLatitudeType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLongitudeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLongitudeType.java
new file mode 100644
index 0000000..4d0afc1
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/HemisphereLongitudeType.java
@@ -0,0 +1,36 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum HemisphereLongitudeType {
+ north("north"),
+ south("south");
+
+ public String text;
+
+ HemisphereLongitudeType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java
new file mode 100644
index 0000000..ccaf1a2
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java
@@ -0,0 +1,454 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypes.SizeRange;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class IncludedOpenTicketType extends Object {
+ public IncludedOpenTicketType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 4)
+ @Asn1Optional public Asn1BigInteger externalIssuerId;
+
+ @FieldOrder(order = 5)
+ @Asn1Optional public Asn1BigInteger issuerAutorizationId;
+
+ @FieldOrder(order = 6)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public SequenceOfRegionalValidityType validRegion;
+
+ @FieldOrder(order = 8)
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Default(value = "0")
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 10)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 11)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Default(value = "0")
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 13)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 14)
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 15)
+ @SizeRange(minValue = 1, maxValue = 2)
+ @Asn1Optional public String serviceLevel;
+
+ @FieldOrder(order = 16)
+ @Asn1Optional public SequenceOfCarrierNum includedCarriersNum;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional public SequenceOfStringIA5 includedCarriersIA5;
+
+ @FieldOrder(order = 18)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 19)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+ @FieldOrder(order = 20)
+ @Asn1Optional public SequenceOfTariffType tariffs;
+
+ @FieldOrder(order = 21)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 22)
+ @Asn1Optional public SequenceOfTransportTypes includedTransportTypes;
+
+ @FieldOrder(order = 23)
+ @Asn1Optional public SequenceOfTransportTypes excludedTransportTypes;
+
+ @FieldOrder(order = 24)
+ @Asn1Optional public ExtensionData extension;
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getExternalIssuerId() {
+
+ return Asn1BigInteger.toLong(this.externalIssuerId);
+ }
+
+ public Long getIssuerAutorizationId() {
+
+ return Asn1BigInteger.toLong(this.issuerAutorizationId);
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public List<RegionalValidityType> getValidRegion() {
+
+ return this.validRegion;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public TravelClassType getClassCode() {
+
+ if (classCode == null) {
+ return TravelClassType.second;
+ }
+
+ return this.classCode;
+ }
+
+ public String getServiceLevel() {
+
+ return this.serviceLevel;
+ }
+
+ public List<Long> getIncludedCarriersNum() {
+
+ return this.includedCarriersNum;
+ }
+
+ public List<String> getIncludedCarriersIA5() {
+
+ return this.includedCarriersIA5;
+ }
+
+ public List<Long> getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public List<Long> getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+
+
+ public SequenceOfTransportTypes getIncludedTransportTypes() {
+ return includedTransportTypes;
+ }
+
+ public void setIncludedTransportTypes(SequenceOfTransportTypes includedTransportTypes) {
+ this.includedTransportTypes = includedTransportTypes;
+ }
+
+ public SequenceOfTransportTypes getExcludedTransportTypes() {
+ return excludedTransportTypes;
+ }
+
+ public void setExcludedTransportTypes(SequenceOfTransportTypes excludedTransportTypes) {
+ this.excludedTransportTypes = excludedTransportTypes;
+ }
+
+ public List<TariffType> getTariffs() {
+
+ return this.tariffs;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setExternalIssuerId(Long externalIssuerId) {
+
+ this.externalIssuerId = Asn1BigInteger.toAsn1(externalIssuerId);
+ }
+
+ public void setIssuerAutorizationId(Long issuerAutorizationId) {
+
+ this.issuerAutorizationId = Asn1BigInteger.toAsn1(issuerAutorizationId);
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setValidRegion(SequenceOfRegionalValidityType validRegion) {
+
+ this.validRegion = validRegion;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+
+ this.classCode = classCode;
+ }
+
+ public void setServiceLevel(String serviceLevel) {
+
+ this.serviceLevel = serviceLevel;
+ }
+
+ public void setIncludedCarriersNum(SequenceOfCarrierNum includedCarriersNum) {
+
+ this.includedCarriersNum = includedCarriersNum;
+ }
+
+ public void setIncludedCarriersIA5(SequenceOfStringIA5 includedCarriersIA5) {
+
+ this.includedCarriersIA5 = includedCarriersIA5;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+ public void setTariffs(SequenceOfTariffType tariffs) {
+
+ this.tariffs = tariffs;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public void setValidFromTimeZone(Date dateLocal, Date dateUTC ) {
+ // -- (UTC = local + offset * 15 Minutes)
+ this.validFromUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+ }
+
+ public void setValidUntilTimeZone(Date dateLocal, Date dateUTC ) {
+ // -- (UTC = local + offset * 15 Minutes)
+ this.validUntilUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+
+ if (this.validFromUTCOffset.longValue() == this.validUntilUTCOffset.longValue()) {
+ this.validUntilUTCOffset = null;
+ }
+ }
+
+
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public Date getUTCValidFromDate(Date issuingDate){
+ return DateTimeUtils.getUTCDate(issuingDate, this.validFromDay, this.validFromTime, this.validFromUTCOffset);
+ }
+
+ public Date getUTCValidUntilDate(Date issuingDate){
+ if (this.validUntilUTCOffset == null) {
+ return DateTimeUtils.getUTCDate(issuingDate, this.validFromDay, this.validFromTime, this.validFromUTCOffset);
+ } else {
+ return DateTimeUtils.getUTCDate(issuingDate, this.validFromDay, this.validUntilTime, this.validFromUTCOffset);
+ }
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java
new file mode 100644
index 0000000..537a42a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java
@@ -0,0 +1,360 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.FixedSize;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class IssuingData extends Object {
+ public IssuingData() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long securityProviderNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String securityProviderIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long issuerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String issuerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=2016,maxValue=2269)
+ public Long issuingYear;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=1,maxValue=366)
+ public Long issuingDay;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=0,maxValue=1439)
+ public Long issuingTime;
+
+ @FieldOrder(order = 7)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String issuerName;
+
+ @FieldOrder(order = 8)
+ public Boolean specimen = false;
+
+ @FieldOrder(order = 9)
+ public Boolean securePaperTicket = false;
+
+ @FieldOrder(order = 10)
+ public Boolean activated = true;
+
+ @FieldOrder(order = 11)
+ @FixedSize(3)
+ @Asn1Default(value="EUR")
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String currency;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=1,maxValue=3)
+ @Asn1Default(value="2")
+ @Asn1Optional public Long currencyFract;
+
+ @FieldOrder(order = 13)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String issuerPNR;
+
+ @FieldOrder(order = 14)
+ @Asn1Optional public ExtensionData extension;
+
+ @FieldOrder(order = 15)
+ @Asn1Optional public Asn1BigInteger issuedOnTrainNum;
+
+ @FieldOrder(order = 16)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String issuedOnTrainIA5;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional public Asn1BigInteger issuedOnLine;
+
+ @FieldOrder(order = 18)
+ @Asn1Optional public GeoCoordinateType pointOfSale;
+
+
+
+
+
+
+ public Long getSecurityProviderNum() {
+
+ return this.securityProviderNum;
+ }
+
+ public String getSecurityProviderIA5() {
+
+ return this.securityProviderIA5;
+ }
+
+ public Long getIssuerNum() {
+
+ return this.issuerNum;
+ }
+
+ public String getIssuerIA5() {
+
+ return this.issuerIA5;
+ }
+
+ public Long getIssuingYear() {
+
+ return this.issuingYear;
+ }
+
+ public Long getIssuingDay() {
+
+ return this.issuingDay;
+ }
+
+ public Long getIssuingTime() {
+
+ return this.issuingTime;
+ }
+
+ public String getIssuerName() {
+
+ return this.issuerName;
+ }
+
+ public Boolean getSpecimen() {
+
+ return this.specimen;
+ }
+
+ public Boolean getSecurePaperTicket() {
+
+ return this.securePaperTicket;
+ }
+
+ public Boolean getActivated() {
+
+ return this.activated;
+ }
+
+ public String getCurrency() {
+
+ if (currency == null || currency.length() == 0){
+ return "EUR";
+ }
+
+ return this.currency;
+ }
+
+ public Long getCurrencyFract() {
+
+ if (currencyFract == null) {
+ return new Long(2);
+ }
+ return this.currencyFract;
+ }
+
+ public String getIssuerPNR() {
+
+ return this.issuerPNR;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public Long getIssuedOnTrainNum() {
+
+ return Asn1BigInteger.toLong(issuedOnTrainNum);
+ }
+
+ public String getIssuedOnTrainIA5() {
+
+ return this.issuedOnTrainIA5;
+ }
+
+ public Long getIssuedOnLine() {
+
+ return Asn1BigInteger.toLong(issuedOnLine);
+ }
+
+ public GeoCoordinateType getPointOfSale() {
+
+ return this.pointOfSale;
+ }
+
+ public void setSecurityProviderNum(Long securityProviderNum) {
+
+ this.securityProviderNum = securityProviderNum;
+ }
+
+ public void setSecurityProviderIA5(String securityProviderIA5) {
+
+ this.securityProviderIA5 = securityProviderIA5;
+ }
+
+ public void setIssuerNum(Long issuerNum) {
+
+ this.issuerNum = issuerNum;
+ }
+
+ public void setIssuerIA5(String issuerIA5) {
+
+ this.issuerIA5 = issuerIA5;
+ }
+
+ public void setIssuingYear(Long issuingYear) {
+
+ this.issuingYear = issuingYear;
+ }
+
+ public void setIssuingDay(Long issuingDay) {
+
+ this.issuingDay = issuingDay;
+ }
+
+ public void setIssuingTime(Long issuingTime) {
+
+ this.issuingTime = issuingTime;
+ }
+
+ public void setIssuerName(String issuerName) {
+
+ this.issuerName = issuerName;
+ }
+
+ public void setSpecimen(Boolean specimen) {
+
+ this.specimen = specimen;
+ }
+
+ public void setSecurePaperTicket(Boolean securePaperTicket) {
+
+ this.securePaperTicket = securePaperTicket;
+ }
+
+ public void setActivated(Boolean activated) {
+
+ this.activated = activated;
+ }
+
+ public void setCurrency(String currency) {
+
+ this.currency = currency;
+ }
+
+ public void setCurrencyFract(Long currencyFract) {
+
+ this.currencyFract = currencyFract;
+ }
+
+ public void setIssuerPNR(String issuerPNR) {
+
+ this.issuerPNR = issuerPNR;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setIssuedOnTrainNum(Long issuedOnTrainNum) {
+
+ this.issuedOnTrainNum = Asn1BigInteger.toAsn1(issuedOnTrainNum);
+ }
+
+ public void setIssuedOnTrainIA5(String issuedOnTrainIA5) {
+
+ this.issuedOnTrainIA5 = issuedOnTrainIA5;
+ }
+
+ public void setIssuedOnLine(Long issuedOnLine) {
+
+ this.issuedOnLine = Asn1BigInteger.toAsn1(issuedOnLine);
+ }
+
+ public void setPointOfSale(GeoCoordinateType pointOfSale) {
+
+ this.pointOfSale = pointOfSale;
+ }
+
+ public void setIssuingDate(Date date){
+
+ if (date == null) {
+ date = Calendar.getInstance().getTime();
+ }
+
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+
+ this.issuingYear = new Long( cal.get(Calendar.YEAR));
+ this.issuingDay = new Long (cal.get(Calendar.DAY_OF_YEAR));
+ int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
+ if (time > 0) {
+ this.issuingTime = new Long (time );
+ }
+
+ }
+
+ public Date getIssuingDate() {
+
+ if (this.issuingYear == null || this.issuingDay == null) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.issuingYear.intValue());
+ cal.set(Calendar.DAY_OF_YEAR, this.issuingDay.intValue());
+
+ if (this.issuingTime != null) {
+
+ int hours = this.issuingTime.intValue() / 60;
+ int minutes = this.issuingTime.intValue() % 60;
+ cal.set(Calendar.HOUR_OF_DAY, hours);
+ cal.set(Calendar.MINUTE,minutes);
+
+ }
+
+ return cal.getTime();
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LineType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LineType.java
new file mode 100644
index 0000000..80b6478
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LineType.java
@@ -0,0 +1,185 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.OctetString;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+
+@Sequence
+@HasExtensionMarker
+
+public class LineType extends Object {
+ public LineType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long carrierNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String carrierIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public SequenceOfUnrestrictedLong lineId;
+
+ @FieldOrder(order = 3)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=9999999)
+ @Asn1Optional public Long entryStationNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String entryStationIA5;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=0,maxValue=9999999)
+ @Asn1Optional public Long terminatingStationNum;
+
+ @FieldOrder(order = 7)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String terminatingStationIA5;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public Asn1BigInteger city;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public OctetString binaryZoneId;
+
+
+
+ public Long getCarrierNum() {
+
+ return this.carrierNum;
+ }
+
+ public String getCarrierIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public SequenceOfUnrestrictedLong getLineId() {
+
+ return this.lineId;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getEntryStationNum() {
+
+ return this.entryStationNum;
+ }
+
+ public String getEntryStationIA5() {
+
+ return this.entryStationIA5;
+ }
+
+ public Long getTerminatingStationNum() {
+
+ return this.terminatingStationNum;
+ }
+
+ public String getTerminatingStationIA5() {
+
+ return this.terminatingStationIA5;
+ }
+
+ public Long getCity() {
+
+ return Asn1BigInteger.toLong(this.city);
+ }
+
+ public byte[] getBinaryZoneId() {
+
+ return binaryZoneId.toByteArray();
+ }
+
+ public void setCarrierNum(Long carrierNum) {
+
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarrierIA5(String carrierIA5) {
+
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setLineId(SequenceOfUnrestrictedLong lineId) {
+
+ this.lineId = lineId;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setEntryStationNum(Long entryStationNum) {
+
+ this.entryStationNum = entryStationNum;
+ }
+
+ public void setEntryStationIA5(String entryStationIA5) {
+
+ this.entryStationIA5 = entryStationIA5;
+ }
+
+ public void setTerminatingStationNum(Long terminatingStationNum) {
+
+ this.terminatingStationNum = terminatingStationNum;
+ }
+
+ public void setTerminatingStationIA5(String terminatingStationIA5) {
+
+ this.terminatingStationIA5 = terminatingStationIA5;
+ }
+
+ public void setCity(Long city) {
+
+ this.city = Asn1BigInteger.toAsn1(city);
+ }
+
+ public void setBinaryZoneId(byte[] binaryZoneId) {
+
+ this.binaryZoneId = new OctetString(binaryZoneId);
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LinkMode.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LinkMode.java
new file mode 100644
index 0000000..941a9a1
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LinkMode.java
@@ -0,0 +1,39 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum LinkMode {
+ issuedTogether("issuedTogether"),
+ onlyValidInCombination("onlyValidInCombination");
+
+ public String text;
+
+ LinkMode(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LoadingDeckType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LoadingDeckType.java
new file mode 100644
index 0000000..247e96d
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LoadingDeckType.java
@@ -0,0 +1,38 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+
+public enum LoadingDeckType {
+ unspecified("unspecified"),
+ upper("upper"),
+ lower("lower");
+
+ public String text;
+
+ LoadingDeckType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java
new file mode 100644
index 0000000..684b762
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java
@@ -0,0 +1,88 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class LuggageRestrictionType extends Object {
+ public LuggageRestrictionType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=0,maxValue=99)
+ @Asn1Default(value="3")
+ @Asn1Optional public Long maxHandLuggagePieces;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=0,maxValue=99)
+ @Asn1Default(value="1")
+ @Asn1Optional public Long maxNonHandLuggagePieces;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public SequenceOfRegisteredLuggageType registeredLuggage;
+
+
+ public void setRegisteredLuggage(
+ SequenceOfRegisteredLuggageType registeredLuggage) {
+ this.registeredLuggage = registeredLuggage;
+ }
+
+ public Long getMaxHandLuggagePieces() {
+
+ if (maxHandLuggagePieces == null) {
+ return new Long(3);
+ }
+
+ return this.maxHandLuggagePieces;
+ }
+
+ public Long getMaxNonHandLuggagePieces() {
+
+ if (maxNonHandLuggagePieces == null) {
+ return new Long(1);
+ }
+
+ return this.maxNonHandLuggagePieces;
+ }
+
+ public SequenceOfRegisteredLuggageType getRegisteredLuggage() {
+
+ return this.registeredLuggage;
+ }
+
+ public void setMaxHandLuggagePieces(Long maxHandLuggagePieces) {
+
+ this.maxHandLuggagePieces = maxHandLuggagePieces;
+ }
+
+ public void setMaxNonHandLuggagePieces(Long maxNonHandLuggagePieces) {
+
+ this.maxNonHandLuggagePieces = maxNonHandLuggagePieces;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java
new file mode 100644
index 0000000..fa4208c
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java
@@ -0,0 +1,678 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypes.SizeRange;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class OpenTicketData extends Object {
+ public OpenTicketData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public Asn1BigInteger externalIssuerId;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public Asn1BigInteger issuerAutorizationId;
+
+ @FieldOrder(order = 8)
+ public Boolean returnIncluded = false;
+
+ @FieldOrder(order = 9)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 10)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 11)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 13)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 14)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 15)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ @FieldOrder(order = 16)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String validRegionDesc;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional public SequenceOfRegionalValidityType validRegion;
+
+ @FieldOrder(order = 18)
+ @Asn1Optional public ReturnRouteDescriptionType returnDescription;
+
+ @FieldOrder(order = 19)
+ @Asn1Default(value = "0")
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 20)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 21)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 22)
+ @Asn1Default(value = "0")
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 23)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 24)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 25)
+ @Asn1Optional public SequenceOfActivatedDays activatedDay;
+
+ @FieldOrder(order = 26)
+ @Asn1Default(value="second")
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 27)
+ @SizeRange(minValue = 1, maxValue = 2)
+ @Asn1Optional public String serviceLevel;
+
+ @FieldOrder(order = 28)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public SequenceOfCarrierNum carrierNum;
+
+ @FieldOrder(order = 29)
+ @Asn1Optional public SequenceOfStringIA5 carrierIA5;
+
+ @FieldOrder(order = 30)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 31)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+ @FieldOrder(order = 32)
+ @Asn1Optional public SequenceOfTariffType tariffs;
+
+ @FieldOrder(order = 33)
+ @Asn1Optional Asn1BigInteger price;
+
+ @FieldOrder(order = 34)
+ @Asn1Optional SequenceOfVatDetail vatDetails;
+
+ @FieldOrder(order = 35)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 36)
+ @Asn1Optional public SequenceOfIncludedOpenTicketType includedAddOns;
+
+ @FieldOrder(order = 37)
+ @Asn1Optional public LuggageRestrictionType luggage;
+
+ @FieldOrder(order = 38)
+ @Asn1Optional public SequenceOfTransportTypes includedTransportTypes;
+
+ @FieldOrder(order = 39)
+ @Asn1Optional public SequenceOfTransportTypes excludedTransportTypes;
+
+ @FieldOrder(order = 40)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+
+ public Long getReferenceNum() {
+ return Asn1BigInteger.toLong(this.referenceNum);
+ }
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getExtIssuerId() {
+
+ return Asn1BigInteger.toLong(externalIssuerId);
+ }
+
+ public Long getIssuerAutorizationId() {
+
+ return Asn1BigInteger.toLong(issuerAutorizationId);
+ }
+
+ public Boolean getReturnIncluded() {
+
+ return this.returnIncluded;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+
+ return this.stationCodeTable;
+ }
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public String getValidRegionDesc() {
+
+ return this.validRegionDesc;
+ }
+
+ public List<RegionalValidityType> getValidRegion() {
+
+ return this.validRegion;
+ }
+
+ public ReturnRouteDescriptionType getReturnDescription() {
+
+ return this.returnDescription;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public List<Long> getActivatedDay() {
+
+ return this.activatedDay;
+ }
+
+ public TravelClassType getClassCode() {
+
+ if (classCode == null) {
+ return TravelClassType.second;
+ }
+
+ return this.classCode;
+ }
+
+ public String getServiceLevel() {
+
+ return this.serviceLevel;
+ }
+
+ public List<Long> getCarriersNum() {
+
+ return this.carrierNum;
+ }
+
+ public List<String> getCarriersIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public List<Long> getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public List<Long> getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+ public List<TariffType> getTariffs() {
+
+ return this.tariffs;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public List<IncludedOpenTicketType> getIncludedAddOns() {
+
+ return this.includedAddOns;
+ }
+
+ public LuggageRestrictionType getLuggage() {
+
+ return this.luggage;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setExtIssuerId(Long extIssuerId) {
+ this.externalIssuerId = Asn1BigInteger.toAsn1(extIssuerId);
+ }
+
+ public void setIssuerAutorizationId(Long issuerAutorizationId) {
+
+ this.issuerAutorizationId = Asn1BigInteger.toAsn1(issuerAutorizationId);
+ }
+
+ public void setReturnIncluded(Boolean returnIncluded) {
+ this.returnIncluded = returnIncluded;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+ public void setValidRegionDesc(String validRegionDesc) {
+ this.validRegionDesc = validRegionDesc;
+ }
+
+ public void setValidRegion(SequenceOfRegionalValidityType validRegion) {
+ this.validRegion = validRegion;
+ }
+
+ public void setReturnDescription(ReturnRouteDescriptionType returnDescription) {
+ this.returnDescription = returnDescription;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setActivatedDay(SequenceOfActivatedDays activatedDay) {
+ this.activatedDay = activatedDay;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+ this.classCode = classCode;
+ }
+
+ public void setServiceLevel(String serviceLevel) {
+ this.serviceLevel = serviceLevel;
+ }
+
+ public void setCarriersNum(SequenceOfCarrierNum carriersNum) {
+
+ this.carrierNum = carriersNum;
+ }
+
+ public void setCarriersIA5(SequenceOfStringIA5 carriersIA5) {
+ this.carrierIA5 = carriersIA5;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+
+ public SequenceOfTransportTypes getIncludedTransportTypes() {
+ return includedTransportTypes;
+ }
+
+ public void setIncludedTransportTypes(SequenceOfTransportTypes includedTransportTypes) {
+ this.includedTransportTypes = includedTransportTypes;
+ }
+
+ public SequenceOfTransportTypes getExcludedTransportTypes() {
+ return excludedTransportTypes;
+ }
+
+ public void setExcludedTransportTypes(SequenceOfTransportTypes excludedTransportTypes) {
+ this.excludedTransportTypes = excludedTransportTypes;
+ }
+
+ public void setTariffs(SequenceOfTariffType tariffs) {
+ this.tariffs = tariffs;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setIncludedAddOns(SequenceOfIncludedOpenTicketType includedAddOns) {
+ this.includedAddOns = includedAddOns;
+ }
+
+ public void setLuggage(LuggageRestrictionType luggage) {
+ this.luggage = luggage;
+ }
+
+ public void setExtension(ExtensionData extension) {
+ this.extension = extension;
+ }
+
+ public Long getPrice() {
+ return Asn1BigInteger.toLong(price);
+ }
+
+ public void setPrice(Long price) {
+ this.price = Asn1BigInteger.toAsn1(price);
+ }
+
+ public SequenceOfVatDetail getVatDetails() {
+ return vatDetails;
+ }
+
+ public void setVatDetails(SequenceOfVatDetail vatDetails) {
+ this.vatDetails = vatDetails;
+ }
+
+ public void addVatDetail(VatDetailType vatDetail) {
+ if (this.vatDetails == null) {
+ this.vatDetails = new SequenceOfVatDetail();
+ }
+ this.vatDetails.add(vatDetail);
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+
+ public void addActivatedDays(Collection<Long> days) {
+
+ if (days == null || days.isEmpty()) return;
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ for (Long l : days) {
+ this.activatedDay.add(l);
+ }
+
+ }
+
+ public void addActivatedDay(Date issuingDate, Date day){
+
+ Long dayDiff = DateTimeUtils.getDateDifference(issuingDate, day);
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ if (dayDiff != null) {
+ this.activatedDay.add(dayDiff);
+ }
+
+ }
+
+ /**
+ * Gets the activated days.
+ *
+ * @param issuingDate the issuing date
+ * @return the activated days
+ */
+ public Collection<Date> getActivatedDays(Date issuingDate) {
+
+ if (this.activatedDay == null) return null;
+
+ ArrayList<Date> dates = new ArrayList<Date>();
+
+ for (Long diff: this.getActivatedDay()) {
+
+ Date day = DateTimeUtils.getDate(this.getValidFromDate(issuingDate), diff, null);
+
+ if (day != null) {
+ dates.add(day);
+ }
+
+ }
+
+ return dates;
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ParkingGroundData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ParkingGroundData.java
new file mode 100644
index 0000000..53f0bca
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ParkingGroundData.java
@@ -0,0 +1,364 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class ParkingGroundData extends Object {
+ public ParkingGroundData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.IA5String)
+ public String parkingGroundId = "";
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=-367,maxValue=370)
+ @Asn1Optional public Long fromParkingDate;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=370)
+ @Asn1Optional public Long toParkingDate;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 8)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String accessCode;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ public String location;
+
+ @FieldOrder(order = 11)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long stationNum;
+
+ @FieldOrder(order = 13)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String stationIA5;
+
+ @FieldOrder(order = 14)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String specialInformation;
+
+ @FieldOrder(order = 15)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String entryTrack;
+
+ @FieldOrder(order = 16)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String numberPlate;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional Asn1BigInteger price;
+
+ @FieldOrder(order = 18)
+ @Asn1Optional SequenceOfVatDetail vatDetails;
+
+ @FieldOrder(order = 19)
+ @Asn1Optional public ExtensionData extension;
+
+
+
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public String getParkingGroundId() {
+
+ return this.parkingGroundId;
+ }
+
+ public Long getFromParkingDate() {
+
+ return this.fromParkingDate;
+ }
+
+ public Long getToParkingDate() {
+
+ return this.toParkingDate;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public String getAccessCode() {
+
+ return this.accessCode;
+ }
+
+ public String getLocation() {
+
+ return this.location;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getStationNum() {
+
+ return this.stationNum;
+ }
+
+ public String getStationIA5() {
+
+ return this.stationIA5;
+ }
+
+ public String getSpecialInformation() {
+
+ return this.specialInformation;
+ }
+
+ public String getEntryTrack() {
+
+ return this.entryTrack;
+ }
+
+ public String getNumberPlate() {
+
+ return this.numberPlate;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+
+ this.referenceNum = referenceNum;
+ }
+
+ public void setParkingGroundId(String parkingGroundId) {
+
+ this.parkingGroundId = parkingGroundId;
+ }
+
+ public void setFromParkingDate(Long fromParkingDate) {
+
+ this.fromParkingDate = fromParkingDate;
+ }
+
+ public void setToParkingDate(Long toParkingDate) {
+
+ this.toParkingDate = toParkingDate;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setAccessCode(String accessCode) {
+
+ this.accessCode = accessCode;
+ }
+
+ public void setLocation(String location) {
+
+ this.location = location;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setStationNum(Long stationNum) {
+
+ this.stationNum = stationNum;
+ }
+
+ public void setStationIA5(String stationIA5) {
+
+ this.stationIA5 = stationIA5;
+ }
+
+ public void setSpecialInformation(String specialInformation) {
+
+ this.specialInformation = specialInformation;
+ }
+
+ public void setEntryTrack(String entryTrack) {
+
+ this.entryTrack = entryTrack;
+ }
+
+ public void setNumberPlate(String numberPlate) {
+
+ this.numberPlate = numberPlate;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public Long getPrice() {
+ return Asn1BigInteger.toLong(price);
+ }
+
+ public void setPrice(Long price) {
+ this.price = Asn1BigInteger.toAsn1(price);
+ }
+
+ public SequenceOfVatDetail getVatDetails() {
+ return vatDetails;
+ }
+
+ public void setVatDetails(SequenceOfVatDetail vatDetails) {
+ this.vatDetails = vatDetails;
+ }
+
+ public void addVatDetail(VatDetailType vatDetail) {
+ if (this.vatDetails == null) {
+ this.vatDetails = new SequenceOfVatDetail();
+ }
+ this.vatDetails.add(vatDetail);
+ }
+
+
+ public void setParkingDate (Date fromDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.fromParkingDate = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+
+ }
+
+ public Date getFromParkingDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, 0L);
+
+ }
+
+ public Date getToParkingDate(Date issuingDate) {
+
+ if ( this.toParkingDate == null) return null;
+
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, 1439L);
+
+ }
+
+ public void setParkingDates(Date fromDate, Date toDate, Date issuingDate) {
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.fromParkingDate = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+
+
+ if (toDate != null) {
+ this.toParkingDate = DateTimeUtils.getDateDifference(fromDate,toDate);
+
+ }
+
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java
new file mode 100644
index 0000000..e4c42a6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java
@@ -0,0 +1,602 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class PassData extends Object {
+ public PassData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=1,maxValue=250)
+ @Asn1Optional public Long passType;
+
+ @FieldOrder(order = 7)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String passDescription;
+
+ @FieldOrder(order = 8)
+ @Asn1Default (value="second")
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 10)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 11)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 12)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 13)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 14)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 15)
+ @Asn1Optional public ValidityPeriodDetailType validityPeriodDetails;
+
+ @FieldOrder(order = 16)
+ @IntRange(minValue=0,maxValue=370)
+ @Asn1Optional public Long numberOfValidityDays;
+
+ @FieldOrder(order = 17)
+ @Asn1Optional public TrainValidityType trainValidity;
+
+ @FieldOrder(order = 18)
+ @IntRange(minValue=1,maxValue=250)
+ @Asn1Optional public Long numberOfPossibleTrips;
+
+ @FieldOrder(order = 19)
+ @IntRange(minValue=1,maxValue=250)
+ @Asn1Optional public Long numberOfDaysOfTravel;
+
+ @FieldOrder(order = 20)
+ @Asn1Optional public SequenceOfActivatedDays activatedDay;
+
+ @FieldOrder(order = 21)
+ @Asn1Optional public SequenceOfCountries countries;
+
+ @FieldOrder(order = 22)
+ @Asn1Optional public SequenceOfCarrierNum includedCarriersNum;
+
+ @FieldOrder(order = 23)
+ @Asn1Optional public SequenceOfStringIA5 includedCarriersIA5;
+
+ @FieldOrder(order = 24)
+ @Asn1Optional public SequenceOfCarrierNum excludedCarriersNum;
+
+ @FieldOrder(order = 25)
+ @Asn1Optional public SequenceOfStringIA5 excludedCarriersIA5;
+
+ @FieldOrder(order = 26)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 27)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+ @FieldOrder(order = 28)
+ @Asn1Optional public SequenceOfRegionalValidityType validRegion;
+
+ @FieldOrder(order = 29)
+ @Asn1Optional public SequenceOfTariffType tariffs;
+
+ @FieldOrder(order = 30)
+ @Asn1Optional Asn1BigInteger price;
+
+ @FieldOrder(order = 31)
+ @Asn1Optional SequenceOfVatDetail vatDetails;
+
+ @FieldOrder(order = 32)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 33)
+ @Asn1Optional public ExtensionData extension;
+
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getPassType() {
+
+ return this.passType;
+ }
+
+ public String getPassDescription() {
+
+ return this.passDescription;
+ }
+
+ public TravelClassType getClassCode() {
+
+ if (classCode == null){
+ return TravelClassType.second;
+ }
+
+ return this.classCode;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public ValidityPeriodDetailType getValidityPeriodDetails() {
+
+ return this.validityPeriodDetails;
+ }
+
+ public Long getNumberOfValidityDays() {
+
+ return this.numberOfValidityDays;
+ }
+
+ public Long getNumberOfPossibleTrips() {
+
+ return this.numberOfPossibleTrips;
+ }
+
+ public Long getNumberOfDaysOfTravel() {
+
+ return this.numberOfDaysOfTravel;
+ }
+
+ public List<Long> getActivatedDay() {
+
+ return this.activatedDay;
+ }
+
+ public List<Long> getCountries() {
+
+ return this.countries;
+ }
+
+ public List<Long> getIncludedCarriersNum() {
+
+ return this.includedCarriersNum;
+ }
+
+ public List<String> getIncludedCarriersIA5() {
+
+ return this.includedCarriersIA5;
+ }
+
+ public List<Long> getExcludedCarriersNum() {
+
+ return this.excludedCarriersNum;
+ }
+
+ public SequenceOfStringIA5 getExcludedCarriersIA5() {
+
+ return this.excludedCarriersIA5;
+ }
+
+ public SequenceOfServiceBrands getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public SequenceOfServiceBrands getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+ public List<RegionalValidityType> getValidRegion() {
+
+ return this.validRegion;
+ }
+
+ public List<TariffType> getTariffs() {
+
+ return this.tariffs;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+
+ this.referenceNum = referenceNum;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setPassType(Long passType) {
+
+ this.passType = passType;
+ }
+
+ public void setPassDescription(String passDescription) {
+
+ this.passDescription = passDescription;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+
+ this.classCode = classCode;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setValidityPeriodDetails(ValidityPeriodDetailType validityPeriodDetails) {
+
+ this.validityPeriodDetails = validityPeriodDetails;
+ }
+
+ public void setNumberOfValidityDays(Long numberOfValidityDays) {
+
+ this.numberOfValidityDays = numberOfValidityDays;
+ }
+
+ public void setNumberOfPossibleTrips(Long numberOfPossibleTrips) {
+
+ this.numberOfPossibleTrips = numberOfPossibleTrips;
+ }
+
+ public void setNumberOfDaysOfTravel(Long numberOfDaysOfTravel) {
+
+ this.numberOfDaysOfTravel = numberOfDaysOfTravel;
+ }
+
+ public void setActivatedDay(SequenceOfActivatedDays activatedDay) {
+
+ this.activatedDay = activatedDay;
+ }
+
+ public void setCountries(SequenceOfCountries countries) {
+
+ this.countries = countries;
+ }
+
+ public void setIncludedCarriersNum(SequenceOfCarrierNum includedCarriersNum) {
+
+ this.includedCarriersNum = includedCarriersNum;
+ }
+
+ public void setIncludedCarriersIA5(SequenceOfStringIA5 includedCarriersIA5) {
+
+ this.includedCarriersIA5 = includedCarriersIA5;
+ }
+
+ public void setExcludedCarriersNum(SequenceOfCarrierNum excludedCarriersNum) {
+
+ this.excludedCarriersNum = excludedCarriersNum;
+ }
+
+ public void setExcludedCarriersIA5(SequenceOfStringIA5 excludedCarriersIA5) {
+
+ this.excludedCarriersIA5 = excludedCarriersIA5;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+ public void setValidRegion(SequenceOfRegionalValidityType validRegion) {
+
+ this.validRegion = validRegion;
+ }
+
+ public void setTariffs(SequenceOfTariffType tariffs) {
+
+ this.tariffs = tariffs;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public Long getPrice() {
+ return Asn1BigInteger.toLong(price);
+ }
+
+ public void setPrice(Long price) {
+ this.price = Asn1BigInteger.toAsn1(price);
+ }
+
+ public SequenceOfVatDetail getVatDetails() {
+ return vatDetails;
+ }
+
+ public void setVatDetails(SequenceOfVatDetail vatDetails) {
+ this.vatDetails = vatDetails;
+ }
+
+ public void addVatDetail(VatDetailType vatDetail) {
+ if (this.vatDetails == null) {
+ this.vatDetails = new SequenceOfVatDetail();
+ }
+ this.vatDetails.add(vatDetail);
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public void addActivatedDays(Collection<Long> days) {
+
+ if (days == null || days.isEmpty()) return;
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ for (Long l : days) {
+ this.activatedDay.add(l);
+ }
+
+ }
+
+ public void addActivatedDay(Date issuingDate, Date day){
+
+ Long dayDiff = DateTimeUtils.getDateDifference(issuingDate, day);
+
+ if (this.activatedDay == null) {
+ this.activatedDay = new SequenceOfActivatedDays();
+ }
+
+ if (dayDiff != null) {
+ this.activatedDay.add(dayDiff);
+ }
+
+ }
+
+ /**
+ * Gets the activated days.
+ *
+ * @param issuingDate the issuing date
+ * @return the activated days
+ */
+ public Collection<Date> getActivatedDays(Date issuingDate) {
+
+ if (this.activatedDay == null) return null;
+
+ ArrayList<Date> dates = new ArrayList<Date>();
+
+ for (Long diff: this.getActivatedDay()) {
+
+ Date day = DateTimeUtils.getDate(this.getValidFromDate(issuingDate), diff, null);
+
+ if (day != null) {
+ dates.add(day);
+ }
+
+ }
+
+ return dates;
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+ public TrainValidityType getTrainValidity() {
+ return trainValidity;
+ }
+
+ public void setTrainValidity(TrainValidityType trainValidity) {
+ this.trainValidity = trainValidity;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassengerType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassengerType.java
new file mode 100644
index 0000000..7f58330
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassengerType.java
@@ -0,0 +1,46 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum PassengerType {
+ adult("adult"),
+ senior("senior"),
+ child("child"),
+ youth("youth"),
+ dog("dog"),
+ bicycle("bicycle"),
+ freeAddonPassenger("freeAddonPassenger"),
+ freeAddonChild("freeAddonChild");
+
+ public String text;
+
+ PassengerType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PlacesType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PlacesType.java
new file mode 100644
index 0000000..932a5c8
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PlacesType.java
@@ -0,0 +1,131 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+
+@Sequence
+public class PlacesType extends Object {
+ public PlacesType() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String coach;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String placeString;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String placeDescription;
+
+ @FieldOrder(order = 3)
+ @Asn1Optional public SequenceOfStringIA5 placeIA5;
+
+ @FieldOrder(order = 4)
+ @Asn1Optional public SequenceOfPlaceNum placeNum;
+
+
+
+ public String getCoach() {
+
+ return this.coach;
+ }
+
+ public String getPlaceString() {
+
+ return this.placeString;
+ }
+
+ public String getPlaceDescription() {
+
+ return this.placeDescription;
+ }
+
+ public SequenceOfStringIA5 getPlaceIA5() {
+
+ return this.placeIA5;
+ }
+
+ public SequenceOfPlaceNum getPlaceNum() {
+
+ return this.placeNum;
+ }
+
+ public void setCoach(String coach) {
+
+ this.coach = coach;
+ }
+
+ public void setPlaceString(String placeString) {
+
+ this.placeString = placeString;
+ }
+
+ public void setPlaceDescription(String placeDescription) {
+
+ this.placeDescription = placeDescription;
+ }
+
+ public void setPlaceIA5(SequenceOfStringIA5 placeIA5) {
+
+ this.placeIA5 = placeIA5;
+ }
+
+ public void setPlaceNum(SequenceOfPlaceNum placeNum) {
+
+ this.placeNum = placeNum;
+ }
+
+ @Override
+ public boolean equals(Object anObject) {
+ if (this == anObject) return true;
+ if ((anObject == null) || (anObject.getClass() != this.getClass())) return false;
+
+ PlacesType comparator = (PlacesType)anObject;
+
+ if ((this.getCoach() != comparator.getCoach()) && ((this.getCoach() == null) || (! this.getCoach().equals(comparator.getCoach())))) return false;
+ if ((this.getPlaceString() != comparator.getPlaceString()) && ((this.getPlaceString() == null) || (! this.getPlaceString().equals(comparator.getPlaceString())))) return false;
+ if ((this.getPlaceDescription() != comparator.getPlaceDescription()) && ((this.getPlaceDescription() == null) || (! this.getPlaceDescription().equals(comparator.getPlaceDescription())))) return false;
+ if ((this.getPlaceIA5() != comparator.getPlaceIA5()) && ((this.getPlaceIA5() == null) || (! this.getPlaceIA5().equals(comparator.getPlaceIA5())))) return false;
+ if ((this.getPlaceNum() != comparator.getPlaceNum()) && ((this.getPlaceNum() == null) || (! this.getPlaceNum().equals(comparator.getPlaceNum())))) return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 5477;
+
+ hash = 3547 * hash + (null == this.getCoach() ? 0 : this.getCoach().hashCode());
+ hash = 7321 * hash + (null == this.getPlaceString() ? 0 : this.getPlaceString().hashCode());
+ hash = 2083 * hash + (null == this.getPlaceDescription() ? 0 : this.getPlaceDescription().hashCode());
+ hash = 881 * hash + (null == this.getPlaceIA5() ? 0 : this.getPlaceIA5().hashCode());
+ hash = 6679 * hash + (null == this.getPlaceNum() ? 0 : this.getPlaceNum().hashCode());
+ return hash;
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PolygoneType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PolygoneType.java
new file mode 100644
index 0000000..7a0237c
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PolygoneType.java
@@ -0,0 +1,58 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class PolygoneType extends Object {
+ public PolygoneType() {
+ }
+
+ @FieldOrder(order = 0)
+ public GeoCoordinateType firstEdge;
+
+ @FieldOrder(order = 1)
+ public SequenceOfDeltaCoordinates edges;
+
+
+ public GeoCoordinateType getFirstEdge() {
+
+ return this.firstEdge;
+ }
+
+ public SequenceOfDeltaCoordinates getEdges() {
+
+ return this.edges;
+ }
+
+ public void setFirstEdge(GeoCoordinateType firstEdge) {
+
+ this.firstEdge = firstEdge;
+ }
+
+ public void setEdges(SequenceOfDeltaCoordinates edges) {
+
+ this.edges = edges;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PriceTypeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PriceTypeType.java
new file mode 100644
index 0000000..6581da4
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PriceTypeType.java
@@ -0,0 +1,39 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum PriceTypeType {
+ noPrice("noPrice"),
+ reservationFee("reservationFee"),
+ supplement("supplement"),
+ travelPrice("travelPrice");
+
+
+ public String text;
+
+ PriceTypeType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegionalValidityType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegionalValidityType.java
new file mode 100644
index 0000000..85b69e5
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegionalValidityType.java
@@ -0,0 +1,100 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Choice;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+
+@Choice
+@HasExtensionMarker
+public class RegionalValidityType extends Object {
+ public RegionalValidityType() {
+ }
+
+ @FieldOrder(order = 0)
+ public TrainLinkType trainLink;
+
+ @FieldOrder(order = 1)
+ public ViaStationType viaStations;
+
+ @FieldOrder(order = 2)
+ public ZoneType zones;
+
+ @FieldOrder(order = 3)
+ public LineType lines;
+
+ @FieldOrder(order = 4)
+ public PolygoneType polygone;
+
+
+ public TrainLinkType getTrainLink() {
+
+ return this.trainLink;
+ }
+
+ public ViaStationType getViaStations() {
+
+ return this.viaStations;
+ }
+
+ public ZoneType getZones() {
+
+ return this.zones;
+ }
+
+ public LineType getLines() {
+
+ return this.lines;
+ }
+
+ public PolygoneType getPolygone() {
+
+ return this.polygone;
+ }
+
+ public void setTrainLink(TrainLinkType trainLink) {
+
+ this.trainLink = trainLink;
+ }
+
+ public void setViaStations(ViaStationType viaStations) {
+
+ this.viaStations = viaStations;
+ }
+
+ public void setZones(ZoneType zones) {
+
+ this.zones = zones;
+ }
+
+ public void setLines(LineType lines) {
+
+ this.lines = lines;
+ }
+
+ public void setPolygone(PolygoneType polygone) {
+
+ this.polygone = polygone;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegisteredLuggageType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegisteredLuggageType.java
new file mode 100644
index 0000000..412aaaf
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RegisteredLuggageType.java
@@ -0,0 +1,80 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class RegisteredLuggageType extends Object {
+ public RegisteredLuggageType() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String registrationId;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1,maxValue=99)
+ @Asn1Optional public Long maxWeight;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=300)
+ @Asn1Optional public Long maxSize;
+
+ public String getRegistrationId() {
+
+ return this.registrationId;
+ }
+
+ public Long getMaxWeight() {
+
+ return this.maxWeight;
+ }
+
+ public Long getMaxSize() {
+
+ return this.maxSize;
+ }
+
+ public void setRegistrationId(String registrationId) {
+
+ this.registrationId = registrationId;
+ }
+
+ public void setMaxWeight(Long maxWeight) {
+
+ this.maxWeight = maxWeight;
+ }
+
+ public void setMaxSize(Long maxSize) {
+
+ this.maxSize = maxSize;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java
new file mode 100644
index 0000000..7026ee6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java
@@ -0,0 +1,711 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypes.SizeRange;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class ReservationData extends Object {
+ public ReservationData() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger trainNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trainIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Default(value="0")
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long departureDate;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 4)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 8)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=0,maxValue=32000)
+ @Asn1Optional public Long serviceBrand;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String serviceBrandAbrUTF8;
+
+ @FieldOrder(order = 11)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String serviceBrandNameUTF8;
+
+ @FieldOrder(order = 12)
+ @Asn1Default("seat")
+ @Asn1Optional public ServiceType service;
+
+ @FieldOrder(order = 13)
+ @Asn1Default("stationUICReservation")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 14)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 15)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 16)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 17)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 18)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 19)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ @FieldOrder(order = 20)
+ @IntRange(minValue=0,maxValue=1440)
+ public Long departureTime;
+
+ @FieldOrder(order = 21)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long departureUTCOffset;
+
+ @FieldOrder(order = 22)
+ @IntRange(minValue=-1,maxValue=20)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long arrivalDate;
+
+ @FieldOrder(order = 23)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long arrivalTime;
+
+ @FieldOrder(order = 24)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long arrivalUTCOffset;
+
+ @FieldOrder(order = 25)
+ @Asn1Optional public SequenceOfCarrierNum carrierNum;
+
+ @FieldOrder(order = 26)
+ @Asn1Optional public SequenceOfStringIA5 carrierIA5;
+
+ @FieldOrder(order = 27)
+ @Asn1Default("second")
+ @Asn1Optional public TravelClassType classCode;
+
+ @FieldOrder(order = 28)
+ @SizeRange(minValue = 1, maxValue = 2)
+ @Asn1Optional public String serviceLevel;
+
+ @FieldOrder(order = 29)
+ @Asn1Optional public PlacesType places;
+
+ @FieldOrder(order = 30)
+ @Asn1Optional public PlacesType additionalPlaces;
+
+ @FieldOrder(order = 31)
+ @Asn1Optional public PlacesType bicyclePlaces;
+
+ @FieldOrder(order = 32)
+ @Asn1Optional public CompartmentDetailsType compartmentDetails;
+
+ @FieldOrder(order = 33)
+ @IntRange(minValue=0,maxValue=200)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long numberOfOverbooked;
+
+ @FieldOrder(order = 34)
+ @Asn1Optional public SequenceOfBerthDetailData berth;
+
+ @FieldOrder(order = 35)
+ @Asn1Optional public SequenceOfTariffType tariff;
+
+ @FieldOrder(order = 36)
+ @Asn1Default("travelPrice")
+ @Asn1Optional public PriceTypeType priceType;
+
+ @FieldOrder(order = 37)
+ @Asn1Optional Asn1BigInteger price;
+
+ @FieldOrder(order = 38)
+ @Asn1Optional SequenceOfVatDetail vatDetails;
+
+ @FieldOrder(order = 39)
+ @IntRange(minValue=0,maxValue=9)
+ @Asn1Default("0")
+ @Asn1Optional public Long typeOfSupplement;
+
+ @FieldOrder(order = 40)
+ @IntRange(minValue=0,maxValue=200)
+ @Asn1Default("0")
+ @Asn1Optional public Long numberOfSupplements;
+
+ @FieldOrder(order = 41)
+ @Asn1Optional public LuggageRestrictionType luggage;
+
+ @FieldOrder(order = 42)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 43)
+ @Asn1Optional public ExtensionData extension;
+
+ public Long getTrainNum() {
+
+ return Asn1BigInteger.toLong(this.trainNum);
+ }
+
+ public String getTrainIA5() {
+ return this.trainIA5;
+ }
+
+ public Long getDepartureDate() {
+ return this.departureDate;
+ }
+
+ public String getReferenceIA5() {
+ return this.referenceIA5;
+ }
+
+ public Long getReferenceNum() {
+ return Asn1BigInteger.toLong(this.referenceNum);
+ }
+
+ public Long getProductOwnerNum() {
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+ return this.productIdIA5;
+ }
+
+ public Long getServiceBrand() {
+ return this.serviceBrand;
+ }
+
+ public String getServiceBrandAbrUTF8() {
+ return this.serviceBrandAbrUTF8;
+ }
+
+ public String getServiceBrandNameUTF8() {
+ return this.serviceBrandNameUTF8;
+ }
+
+ public ServiceType getService() {
+
+ if (service == null){
+ return ServiceType.seat;
+ }
+
+ return this.service;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUICReservation;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public Long getDepartureTime() {
+
+ return this.departureTime;
+ }
+
+ public Long getArrivalDate() {
+
+ if (arrivalDate == null) {
+ return new Long(0);
+ }
+
+ return this.arrivalDate;
+ }
+
+ public Long getArrivalTime() {
+
+ return this.arrivalTime;
+ }
+
+ public List<Long> getCarrierNum() {
+
+ return this.carrierNum;
+ }
+
+ public List<String> getCarrierIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public TravelClassType getClassCode() {
+
+
+ if (classCode == null) {
+ return TravelClassType.second;
+ }
+
+ return this.classCode;
+ }
+
+ public String getServiceLevel() {
+
+ return this.serviceLevel;
+ }
+
+ public PlacesType getPlaces() {
+
+ return this.places;
+ }
+
+ public PlacesType getAdditionalPlaces() {
+
+ return this.additionalPlaces;
+ }
+
+ public PlacesType getBicyclePlaces() {
+
+ return this.bicyclePlaces;
+ }
+
+ public CompartmentDetailsType getCompartmentDetails() {
+
+ return this.compartmentDetails;
+ }
+
+ public Long getNumberOfOverbooked() {
+
+ return this.numberOfOverbooked;
+ }
+
+ public List<BerthDetailData> getBerth() {
+
+ return this.berth;
+ }
+
+ public List<TariffType> getTariff() {
+
+ return this.tariff;
+ }
+
+ public PriceTypeType getPriceType() {
+
+ if (priceType == null) {
+ return PriceTypeType.travelPrice;
+ }
+
+ return this.priceType;
+ }
+
+ public Long getTypeOfSupplement() {
+
+ if (typeOfSupplement == null){
+ return new Long(0);
+ }
+
+
+ return this.typeOfSupplement;
+ }
+
+ public Long getNumberOfSupplements() {
+
+ if (numberOfSupplements == null) {
+ return new Long(0);
+ }
+
+ return this.numberOfSupplements;
+ }
+
+ public LuggageRestrictionType getLuggage() {
+
+ return this.luggage;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setTrainNum(Long trainNum) {
+
+ this.trainNum = Asn1BigInteger.toAsn1(trainNum);
+ }
+
+ public void setTrainIA5(String trainIA5) {
+
+ this.trainIA5 = trainIA5;
+ }
+
+ public void setDepartureDate(Long departureDate) {
+
+ this.departureDate = departureDate;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setServiceBrand(Long serviceBrand) {
+
+ this.serviceBrand = serviceBrand;
+ }
+
+ public void setServiceBrandAbrUTF8(String serviceBrandAbrUTF8) {
+
+ this.serviceBrandAbrUTF8 = serviceBrandAbrUTF8;
+ }
+
+ public void setServiceBrandNameUTF8(String serviceBrandNameUTF8) {
+
+ this.serviceBrandNameUTF8 = serviceBrandNameUTF8;
+ }
+
+ public void setService(ServiceType service) {
+
+ this.service = service;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+ public void setDepartureTime(Long departureTime) {
+
+ this.departureTime = departureTime;
+ }
+
+ public void setArrivalDate(Long arrivalDate) {
+
+ this.arrivalDate = arrivalDate;
+ }
+
+ public void setArrivalTime(Long arrivalTime) {
+
+ this.arrivalTime = arrivalTime;
+ }
+
+ public void setCarrierNum(SequenceOfCarrierNum carrierNum) {
+
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarriersNum(List<Long> longs) {
+ if (longs == null) return;
+
+ this.carrierNum = new SequenceOfCarrierNum();
+ this.carrierNum.addAll(longs);
+ }
+
+ public void setCarrierIA5(SequenceOfStringIA5 carrierIA5) {
+
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setClassCode(TravelClassType classCode) {
+
+ this.classCode = classCode;
+ }
+
+ public void setServiceLevel(String serviceLevel) {
+
+ this.serviceLevel = serviceLevel;
+ }
+
+ public void setPlaces(PlacesType places) {
+
+ this.places = places;
+ }
+
+ public void setAdditionalPlaces(PlacesType additionalPlaces) {
+
+ this.additionalPlaces = additionalPlaces;
+ }
+
+ public void setBicyclePlaces(PlacesType bicyclePlaces) {
+
+ this.bicyclePlaces = bicyclePlaces;
+ }
+
+ public void setCompartmentDetails(CompartmentDetailsType compartmentDetails) {
+
+ this.compartmentDetails = compartmentDetails;
+ }
+
+ public void setNumberOfOverbooked(Long numberOfOverbooked) {
+
+ this.numberOfOverbooked = numberOfOverbooked;
+ }
+
+ public void setBerth(SequenceOfBerthDetailData berth) {
+
+ this.berth = berth;
+ }
+
+ public void setTariff(SequenceOfTariffType tariff) {
+
+ this.tariff = tariff;
+ }
+
+ public void setPriceType(PriceTypeType priceType) {
+
+ this.priceType = priceType;
+ }
+
+ public void setTypeOfSupplement(Long typeOfSupplement) {
+
+ this.typeOfSupplement = typeOfSupplement;
+ }
+
+ public void setNumberOfSupplements(Long numberOfSupplements) {
+
+ this.numberOfSupplements = numberOfSupplements;
+ }
+
+ public void setLuggage(LuggageRestrictionType luggage) {
+
+ this.luggage = luggage;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public Long getPrice() {
+ return Asn1BigInteger.toLong(price);
+ }
+
+ public void setPrice(Long price) {
+ this.price = Asn1BigInteger.toAsn1(price);
+ }
+
+ public SequenceOfVatDetail getVatDetails() {
+ return vatDetails;
+ }
+
+ public void setVatDetails(SequenceOfVatDetail vatDetails) {
+ this.vatDetails = vatDetails;
+ }
+
+ public void addVatDetail(VatDetailType vatDetail) {
+ if (this.vatDetails == null) {
+ this.vatDetails = new SequenceOfVatDetail();
+ }
+ this.vatDetails.add(vatDetail);
+ }
+
+ public void setDepartureArrivalDates (Date departure, Date arrival, Date issuingDate){
+
+ if (issuingDate == null || departure == null) return;
+
+ this.departureDate = DateTimeUtils.getDateDifference(issuingDate,departure);
+ this.departureTime = DateTimeUtils.getTime(departure);
+
+ if (arrival != null){
+ this.arrivalDate = DateTimeUtils.getDateDifference(departure, arrival);
+ this.arrivalTime = DateTimeUtils.getTime(arrival);
+ }
+
+ }
+
+ public Date getDepartureDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.departureDate, this.departureTime);
+
+ }
+
+ public Date getArrivalDate(Date issuingDate){
+
+ if (this.departureDate == null) {
+ this.departureDate = 0L;
+ }
+
+ if (this.arrivalDate == null) {
+ return null;
+ }
+
+ return DateTimeUtils.getDate(issuingDate, this.departureDate + this.arrivalDate, this.arrivalTime);
+ }
+
+ public Long getDepartureUTCOffset() {
+ return departureUTCOffset;
+ }
+
+ public void setDepartureUTCOffset(Long departureUTCOffset) {
+ this.departureUTCOffset = departureUTCOffset;
+ }
+
+ public Long getArrivalUTCOffset() {
+ return arrivalUTCOffset;
+ }
+
+ public void setArrivalUTCOffset(Long arrivalUTCOffset) {
+ this.arrivalUTCOffset = arrivalUTCOffset;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReturnRouteDescriptionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReturnRouteDescriptionType.java
new file mode 100644
index 0000000..e7559d6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReturnRouteDescriptionType.java
@@ -0,0 +1,150 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class ReturnRouteDescriptionType extends Object {
+ public ReturnRouteDescriptionType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String validReturnRegionDesc;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public SequenceOfRegionalValidityType validReturnRegion;
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public String getValidReturnRegionDesc() {
+
+ return this.validReturnRegionDesc;
+ }
+
+ public List<RegionalValidityType> getValidReturnRegion() {
+
+ return this.validReturnRegion;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+ public void setValidReturnRegionDesc(String validReturnRegionDesc) {
+
+ this.validReturnRegionDesc = validReturnRegionDesc;
+ }
+
+ public void setValidReturnRegion(SequenceOfRegionalValidityType validReturnRegion) {
+
+ this.validReturnRegion = validReturnRegion;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RoofRackType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RoofRackType.java
new file mode 100644
index 0000000..8699983
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RoofRackType.java
@@ -0,0 +1,46 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum RoofRackType {
+ norack("norack"),
+ roofRailing("roofRailing"),
+ luggageRack("luggageRack"),
+ skiRack("skiRack"),
+ boxRack("boxRack"),
+ rackWithOneBox("rackWithOneBox"),
+ rackWithTwoBoxes("rackWithTwoBoxes"),
+ bicycleRack("bicycleRack"),
+ otherRack("otherRack");
+
+ public String text;
+
+ RoofRackType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RouteSectionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RouteSectionType.java
new file mode 100644
index 0000000..a70ba68
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/RouteSectionType.java
@@ -0,0 +1,138 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class RouteSectionType extends Object {
+ public RouteSectionType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationNameUTF8;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationNameUTF8;
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getFromStationNum() {
+
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+
+ return this.toStationIA5;
+ }
+
+ public String getFromStationNameUTF8() {
+
+ return this.fromStationNameUTF8;
+ }
+
+ public String getToStationNameUTF8() {
+
+ return this.toStationNameUTF8;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationNameUTF8(String fromStationNameUTF8) {
+
+ this.fromStationNameUTF8 = fromStationNameUTF8;
+ }
+
+ public void setToStationNameUTF8(String toStationNameUTF8) {
+
+ this.toStationNameUTF8 = toStationNameUTF8;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java
new file mode 100644
index 0000000..0dd12a1
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java
@@ -0,0 +1,26 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=0,maxValue=370)
+public class SequenceOfActivatedDays extends Asn1SequenceOf<Long> {
+ public SequenceOfActivatedDays() { super(); }
+ public SequenceOfActivatedDays(Collection<Long> coll) { super(coll); }
+
+ public SequenceOfActivatedDays(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfActivatedDays getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfActivatedDays(numList);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfBerthDetailData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfBerthDetailData.java
new file mode 100644
index 0000000..3d1a8a7
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfBerthDetailData.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfBerthDetailData extends Asn1SequenceOf<BerthDetailData> {
+ public SequenceOfBerthDetailData() { super(); }
+ public SequenceOfBerthDetailData(Collection<BerthDetailData> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCardReferenceType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCardReferenceType.java
new file mode 100644
index 0000000..21d6301
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCardReferenceType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfCardReferenceType extends Asn1SequenceOf<CardReferenceType> {
+ public SequenceOfCardReferenceType() { super(); }
+ public SequenceOfCardReferenceType(Collection<CardReferenceType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierIA5.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierIA5.java
new file mode 100644
index 0000000..d23dd51
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierIA5.java
@@ -0,0 +1,13 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+
+@RestrictedString(CharacterRestriction.IA5String)
+public class SequenceOfCarrierIA5 extends Asn1SequenceOf<String> {
+ public SequenceOfCarrierIA5() { super(); }
+ public SequenceOfCarrierIA5(Collection<String> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java
new file mode 100644
index 0000000..3447264
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java
@@ -0,0 +1,28 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=1,maxValue=32000)
+public class SequenceOfCarrierNum extends Asn1SequenceOf<Long> {
+ public SequenceOfCarrierNum() { super(); }
+ public SequenceOfCarrierNum(Collection<Long> coll) { super(coll); }
+
+
+ public SequenceOfCarrierNum(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+ public static SequenceOfCarrierNum getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfCarrierNum(numList);
+ }
+
+
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java
new file mode 100644
index 0000000..46c72e8
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java
@@ -0,0 +1,27 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=1,maxValue=250)
+public class SequenceOfCountries extends Asn1SequenceOf<Long> {
+ public SequenceOfCountries() { super(); }
+ public SequenceOfCountries(Collection<Long> coll) { super(coll); }
+
+
+ public SequenceOfCountries(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfCountries getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfCountries(numList);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCustomerStatusType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCustomerStatusType.java
new file mode 100644
index 0000000..6447c94
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCustomerStatusType.java
@@ -0,0 +1,11 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfCustomerStatusType extends Asn1SequenceOf<CustomerStatusType> {
+ public SequenceOfCustomerStatusType() { super(); }
+ public SequenceOfCustomerStatusType(Collection<CustomerStatusType> coll) { super(coll); }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDeltaCoordinates.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDeltaCoordinates.java
new file mode 100644
index 0000000..9f1ffa4
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDeltaCoordinates.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfDeltaCoordinates extends Asn1SequenceOf<DeltaCoordinates> {
+ public SequenceOfDeltaCoordinates() { super(); }
+ public SequenceOfDeltaCoordinates(Collection<DeltaCoordinates> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDocumentData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDocumentData.java
new file mode 100644
index 0000000..ef983a5
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfDocumentData.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfDocumentData extends Asn1SequenceOf<DocumentData> {
+ public SequenceOfDocumentData() { super(); }
+ public SequenceOfDocumentData(Collection<DocumentData> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfExtensionData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfExtensionData.java
new file mode 100644
index 0000000..7ae363f
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfExtensionData.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfExtensionData extends Asn1SequenceOf<ExtensionData> {
+ public SequenceOfExtensionData() { super(); }
+ public SequenceOfExtensionData(Collection<ExtensionData> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfIncludedOpenTicketType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfIncludedOpenTicketType.java
new file mode 100644
index 0000000..0b48d9a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfIncludedOpenTicketType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfIncludedOpenTicketType extends Asn1SequenceOf<IncludedOpenTicketType> {
+ public SequenceOfIncludedOpenTicketType() { super(); }
+ public SequenceOfIncludedOpenTicketType(Collection<IncludedOpenTicketType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java
new file mode 100644
index 0000000..1a6dbfc
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java
@@ -0,0 +1,28 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=1,maxValue=254)
+public class SequenceOfPlaceNum extends Asn1SequenceOf<Long> {
+ public SequenceOfPlaceNum() { super(); }
+ public SequenceOfPlaceNum(Collection<Long> coll) { super(coll); }
+
+
+
+ public SequenceOfPlaceNum(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfPlaceNum getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfPlaceNum(numList);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegionalValidityType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegionalValidityType.java
new file mode 100644
index 0000000..216861c
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegionalValidityType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfRegionalValidityType extends Asn1SequenceOf<RegionalValidityType> {
+ public SequenceOfRegionalValidityType() { super(); }
+ public SequenceOfRegionalValidityType(Collection<RegionalValidityType> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegisteredLuggageType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegisteredLuggageType.java
new file mode 100644
index 0000000..190a5e6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfRegisteredLuggageType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfRegisteredLuggageType extends Asn1SequenceOf<RegisteredLuggageType> {
+ public SequenceOfRegisteredLuggageType() { super(); }
+ public SequenceOfRegisteredLuggageType(Collection<RegisteredLuggageType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java
new file mode 100644
index 0000000..381ca64
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java
@@ -0,0 +1,26 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=0,maxValue=32000)
+public class SequenceOfServiceBrands extends Asn1SequenceOf<Long> {
+ public SequenceOfServiceBrands() { super(); }
+ public SequenceOfServiceBrands(Collection<Long> coll) { super(coll); }
+
+
+ public SequenceOfServiceBrands(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfServiceBrands getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfServiceBrands(numList);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTariffType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTariffType.java
new file mode 100644
index 0000000..d54d9af
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTariffType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfTariffType extends Asn1SequenceOf<TariffType> {
+ public SequenceOfTariffType() { super(); }
+ public SequenceOfTariffType(Collection<TariffType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTicketLinkType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTicketLinkType.java
new file mode 100644
index 0000000..0d785b6
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTicketLinkType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfTicketLinkType extends Asn1SequenceOf<TicketLinkType> {
+ public SequenceOfTicketLinkType() { super(); }
+ public SequenceOfTicketLinkType(Collection<TicketLinkType> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java
new file mode 100644
index 0000000..edec045
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java
@@ -0,0 +1,26 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=0,maxValue=31)
+public class SequenceOfTransportTypes extends Asn1SequenceOf<Long> {
+ public SequenceOfTransportTypes() { super(); }
+ public SequenceOfTransportTypes(Collection<Long> coll) { super(coll); }
+
+
+ public SequenceOfTransportTypes(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfTransportTypes getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfTransportTypes(numList);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java
new file mode 100644
index 0000000..6808104
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java
@@ -0,0 +1,26 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.IntRange;
+
+@IntRange(minValue=1,maxValue=254)
+public class SequenceOfTravelerId extends Asn1SequenceOf<Long> {
+ public SequenceOfTravelerId() { super(); }
+ public SequenceOfTravelerId(Collection<Long> coll) { super(coll); }
+
+ public SequenceOfTravelerId(List<Long> numbers) {
+ super();
+ for (Long number: numbers){
+ this.add(new Long(number));
+ }
+ }
+
+ public static SequenceOfTravelerId getSequence(List<Long> numList) {
+ if (numList == null || numList.isEmpty()) return null;
+ return new SequenceOfTravelerId(numList);
+ }
+
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerType.java
new file mode 100644
index 0000000..720d29d
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfTravelerType extends Asn1SequenceOf<TravelerType> {
+ public SequenceOfTravelerType() { super(); }
+ public SequenceOfTravelerType(Collection<TravelerType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfVatDetail.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfVatDetail.java
new file mode 100644
index 0000000..f2b7a06
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfVatDetail.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfVatDetail extends Asn1SequenceOf<VatDetailType> {
+ public SequenceOfVatDetail() { super(); }
+ public SequenceOfVatDetail(Collection<VatDetailType> coll) { super(coll); }
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfViaStationType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfViaStationType.java
new file mode 100644
index 0000000..ef9119f
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfViaStationType.java
@@ -0,0 +1,10 @@
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+
+public class SequenceOfViaStationType extends Asn1SequenceOf<ViaStationType> {
+ public SequenceOfViaStationType() { super(); }
+ public SequenceOfViaStationType(Collection<ViaStationType> coll) { super(coll); }
+} \ No newline at end of file
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SeriesDetailType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SeriesDetailType.java
new file mode 100644
index 0000000..bf97009
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SeriesDetailType.java
@@ -0,0 +1,75 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class SeriesDetailType extends Object {
+ public SeriesDetailType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long supplyingCarrier;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1,maxValue=99)
+ @Asn1Optional public Long offerIdentification;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger series;
+
+
+ public Long getSupplyingCarrier() {
+
+ return this.supplyingCarrier;
+ }
+
+ public Long getOfferIdentification() {
+
+ return this.offerIdentification;
+ }
+
+ public Long getSeries() {
+
+ return Asn1BigInteger.toLong(this.series);
+ }
+
+ public void setSupplyingCarrier(Long supplyingCarrier) {
+
+ this.supplyingCarrier = supplyingCarrier;
+ }
+
+ public void setOfferIdentification(Long offerIdentification) {
+
+ this.offerIdentification = offerIdentification;
+ }
+
+ public void setSeries(Long series) {
+
+ this.series = Asn1BigInteger.toAsn1(series);
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ServiceType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ServiceType.java
new file mode 100644
index 0000000..0f32ac4
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ServiceType.java
@@ -0,0 +1,38 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+public enum ServiceType {
+ seat("seat"),
+ couchette("couchette"),
+ berth("berth"),
+ carcarriage("carcarriage");
+
+ public String text;
+
+ ServiceType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/StationPassageData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/StationPassageData.java
new file mode 100644
index 0000000..d734342
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/StationPassageData.java
@@ -0,0 +1,387 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringUTF8;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class StationPassageData extends Object {
+ public StationPassageData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String productName;
+
+ @FieldOrder(order = 7)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public SequenceOfUnrestrictedLong stationNum;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public SequenceOfStringIA5 stationIA5;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public SequenceOfStringUTF8 stationNameUTF8;
+
+ @FieldOrder(order = 11)
+ @Asn1Optional public SequenceOfUnrestrictedLong areaCodeNum;
+
+ @FieldOrder(order = 12)
+ @Asn1Optional public SequenceOfStringIA5 areaCodeIA5;
+
+ @FieldOrder(order = 13)
+ @Asn1Optional public SequenceOfStringUTF8 areaNameUTF8;
+
+ @FieldOrder(order = 14)
+ @IntRange(minValue=-367,maxValue=700)
+ public Long validFromDay;
+
+ @FieldOrder(order = 15)
+ @IntRange(minValue=0,maxValue=1440)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 16)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 17)
+ @Asn1Default(value="0")
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 18)
+ @IntRange(minValue=0,maxValue=1440)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 19)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 20)
+ @Asn1Optional public Asn1BigInteger numberOfDaysValid;
+
+ @FieldOrder(order = 21)
+ @Asn1Optional public ExtensionData extension;
+
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public String getProductName() {
+
+ return this.productName;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public SequenceOfUnrestrictedLong getStationNum() {
+
+ return this.stationNum;
+ }
+
+ public List<String> getStationIA5() {
+
+ return this.stationIA5;
+ }
+
+ public SequenceOfStringUTF8 getStationNameUTF8() {
+
+ return this.stationNameUTF8;
+ }
+
+ public SequenceOfUnrestrictedLong getAreaCodeNum() {
+
+ return this.areaCodeNum;
+ }
+
+ public List<String> getAreaCodeIA5() {
+
+ return this.areaCodeIA5;
+ }
+
+ public List<String> getAreaNameUTF8() {
+
+ return this.areaNameUTF8;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public Long getNumberOfDaysValid() {
+
+ return Asn1BigInteger.toLong(numberOfDaysValid);
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+
+ this.referenceNum = referenceNum;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setProductName(String productName) {
+
+ this.productName = productName;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setStationNum(SequenceOfUnrestrictedLong stationNum) {
+
+ this.stationNum = stationNum;
+ }
+
+ public void setStationIA5(SequenceOfStringIA5 stationIA5) {
+
+ this.stationIA5 = stationIA5;
+ }
+
+ public void setStationNameUTF8(SequenceOfStringUTF8 stationNameUTF8) {
+
+ this.stationNameUTF8 = stationNameUTF8;
+ }
+
+ public void setAreaCodeNum(SequenceOfUnrestrictedLong sequenceOfUnrestrictedLong) {
+
+ this.areaCodeNum = sequenceOfUnrestrictedLong;
+ }
+
+ public void setAreaCodeIA5(SequenceOfStringIA5 areaCodeIA5) {
+
+ this.areaCodeIA5 = areaCodeIA5;
+ }
+
+ public void setAreaNameUTF8(SequenceOfStringUTF8 areaNameUTF8) {
+
+ this.areaNameUTF8 = areaNameUTF8;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setNumberOfDaysValid(Long numberOfDaysValid) {
+
+ this.numberOfDaysValid = Asn1BigInteger.toAsn1(numberOfDaysValid);
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java
new file mode 100644
index 0000000..1159451
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java
@@ -0,0 +1,206 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class TariffType extends Object {
+ public TariffType() {
+ }
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=200)
+ @Asn1Default(value = "1")
+ @Asn1Optional public Long numberOfPassengers;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public PassengerType passengerType;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=64)
+ @Asn1Optional public Long ageBelow;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=1,maxValue=128)
+ @Asn1Optional public Long ageAbove;
+
+ @FieldOrder(order = 5)
+ @Asn1Optional public SequenceOfTravelerId traverlerid;
+
+ @FieldOrder(order = 6)
+ public Boolean restrictedToCountryOfResidence;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public RouteSectionType restrictedToRouteSection;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public SeriesDetailType seriesDataDetails;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public Asn1BigInteger tariffIdNum;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String tariffIdIA5;
+
+ @FieldOrder(order = 11)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String tariffDesc;
+
+ @FieldOrder(order = 12)
+ @Asn1Optional public SequenceOfCardReferenceType reductionCard;
+
+
+
+ public Long getNumberOfPassengers() {
+
+ if (numberOfPassengers == null) {
+ return new Long(1);
+ }
+
+ return this.numberOfPassengers;
+ }
+
+ public PassengerType getPassengerType() {
+
+ return this.passengerType;
+ }
+
+ public Long getAgeBelow() {
+
+ return this.ageBelow;
+ }
+
+ public Long getAgeAbove() {
+
+ return this.ageAbove;
+ }
+
+ public SequenceOfTravelerId getTraverlerid() {
+
+ return this.traverlerid;
+ }
+
+ public Boolean getRestrictedToCountryOfResidence() {
+
+ return this.restrictedToCountryOfResidence;
+ }
+
+ public RouteSectionType getRestrictedToRouteSection() {
+
+ return this.restrictedToRouteSection;
+ }
+
+ public SeriesDetailType getSeriesDataDetails() {
+
+ return this.seriesDataDetails;
+ }
+
+ public Long getTariffIdNum() {
+
+ return Asn1BigInteger.toLong(this.tariffIdNum);
+ }
+
+ public String getTariffIdIA5() {
+
+ return this.tariffIdIA5;
+ }
+
+ public String getTariffDesc() {
+
+ return this.tariffDesc;
+ }
+
+ public SequenceOfCardReferenceType getReductionCard() {
+
+ return this.reductionCard;
+ }
+
+ public void setNumberOfPassengers(Long numberOfPassengers) {
+
+ this.numberOfPassengers = numberOfPassengers;
+ }
+
+ public void setPassengerType(PassengerType passengerType) {
+
+ this.passengerType = passengerType;
+ }
+
+ public void setAgeBelow(Long ageBelow) {
+
+ this.ageBelow = ageBelow;
+ }
+
+ public void setAgeAbove(Long ageAbove) {
+
+ this.ageAbove = ageAbove;
+ }
+
+ public void setTraverlerid(SequenceOfTravelerId traverlerid) {
+
+ this.traverlerid = traverlerid;
+ }
+
+ public void setRestrictedToCountryOfResidence(Boolean restrictedToCountryOfResidence) {
+
+ this.restrictedToCountryOfResidence = restrictedToCountryOfResidence;
+ }
+
+ public void setRestrictedToRouteSection(RouteSectionType restrictedToRouteSection) {
+
+ this.restrictedToRouteSection = restrictedToRouteSection;
+ }
+
+ public void setSeriesDataDetails(SeriesDetailType seriesDataDetails) {
+
+ this.seriesDataDetails = seriesDataDetails;
+ }
+
+ public void setTariffIdNum(Long tariffIdNum) {
+
+ this.tariffIdNum = Asn1BigInteger.toAsn1(tariffIdNum);
+ }
+
+ public void setTariffIdIA5(String tariffIdIA5) {
+
+ this.tariffIdIA5 = tariffIdIA5;
+ }
+
+ public void setTariffDesc(String tariffDesc) {
+
+ this.tariffDesc = tariffDesc;
+ }
+
+ public void setReductionCard(SequenceOfCardReferenceType reductionCard) {
+
+ this.reductionCard = reductionCard;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketDetailData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketDetailData.java
new file mode 100644
index 0000000..a5e2e56
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketDetailData.java
@@ -0,0 +1,190 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+
+
+import org.uic.barcode.asn1.datatypes.Choice;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@Choice
+@HasExtensionMarker
+public class TicketDetailData extends Object {
+ public TicketDetailData() {
+ }
+
+ @FieldOrder(order = 0)
+ public ReservationData reservation;
+
+ @FieldOrder(order = 1)
+ public CarCarriageReservationData carCarriageReservation;
+
+ @FieldOrder(order = 2)
+ public OpenTicketData openTicket;
+
+ @FieldOrder(order = 3)
+ public PassData pass;
+
+ @FieldOrder(order = 4)
+ public VoucherData voucher;
+
+ @FieldOrder(order = 5)
+ public CustomerCardData customerCard;
+
+ @FieldOrder(order = 6)
+ public CountermarkData counterMark;
+
+ @FieldOrder(order = 7)
+ public ParkingGroundData parkingGround;
+
+ @FieldOrder(order = 8)
+ public FIPTicketData fipTicket;
+
+ @FieldOrder(order = 9)
+ public StationPassageData stationPassage;
+
+ @FieldOrder(order = 10)
+ public DelayConfirmation delayConfirmation;
+
+ @FieldOrder(order = 11)
+ public ExtensionData extension;
+
+ public ReservationData getReservation() {
+
+ return this.reservation;
+ }
+
+ public CarCarriageReservationData getCarCarriageReservation() {
+
+ return this.carCarriageReservation;
+ }
+
+ public OpenTicketData getOpenTicket() {
+
+ return this.openTicket;
+ }
+
+ public PassData getPass() {
+
+ return this.pass;
+ }
+
+ public VoucherData getVoucher() {
+
+ return this.voucher;
+ }
+
+ public CustomerCardData getCustomerCard() {
+
+ return this.customerCard;
+ }
+
+ public CountermarkData getCounterMark() {
+
+ return this.counterMark;
+ }
+
+ public ParkingGroundData getParkingGround() {
+
+ return this.parkingGround;
+ }
+
+ public FIPTicketData getFipTicket() {
+
+ return this.fipTicket;
+ }
+
+ public StationPassageData getStationPassage() {
+
+ return this.stationPassage;
+ }
+
+ public DelayConfirmation getDelayConfirmation() {
+
+ return this.delayConfirmation;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReservation(ReservationData reservation) {
+
+ this.reservation = reservation;
+ }
+
+ public void setCarCarriageReservation(CarCarriageReservationData carCarriageReservation) {
+
+ this.carCarriageReservation = carCarriageReservation;
+ }
+
+ public void setOpenTicket(OpenTicketData openTicket) {
+
+ this.openTicket = openTicket;
+ }
+
+ public void setPass(PassData pass) {
+
+ this.pass = pass;
+ }
+
+ public void setVoucher(VoucherData voucher) {
+
+ this.voucher = voucher;
+ }
+
+ public void setCustomerCard(CustomerCardData customerCard) {
+
+ this.customerCard = customerCard;
+ }
+
+ public void setCounterMark(CountermarkData counterMark) {
+
+ this.counterMark = counterMark;
+ }
+
+ public void setParkingGround(ParkingGroundData parkingGround) {
+
+ this.parkingGround = parkingGround;
+ }
+
+ public void setFipTicket(FIPTicketData fipTicket) {
+
+ this.fipTicket = fipTicket;
+ }
+
+ public void setStationPassage(StationPassageData stationPassage) {
+
+ this.stationPassage = stationPassage;
+ }
+
+ public void setDelayConfirmation(DelayConfirmation delayConfirmation) {
+
+ this.delayConfirmation = delayConfirmation;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketLinkType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketLinkType.java
new file mode 100644
index 0000000..c74ccb8
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketLinkType.java
@@ -0,0 +1,156 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class TicketLinkType extends Object {
+ public TicketLinkType() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String issuerName;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String issuerPNR;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 6)
+ @Asn1Default(value="openTicket")
+ @Asn1Optional public TicketType ticketType;
+
+ @FieldOrder(order = 7)
+ @Asn1Default(value="issuedTogether")
+ @Asn1Optional public LinkMode linkMode;
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Long getReferenceNum() {
+ return Asn1BigInteger.toLong(this.referenceNum);
+ }
+
+ public String getIssuerName() {
+
+ return this.issuerName;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public TicketType getTicketType() {
+
+ if (ticketType == null) {
+ return TicketType.openTicket;
+ }
+
+ return this.ticketType;
+ }
+
+ public LinkMode getLinkMode() {
+
+ if (linkMode == null){
+ return LinkMode.issuedTogether;
+ }
+
+ return this.linkMode;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Long referenceNum) {
+ this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
+ }
+
+ public void setIssuerName(String issuerName) {
+
+ this.issuerName = issuerName;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setTicketType(TicketType ticketType) {
+
+ this.ticketType = ticketType;
+ }
+
+ public void setLinkMode(LinkMode linkMode) {
+
+ this.linkMode = linkMode;
+ }
+
+ public String getIssuerPNR() {
+ return issuerPNR;
+ }
+
+ public void setIssuerPNR(String issuerPNR) {
+ this.issuerPNR = issuerPNR;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketType.java
new file mode 100644
index 0000000..1639cb9
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TicketType.java
@@ -0,0 +1,41 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum TicketType {
+ openTicket("openTicket"),
+ pass("pass"),
+ reservation("reservation"),
+ carCarriageReservation("carCarriageReservation");
+
+ public String text;
+
+ TicketType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TimeRangeType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TimeRangeType.java
new file mode 100644
index 0000000..ac8afd8
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TimeRangeType.java
@@ -0,0 +1,59 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class TimeRangeType extends Object {
+ public TimeRangeType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=0,maxValue=1439)
+ public Long fromTime;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=0,maxValue=1439)
+ public Long untilTime;
+
+ public Long getFromTime() {
+
+ return this.fromTime;
+ }
+
+ public Long getUntilTime() {
+
+ return this.untilTime;
+ }
+
+ public void setFromTime(Long fromTime) {
+
+ this.fromTime = fromTime;
+ }
+
+ public void setUntilTime(Long untilTime) {
+
+ this.untilTime = untilTime;
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TokenType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TokenType.java
new file mode 100644
index 0000000..4a38157
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TokenType.java
@@ -0,0 +1,92 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.OctetString;
+
+@Sequence
+public class TokenType extends Object {
+ public TokenType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Long tokenProviderNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String tokenProviderIA5;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String tokenSpecification;
+
+ @FieldOrder(order = 4)
+ public OctetString token;
+
+ public Long getTokenProviderNum() {
+
+ return this.tokenProviderNum;
+ }
+
+ public String getTokenProviderIA5() {
+
+ return this.tokenProviderIA5;
+ }
+
+ public String getTokenSpecification() {
+
+ return this.tokenSpecification;
+ }
+
+ public byte[] getToken() {
+
+ return token.toByteArray();
+
+ }
+
+ public void setTokenProviderNum(Long tokenProviderNum) {
+
+ this.tokenProviderNum = tokenProviderNum;
+ }
+
+ public void setTokenProviderIA5(String tokenProviderIA5) {
+
+ this.tokenProviderIA5 = tokenProviderIA5;
+ }
+
+ public void setTokenSpecification(String tokenSpecification) {
+
+ this.tokenSpecification = tokenSpecification;
+ }
+
+ public void setToken(byte[] token) {
+
+ this.token = new OctetString(token);
+
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java
new file mode 100644
index 0000000..3a06ff0
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java
@@ -0,0 +1,185 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+public class TrainLinkType extends Object {
+ public TrainLinkType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public Asn1BigInteger trainNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String trainIA5;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=-1,maxValue=370)
+ public Long travelDate;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=0,maxValue=1440)
+ public Long departureTime;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long departureUTCOffset;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long fromStationNum;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String fromStationIA5;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long toStationNum;
+
+ @FieldOrder(order = 8)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String toStationIA5;
+
+ @FieldOrder(order = 9)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String fromStationName;
+
+ @FieldOrder(order = 10)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String toStationName;
+
+ public Long getTrainNum() {
+ return Asn1BigInteger.toLong(this.trainNum);
+ }
+
+ public String getTrainIA5() {
+ return this.trainIA5;
+ }
+
+ public Long getTravelDate() {
+ return this.travelDate;
+ }
+
+ public Long getDepartureTime() {
+ return this.departureTime;
+ }
+
+ public Long getFromStationNum() {
+ return this.fromStationNum;
+ }
+
+ public String getFromStationIA5() {
+ return this.fromStationIA5;
+ }
+
+ public Long getToStationNum() {
+ return this.toStationNum;
+ }
+
+ public String getToStationIA5() {
+ return this.toStationIA5;
+ }
+
+ public String getFromStationName() {
+ return this.fromStationName;
+ }
+
+ public String getToStationName() {
+ return this.toStationName;
+ }
+
+ public void setTrainNum(Long trainNum) {
+ this.trainNum = Asn1BigInteger.toAsn1(trainNum);
+ }
+
+ public void setTrainIA5(String trainIA5) {
+ this.trainIA5 = trainIA5;
+ }
+
+ public void setTravelDate(Long travelDate) {
+ this.travelDate = travelDate;
+ }
+
+ public void setDepartureTime(Long departureTime) {
+ this.departureTime = departureTime;
+ }
+
+ public void setFromStationNum(Long fromStationNum) {
+ this.fromStationNum = fromStationNum;
+ }
+
+ public void setFromStationIA5(String fromStationIA5) {
+ this.fromStationIA5 = fromStationIA5;
+ }
+
+ public void setToStationNum(Long toStationNum) {
+ this.toStationNum = toStationNum;
+ }
+
+ public void setToStationIA5(String toStationIA5) {
+ this.toStationIA5 = toStationIA5;
+ }
+
+ public void setFromStationName(String fromStationName) {
+ this.fromStationName = fromStationName;
+ }
+
+ public void setToStationName(String toStationName) {
+ this.toStationName = toStationName;
+ }
+
+ public void setDepartureDate(Date departure, Date issuingDate){
+
+ if (issuingDate == null || departure == null) return;
+
+ this.travelDate = DateTimeUtils.getDateDifference(issuingDate,departure);
+ this.departureTime = DateTimeUtils.getTime(departure);
+ }
+
+ public void setDepartureTimeZone(Date dateLocal, Date dateUTC ) {
+ // -- (UTC = local + offset * 15 Minutes)
+ this.departureUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+ }
+
+ public Date getDepartureDate(Date issuingDate){
+ return DateTimeUtils.getDate(issuingDate, this.travelDate, this.departureTime);
+ }
+
+ public Date getUTCDepartureDate(Date issuingDate){
+ return DateTimeUtils.getUTCDate(issuingDate, this.travelDate, this.departureTime, this.departureUTCOffset);
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java
new file mode 100644
index 0000000..88e5614
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java
@@ -0,0 +1,255 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+@HasExtensionMarker
+public class TrainValidityType extends Object {
+ public TrainValidityType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=-1,maxValue=700)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public SequenceOfCarrierNum includedCarriersNum;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public SequenceOfStringIA5 includedCarriersIA5;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public SequenceOfCarrierNum excludedCarriersNum;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public SequenceOfStringIA5 excludedCarriersIA5;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 11)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+
+ @FieldOrder(order = 12)
+ @Asn1Default (value="boarding")
+ @Asn1Optional public BoardingOrArrivalType bordingOrArrival;
+
+ public BoardingOrArrivalType getBordingOrArrival() {
+ return bordingOrArrival;
+ }
+
+ public void setBordingOrArrival(BoardingOrArrivalType bordingOrArrival) {
+ this.bordingOrArrival = bordingOrArrival;
+ }
+
+ public Long getValidFromDay() {
+
+ if (validFromDay == null) {
+ return new Long(0);
+ }
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ if (validUntilDay == null) {
+ return new Long(0);
+ }
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+ public SequenceOfCarrierNum getIncludedCarriersNum() {
+
+ return this.includedCarriersNum;
+ }
+
+ public List<String> getIncludedCarriersIA5() {
+
+ return this.includedCarriersIA5;
+ }
+
+ public SequenceOfCarrierNum getExcludedCarriersNum() {
+
+ return this.excludedCarriersNum;
+ }
+
+ public SequenceOfStringIA5 getExcludedCarriersIA5() {
+
+ return this.excludedCarriersIA5;
+ }
+
+ public SequenceOfServiceBrands getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public SequenceOfServiceBrands getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+ public void setIncludedCarriersNum(SequenceOfCarrierNum includedCarriersNum) {
+ this.includedCarriersNum = includedCarriersNum;
+ }
+
+ public void setIncludedCarriersIA5(SequenceOfStringIA5 includedCarriersIA5) {
+ this.includedCarriersIA5 = includedCarriersIA5;
+ }
+
+ public void setExcludedCarriersNum(SequenceOfCarrierNum excludedCarriersNum) {
+ this.excludedCarriersNum = excludedCarriersNum;
+ }
+
+ public void setExcludedCarriersIA5(SequenceOfStringIA5 excludedCarriersIA5) {
+ this.excludedCarriersIA5 = excludedCarriersIA5;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelClassType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelClassType.java
new file mode 100644
index 0000000..7869c97
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelClassType.java
@@ -0,0 +1,50 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum TravelClassType {
+ notApplicabel("notApplicabel"),
+ first("first"),
+ second("second"),
+ tourist("tourist"),
+ comfort("comfort"),
+ premium("premium"),
+ business("business"),
+ all("all"),
+ premiumFirst("premiumFirst"),
+ standardFirst("standardFirst"),
+ premiumSecond("premiumSecond"),
+ standardSecond("standardSecond");
+
+
+ public String text;
+
+ TravelClassType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerData.java
new file mode 100644
index 0000000..0b3288a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerData.java
@@ -0,0 +1,82 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.FixedSize;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+@HasExtensionMarker
+public class TravelerData extends Object {
+ public TravelerData() {
+ }
+ @FieldOrder(order = 0)
+ @Asn1Optional public SequenceOfTravelerType traveler;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @FixedSize(2)
+ @Asn1Optional public String preferedLanguage;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String groupName;
+
+
+ public List<TravelerType> getTraveler() {
+
+ return this.traveler;
+ }
+
+ public String getPreferedLanguage() {
+
+ return this.preferedLanguage;
+ }
+
+ public String getGroupName() {
+
+ return this.groupName;
+ }
+
+ public void setTraveler(SequenceOfTravelerType traveler) {
+
+ this.traveler = traveler;
+ }
+
+ public void setPreferedLanguage(String preferedLanguage) {
+
+ this.preferedLanguage = preferedLanguage;
+ }
+
+ public void setGroupName(String groupName) {
+
+ this.groupName = groupName;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java
new file mode 100644
index 0000000..e41f758
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java
@@ -0,0 +1,334 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypes.SizeRange;
+
+@Sequence
+@HasExtensionMarker
+public class TravelerType extends Object {
+ public TravelerType() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String firstName;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String secondName;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String lastName;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String idCard;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String passportId;
+
+ @FieldOrder(order = 5)
+ @SizeRange(minValue = 1, maxValue = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String title;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public GenderType gender;
+
+ @FieldOrder(order = 7)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String customerIdIA5;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public Long customerIdNum;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=1901,maxValue=2155)
+ @Asn1Optional public Long yearOfBirth;
+
+ @FieldOrder(order = 10)
+ @IntRange(minValue=1,maxValue=12)
+ @Asn1Optional public Long monthOfBirth;
+
+ @FieldOrder(order = 11)
+ @IntRange(minValue=1,maxValue=31)
+ @Asn1Optional public Long dayOfBirth;
+
+ @FieldOrder(order = 12)
+ public Boolean ticketHolder = true;
+
+ @FieldOrder(order = 13)
+ @Asn1Optional public PassengerType passengerType;
+
+ @FieldOrder(order = 14)
+ @Asn1Optional public Boolean passengerWithReducedMobility;
+
+ @FieldOrder(order = 15)
+ @IntRange(minValue=1,maxValue=999)
+ @Asn1Optional public Long countryOfResidence;
+
+ @FieldOrder(order = 16)
+ @IntRange(minValue=1,maxValue=999)
+ @Asn1Optional public Long countryOfPassport;
+
+ @FieldOrder(order = 17)
+ @IntRange(minValue=1,maxValue=999)
+ @Asn1Optional public Long countryOfIdCard;
+
+ @FieldOrder(order = 18)
+ @Asn1Optional public SequenceOfCustomerStatusType status;
+
+
+
+ public String getFirstName() {
+
+ return this.firstName;
+ }
+
+ public String getSecondName() {
+
+ return this.secondName;
+ }
+
+ public String getLastName() {
+
+ return this.lastName;
+ }
+
+ public String getIdCard() {
+
+ return this.idCard;
+ }
+
+ public String getPassportId() {
+
+ return this.passportId;
+ }
+
+ public String getTitle() {
+
+ return this.title;
+ }
+
+ public GenderType getGender() {
+
+ return this.gender;
+ }
+
+ public String getCustomerIdIA5() {
+
+ return this.customerIdIA5;
+ }
+
+ public Long getCustomerIdNum() {
+
+ return this.customerIdNum;
+ }
+
+ public Long getYearOfBirth() {
+
+ return this.yearOfBirth;
+ }
+
+ public Long getDayOfBirth() {
+
+ return this.dayOfBirth;
+ }
+
+ public Boolean getTicketHolder() {
+
+ return this.ticketHolder;
+ }
+
+ public PassengerType getPassengerType() {
+
+ return this.passengerType;
+ }
+
+ public Boolean getPassengerWithReducedMobility() {
+ return this.passengerWithReducedMobility;
+ }
+
+ public Long getCountryOfResidence() {
+
+ return this.countryOfResidence;
+ }
+
+ public Long getCountryOfPassport() {
+
+ return this.countryOfPassport;
+ }
+
+ public Long getCountryOfIdCard() {
+
+ return this.countryOfIdCard;
+ }
+
+ public SequenceOfCustomerStatusType getStatus() {
+
+ return this.status;
+ }
+
+ public void setFirstName(String firstName) {
+
+ this.firstName = firstName;
+ }
+
+ public void setSecondName(String secondName) {
+
+ this.secondName = secondName;
+ }
+
+ public void setLastName(String lastName) {
+
+ this.lastName = lastName;
+ }
+
+ public void setIdCard(String idCard) {
+
+ this.idCard = idCard;
+ }
+
+ public void setPassportId(String passportId) {
+
+ this.passportId = passportId;
+ }
+
+ public void setTitle(String title) {
+
+ this.title = title;
+ }
+
+ public void setGender(GenderType gender) {
+
+ this.gender = gender;
+ }
+
+ public void setCustomerIdIA5(String customerIdIA5) {
+
+ this.customerIdIA5 = customerIdIA5;
+ }
+
+ public void setCustomerIdNum(Long customerIdNum) {
+
+ this.customerIdNum = customerIdNum;
+ }
+
+ public void setYearOfBirth(Long yearOfBirth) {
+
+ this.yearOfBirth = yearOfBirth;
+ }
+
+ public void setDayOfBirth(Long dayOfBirth) {
+
+ this.dayOfBirth = dayOfBirth;
+ }
+
+ public void setTicketHolder(Boolean ticketHolder) {
+
+ this.ticketHolder = ticketHolder;
+ }
+
+ public void setPassengerType(PassengerType passengerType) {
+
+ this.passengerType = passengerType;
+ }
+
+ public void setPassengerWithReducedMobility(Boolean passengerWithReducedMobility) {
+
+ this.passengerWithReducedMobility = passengerWithReducedMobility;
+ }
+
+ public void setCountryOfResidence(Long countryOfResidence) {
+
+ this.countryOfResidence = countryOfResidence;
+ }
+
+ public void setCountryOfPassport(Long countryOfPassport) {
+
+ this.countryOfPassport = countryOfPassport;
+ }
+
+ public void setCountryOfIdCard(Long countryOfIdCard) {
+
+ this.countryOfIdCard = countryOfIdCard;
+ }
+
+ public void setStatus(SequenceOfCustomerStatusType status) {
+
+ this.status = status;
+ }
+
+ public Long getMonthOfBirth() {
+ return monthOfBirth;
+ }
+
+ public void setMonthOfBirth(Long monthOfBirth) {
+ this.monthOfBirth = monthOfBirth;
+ }
+
+ public void setDateOfBirth(Date date){
+
+ if (date == null) return;
+
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+
+ this.yearOfBirth = new Long( cal.get(Calendar.YEAR));
+ this.monthOfBirth = new Long(cal.get(Calendar.MONTH) + 1);
+ this.dayOfBirth = new Long (cal.get(Calendar.DAY_OF_MONTH));
+
+ }
+
+ public Date getDateOfBirth() {
+
+ if (this.yearOfBirth == null) return null;
+ if (this.dayOfBirth == null) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.yearOfBirth.intValue());
+ cal.set(Calendar.MONTH, (int)(this.monthOfBirth - 1));
+ cal.set(Calendar.DAY_OF_MONTH, this.dayOfBirth.intValue());
+ cal.set(Calendar.HOUR_OF_DAY,0);
+ cal.set(Calendar.MINUTE,0);
+
+ return cal.getTime();
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/UicRailTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/UicRailTicketData.java
new file mode 100644
index 0000000..c881ba9
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/UicRailTicketData.java
@@ -0,0 +1,115 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.List;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.uper.UperEncoder;
+
+@Sequence
+@HasExtensionMarker
+public class UicRailTicketData extends Object {
+ public UicRailTicketData() {
+ }
+
+ @FieldOrder(order = 0)
+ public IssuingData issuingDetail;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public TravelerData travelerDetail;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public SequenceOfDocumentData transportDocument;
+
+ @FieldOrder(order = 3)
+ @Asn1Optional public ControlData controlDetail;
+
+ @FieldOrder(order = 4)
+ @Asn1Optional public SequenceOfExtensionData extension;
+
+ public IssuingData getIssuingDetail() {
+
+ return this.issuingDetail;
+ }
+
+ public TravelerData getTravelerDetail() {
+
+ return this.travelerDetail;
+ }
+
+ public List<DocumentData> getTransportDocument() {
+
+ return this.transportDocument;
+ }
+
+ public ControlData getControlDetail() {
+
+ return this.controlDetail;
+ }
+
+ public List<ExtensionData> getExtension() {
+
+ return this.extension;
+ }
+
+ public void setIssuingDetail(IssuingData issuingDetail) {
+
+ this.issuingDetail = issuingDetail;
+ }
+
+ public void setTravelerDetail(TravelerData travelerDetail) {
+
+ this.travelerDetail = travelerDetail;
+ }
+
+ public void setTransportDocument(SequenceOfDocumentData transportDocument) {
+
+ this.transportDocument = transportDocument;
+ }
+
+ public void setControlDetail(ControlData controlDetail) {
+
+ this.controlDetail = controlDetail;
+ }
+
+ public void setExtension(SequenceOfExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+
+ public byte[] encode(){
+ return UperEncoder.encode(this);
+ }
+
+ public String encodeToHex(){
+ return UperEncoder.hexStringFromBytes(UperEncoder.encode(this));
+ }
+
+
+ public static UicRailTicketData decode(byte[] bytes) {
+ return UperEncoder.decode(bytes, UicRailTicketData.class);
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodDetailType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodDetailType.java
new file mode 100644
index 0000000..946df05
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodDetailType.java
@@ -0,0 +1,73 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Collection;
+
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.Asn1SequenceOf;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class ValidityPeriodDetailType extends Object {
+ public ValidityPeriodDetailType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Optional public SequenceOfValidityPeriodType validityPeriod;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public SequenceOfTimeRangeType excludedTimeRange;
+
+
+ public class SequenceOfTimeRangeType extends Asn1SequenceOf<TimeRangeType> {
+ public SequenceOfTimeRangeType() { super(); }
+ public SequenceOfTimeRangeType(Collection<TimeRangeType> coll) { super(coll); }
+ }
+
+
+ public class SequenceOfValidityPeriodType extends Asn1SequenceOf<ValidityPeriodType> {
+ public SequenceOfValidityPeriodType() { super(); }
+ public SequenceOfValidityPeriodType(Collection<ValidityPeriodType> coll) { super(coll); }
+ }
+
+ public SequenceOfValidityPeriodType getValidityPeriod() {
+
+ return this.validityPeriod;
+ }
+
+ public SequenceOfTimeRangeType getExcludedTimeRange() {
+
+ return this.excludedTimeRange;
+ }
+
+ public void setValidityPeriod(SequenceOfValidityPeriodType validityPeriod) {
+
+ this.validityPeriod = validityPeriod;
+ }
+
+ public void setExcludedTimeRange(SequenceOfTimeRangeType excludedTimeRange) {
+
+ this.excludedTimeRange = excludedTimeRange;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java
new file mode 100644
index 0000000..4c421eb
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java
@@ -0,0 +1,165 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.ticket.api.utils.DateTimeUtils;
+
+@Sequence
+public class ValidityPeriodType extends Object {
+ public ValidityPeriodType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=-367,maxValue=700)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long validFromDay;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validFromTime;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validFromUTCOffset;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Default(value="0")
+ @Asn1Optional public Long validUntilDay;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=1439)
+ @Asn1Optional public Long validUntilTime;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=-60, maxValue=60)
+ @Asn1Optional public Long validUntilUTCOffset;
+
+ public Long getValidFromDay() {
+
+ if (validFromDay == null) {
+ return new Long(0);
+ }
+
+ return this.validFromDay;
+ }
+
+ public Long getValidFromTime() {
+
+ return this.validFromTime;
+ }
+
+ public Long getValidUntilDay() {
+
+ if (validUntilDay == null) {
+ return new Long(0);
+ }
+
+ return this.validUntilDay;
+ }
+
+ public Long getValidUntilTime() {
+
+ return this.validUntilTime;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidFromTime(Long validFromTime) {
+
+ this.validFromTime = validFromTime;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValidUntilTime(Long validUntilTime) {
+
+ this.validUntilTime = validUntilTime;
+ }
+
+ public void setValidityDates (Date fromDate, Date untilDate, Date issuingDate){
+
+ if (issuingDate == null || fromDate == null) return;
+
+ this.validFromDay = DateTimeUtils.getDateDifference(issuingDate,fromDate);
+ this.validFromTime = DateTimeUtils.getTime(fromDate);
+
+ if (untilDate != null){
+ this.validUntilDay = DateTimeUtils.getDateDifference(fromDate, untilDate);
+ this.validUntilTime = DateTimeUtils.getTime(untilDate);
+ }
+
+ }
+
+ public Date getValidFromDate(Date issuingDate){
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
+
+ }
+
+ public Date getValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+
+ return DateTimeUtils.getDate(issuingDate, this.validFromDay + this.validUntilDay, this.validUntilTime);
+
+ }
+
+ public Long getValidFromUTCOffset() {
+ return validFromUTCOffset;
+ }
+
+ public void setValidFromUTCOffset(Long validFromUTCOffset) {
+ this.validFromUTCOffset = validFromUTCOffset;
+ }
+
+ public Long getValidUntilUTCOffset() {
+ return validUntilUTCOffset;
+ }
+
+ public void setValidUntilUTCOffset(Long validUntilUTCOffset) {
+ this.validUntilUTCOffset = validUntilUTCOffset;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VatDetailType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VatDetailType.java
new file mode 100644
index 0000000..a805046
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VatDetailType.java
@@ -0,0 +1,86 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+@Sequence
+public class VatDetailType extends Object {
+ public VatDetailType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue = 1, maxValue = 999)
+ public Long country;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue = 0, maxValue = 999)
+ public Long percentage;
+
+ @FieldOrder(order = 2)
+ @Asn1Optional public Asn1BigInteger amount;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String vatId;
+
+ public Long getCountry() {
+ return country;
+ }
+
+ public void setCountry(Long country) {
+ this.country = country;
+ }
+
+ public Long getPercentage() {
+ return percentage;
+ }
+
+ public void setPercentage(Long percentage) {
+ this.percentage = percentage;
+ }
+
+ public Long getAmount() {
+ return Asn1BigInteger.toLong(amount);
+ }
+
+ public void setAmount(Long amount) {
+ this.amount = Asn1BigInteger.toAsn1(amount);
+ }
+
+ public String getVatId() {
+ return vatId;
+ }
+
+ public void setVatId(String vatId) {
+ this.vatId = vatId;
+ }
+
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ViaStationType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ViaStationType.java
new file mode 100644
index 0000000..d47bd98
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ViaStationType.java
@@ -0,0 +1,205 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+
+@Sequence
+@HasExtensionMarker
+public class ViaStationType extends Object {
+ public ViaStationType() {
+ }
+
+ @FieldOrder(order = 0)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 1)
+ @IntRange(minValue=1,maxValue=9999999)
+ @Asn1Optional public Long stationNum;
+
+ @FieldOrder(order = 2)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String stationIA5;
+
+ @FieldOrder(order = 3)
+ @Asn1Optional public SequenceOfViaStationType alternativeRoutes;
+
+ @FieldOrder(order = 4)
+ @Asn1Optional public SequenceOfViaStationType route;
+
+ @FieldOrder(order = 5)
+ @Asn1Optional public Boolean border = false;
+
+ @FieldOrder(order = 6)
+ @Asn1Optional public SequenceOfCarrierNum carriersNum;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public SequenceOfStringIA5 carriersIA5;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public Asn1BigInteger seriesId;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public Asn1BigInteger routeId;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public SequenceOfServiceBrands includedServiceBrands;
+
+ @FieldOrder(order = 11)
+ @Asn1Optional public SequenceOfServiceBrands excludedServiceBrands;
+
+
+
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getStationNum() {
+
+ return this.stationNum;
+ }
+
+ public String getStationIA5() {
+
+ return this.stationIA5;
+ }
+
+ public SequenceOfViaStationType getAlternativeRoutes() {
+
+ return this.alternativeRoutes;
+ }
+
+ public SequenceOfViaStationType getRoute() {
+
+ return this.route;
+ }
+
+ public Boolean getBorder() {
+
+ return this.border;
+ }
+
+ public SequenceOfCarrierNum getCarriersNum() {
+
+ return this.carriersNum;
+ }
+
+ public SequenceOfStringIA5 getCarriersIA5() {
+
+ return this.carriersIA5;
+ }
+
+ public Long getSeriesId() {
+
+ return Asn1BigInteger.toLong(this.seriesId);
+ }
+
+ public Long getRouteId() {
+
+ return Asn1BigInteger.toLong(this.routeId);
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setStationNum(Long stationNum) {
+
+ this.stationNum = stationNum;
+ }
+
+ public void setStationIA5(String stationIA5) {
+
+ this.stationIA5 = stationIA5;
+ }
+
+ public void setAlternativeRoutes(SequenceOfViaStationType alternativeRoutes) {
+
+ this.alternativeRoutes = alternativeRoutes;
+ }
+
+ public void setRoute(SequenceOfViaStationType route) {
+
+ this.route = route;
+ }
+
+ public void setBorder(Boolean border) {
+
+ this.border = border;
+ }
+
+ public void setCarriersNum(SequenceOfCarrierNum carriersNum) {
+
+ this.carriersNum = carriersNum;
+ }
+
+ public void setCarriersIA5(SequenceOfStringIA5 carriersIA5) {
+
+ this.carriersIA5 = carriersIA5;
+ }
+
+ public void setSeriesId(Long seriesId) {
+
+ this.seriesId = Asn1BigInteger.toAsn1(seriesId);
+ }
+
+ public void setRouteId(Long routeId) {
+
+ this.routeId = Asn1BigInteger.toAsn1(routeId);
+ }
+
+ public SequenceOfServiceBrands getIncludedServiceBrands() {
+
+ return this.includedServiceBrands;
+ }
+
+ public SequenceOfServiceBrands getExcludedServiceBrands() {
+
+ return this.excludedServiceBrands;
+ }
+
+ public void setIncludedServiceBrands(SequenceOfServiceBrands includedServiceBrands) {
+ this.includedServiceBrands = includedServiceBrands;
+ }
+
+ public void setExcludedServiceBrands(SequenceOfServiceBrands excludedServiceBrands) {
+ this.excludedServiceBrands = excludedServiceBrands;
+ }
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java
new file mode 100644
index 0000000..b867e40
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java
@@ -0,0 +1,316 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+
+
+@Sequence
+@HasExtensionMarker
+public class VoucherData extends Object {
+ public VoucherData() {
+ }
+
+ @FieldOrder(order = 0)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String referenceIA5;
+
+ @FieldOrder(order = 1)
+ @Asn1Optional public Asn1BigInteger referenceNum;
+
+ @FieldOrder(order = 2)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long productOwnerNum;
+
+ @FieldOrder(order = 3)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productOwnerIA5;
+
+ @FieldOrder(order = 4)
+ @IntRange(minValue=0,maxValue=65535)
+ @Asn1Optional public Long productIdNum;
+
+ @FieldOrder(order = 5)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String productIdIA5;
+
+ @FieldOrder(order = 6)
+ @IntRange(minValue=2016,maxValue=2269)
+ public Long validFromYear;
+
+ @FieldOrder(order = 7)
+ @IntRange(minValue=0,maxValue=370)
+ public Long validFromDay;
+
+ @FieldOrder(order = 8)
+ @IntRange(minValue=2016,maxValue=2269)
+ public Long validUntilYear;
+
+ @FieldOrder(order = 9)
+ @IntRange(minValue=0,maxValue=370)
+ public Long validUntilDay;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public Long value;
+
+ @FieldOrder(order = 11)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long type;
+
+ @FieldOrder(order = 12)
+ @RestrictedString(CharacterRestriction.UTF8String)
+ @Asn1Optional public String infoText;
+
+ @FieldOrder(order = 13)
+ @Asn1Optional public ExtensionData extension;
+
+
+ public String getReferenceIA5() {
+
+ return this.referenceIA5;
+ }
+
+ public Asn1BigInteger getReferenceNum() {
+
+ return this.referenceNum;
+ }
+
+ public Long getProductOwnerNum() {
+
+ return this.productOwnerNum;
+ }
+
+ public String getProductOwnerIA5() {
+
+ return this.productOwnerIA5;
+ }
+
+ public Long getProductIdNum() {
+
+ return this.productIdNum;
+ }
+
+ public String getProductIdIA5() {
+
+ return this.productIdIA5;
+ }
+
+ public Long getValidFromYear() {
+
+ return this.validFromYear;
+ }
+
+ public Long getValidFromDay() {
+
+ return this.validFromDay;
+ }
+
+ public Long getValidUntilYear() {
+
+ return this.validUntilYear;
+ }
+
+ public Long getValidUntilDay() {
+
+ return this.validUntilDay;
+ }
+
+ public Long getValue() {
+
+ return this.value;
+ }
+
+ public Long getType() {
+
+ return this.type;
+ }
+
+ public String getInfoText() {
+
+ return this.infoText;
+ }
+
+ public ExtensionData getExtension() {
+
+ return this.extension;
+ }
+
+ public void setReferenceIA5(String referenceIA5) {
+
+ this.referenceIA5 = referenceIA5;
+ }
+
+ public void setReferenceNum(Asn1BigInteger referenceNum) {
+
+ this.referenceNum = referenceNum;
+ }
+
+ public void setProductOwnerNum(Long productOwnerNum) {
+
+ this.productOwnerNum = productOwnerNum;
+ }
+
+ public void setProductOwnerIA5(String productOwnerIA5) {
+
+ this.productOwnerIA5 = productOwnerIA5;
+ }
+
+ public void setProductIdNum(Long productIdNum) {
+
+ this.productIdNum = productIdNum;
+ }
+
+ public void setProductIdIA5(String productIdIA5) {
+
+ this.productIdIA5 = productIdIA5;
+ }
+
+ public void setValidFromYear(Long validFromYear) {
+
+ this.validFromYear = validFromYear;
+ }
+
+ public void setValidFromDay(Long validFromDay) {
+
+ this.validFromDay = validFromDay;
+ }
+
+ public void setValidUntilYear(Long validUntilYear) {
+
+ this.validUntilYear = validUntilYear;
+ }
+
+ public void setValidUntilDay(Long validUntilDay) {
+
+ this.validUntilDay = validUntilDay;
+ }
+
+ public void setValue(Long value) {
+
+ this.value = value;
+ }
+
+ public void setType(Long type) {
+
+ this.type = type;
+ }
+
+ public void setInfoText(String infoText) {
+
+ this.infoText = infoText;
+ }
+
+ public void setExtension(ExtensionData extension) {
+
+ this.extension = extension;
+ }
+
+
+ public void setValidity (Date fromDate , Date untilDate){
+
+ Calendar fromCal = Calendar.getInstance();
+ fromCal.clear();
+ fromCal.setTime(fromDate);
+
+ this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
+ this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+
+ if (untilDate == null) return;
+
+ Calendar untilCal = Calendar.getInstance();
+ untilCal.clear();
+ untilCal.setTime(untilDate);
+
+ this.validUntilYear = new Long( untilCal.get(Calendar.YEAR));
+ this.validUntilDay = new Long (untilCal.get(Calendar.DAY_OF_YEAR));
+
+ }
+
+
+ public void setValidFrom (Date fromDate){
+
+ if (fromDate == null) return;
+
+ Calendar fromCal = Calendar.getInstance();
+ fromCal.clear();
+ fromCal.setTime(fromDate);
+
+ this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
+ this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+
+ }
+
+ public void setValidUntil (Date untilDate){
+
+ if (untilDate == null) return;
+
+ Calendar untilCal = Calendar.getInstance();
+ untilCal.clear();
+ untilCal.setTime(untilDate);
+
+ this.validUntilYear = new Long( untilCal.get(Calendar.YEAR));
+ this.validUntilDay = new Long (untilCal.get(Calendar.DAY_OF_YEAR));
+
+ }
+
+ public Date getValidFrom(){
+
+ if (this.validFromYear == null || this.validFromYear == 0) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.validFromYear.intValue());
+ cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
+
+ return cal.getTime();
+
+ }
+
+ public Date getValidUntil(){
+
+ if (this.validUntilYear == null || this.validUntilYear == 0) return null;
+
+ Calendar cal = Calendar.getInstance();
+ cal.clear();
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.set(Calendar.YEAR, this.validUntilYear.intValue());
+ cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
+
+ return cal.getTime();
+
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ZoneType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ZoneType.java
new file mode 100644
index 0000000..3e3f193
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ZoneType.java
@@ -0,0 +1,182 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.asn.omv3;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypes.Asn1Default;
+import org.uic.barcode.asn1.datatypes.Asn1Optional;
+import org.uic.barcode.asn1.datatypes.CharacterRestriction;
+import org.uic.barcode.asn1.datatypes.FieldOrder;
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+import org.uic.barcode.asn1.datatypes.IntRange;
+import org.uic.barcode.asn1.datatypes.RestrictedString;
+import org.uic.barcode.asn1.datatypes.Sequence;
+import org.uic.barcode.asn1.datatypesimpl.OctetString;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+
+@Sequence
+@HasExtensionMarker
+
+public class ZoneType extends Object {
+ public ZoneType() {
+ }
+
+ @FieldOrder(order = 0)
+ @IntRange(minValue=1,maxValue=32000)
+ @Asn1Optional public Long carrierNum;
+
+ @FieldOrder(order = 1)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String carrierIA5;
+
+ @FieldOrder(order = 2)
+ @Asn1Default("stationUIC")
+ @Asn1Optional public CodeTableType stationCodeTable;
+
+ @FieldOrder(order = 3)
+ @IntRange(minValue=0,maxValue=9999999)
+ @Asn1Optional public Long entryStationNum;
+
+ @FieldOrder(order = 4)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String entryStationIA5;
+
+ @FieldOrder(order = 5)
+ @IntRange(minValue=0,maxValue=9999999)
+ @Asn1Optional public Long terminatingStationNum;
+
+ @FieldOrder(order = 6)
+ @RestrictedString(CharacterRestriction.IA5String)
+ @Asn1Optional public String terminatingStationIA5;
+
+ @FieldOrder(order = 7)
+ @Asn1Optional public Asn1BigInteger city;
+
+ @FieldOrder(order = 8)
+ @Asn1Optional public SequenceOfUnrestrictedLong zoneId;
+
+ @FieldOrder(order = 9)
+ @Asn1Optional public OctetString binaryZoneId;
+
+ @FieldOrder(order = 10)
+ @Asn1Optional public String nutsCode;
+
+
+ public Long getCarrierNum() {
+
+ return this.carrierNum;
+ }
+
+ public String getCarrierIA5() {
+
+ return this.carrierIA5;
+ }
+
+ public CodeTableType getStationCodeTable() {
+
+ if (stationCodeTable == null) {
+ return CodeTableType.stationUIC;
+ }
+
+ return this.stationCodeTable;
+ }
+
+ public Long getEntryStationNum() {
+ return this.entryStationNum;
+ }
+
+ public String getEntryStationIA5() {
+ return this.entryStationIA5;
+ }
+
+ public Long getTerminatingStationNum() {
+ return this.terminatingStationNum;
+ }
+
+ public String getTerminatingStationIA5() {
+ return this.terminatingStationIA5;
+ }
+
+ public Asn1BigInteger getCity() {
+ return this.city;
+ }
+
+ public SequenceOfUnrestrictedLong getZoneId() {
+ return this.zoneId;
+ }
+
+ public byte[] getBinaryZoneId() {
+
+ return binaryZoneId.toByteArray();
+
+ }
+
+ public String getNutsCode() {
+ return this.nutsCode;
+ }
+
+ public void setCarrierNum(Long carrierNum) {
+ this.carrierNum = carrierNum;
+ }
+
+ public void setCarrierIA5(String carrierIA5) {
+ this.carrierIA5 = carrierIA5;
+ }
+
+ public void setStationCodeTable(CodeTableType stationCodeTable) {
+ this.stationCodeTable = stationCodeTable;
+ }
+
+ public void setEntryStationNum(Long entryStationNum) {
+ this.entryStationNum = entryStationNum;
+ }
+
+ public void setEntryStationIA5(String entryStationIA5) {
+ this.entryStationIA5 = entryStationIA5;
+ }
+
+ public void setTerminatingStationNum(Long terminatingStationNum) {
+ this.terminatingStationNum = terminatingStationNum;
+ }
+
+ public void setTerminatingStationIA5(String terminatingStationIA5) {
+ this.terminatingStationIA5 = terminatingStationIA5;
+ }
+
+ public void setCity(Asn1BigInteger city) {
+ this.city = city;
+ }
+
+ public void setZoneId(SequenceOfUnrestrictedLong zoneId) {
+ this.zoneId = zoneId;
+ }
+
+ public void setBinaryZoneId(byte[] binaryZoneId) {
+
+ this.binaryZoneId = new OctetString(binaryZoneId);
+
+ }
+
+ public void setNutsCode(String nutsCode) {
+ this.nutsCode = nutsCode;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
index a8f4a92..479db78 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
@@ -11,6 +11,7 @@ import org.uic.barcode.ticket.api.spec.IExtension;
import org.uic.barcode.ticket.api.spec.IPass;
import org.uic.barcode.ticket.api.spec.IRegionalValidity;
import org.uic.barcode.ticket.api.spec.ITariff;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
import org.uic.barcode.ticket.api.spec.ITravelClassType;
import org.uic.barcode.ticket.api.spec.IValidityDetails;
import org.uic.barcode.ticket.api.spec.IVatDetail;
@@ -97,6 +98,9 @@ public class SimplePass extends SimpleDocumentData implements IPass {
/** The price. */
protected Long price;
+
+
+ protected ITrainValidity trainValidity;
/* (nicht-Javadoc)
@@ -482,4 +486,14 @@ public class SimplePass extends SimpleDocumentData implements IPass {
this.setValidUntil(date);
}
+ @Override
+ public void setTrainValidity(ITrainValidity trainValidity) {
+ this.trainValidity = trainValidity;
+ }
+
+ @Override
+ public ITrainValidity getTrainValidity() {
+ return trainValidity;
+ }
+
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java
new file mode 100644
index 0000000..610a268
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java
@@ -0,0 +1,197 @@
+package org.uic.barcode.ticket.api.impl;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.LinkedHashSet;
+
+import org.uic.barcode.ticket.api.spec.IBoardingOrArrivalType;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
+
+/**
+ * The Class SimpleTrainValidity.
+ */
+public class SimpleTrainValidity implements ITrainValidity {
+
+
+ /** The valid from. */
+ protected Date validFrom;
+
+ /** The valid until. */
+ protected Date validUntil;
+
+ /** The included carriers. */
+ protected Collection<String>includedCarriers = new LinkedHashSet<String>();
+
+ /** The excluded carriers. */
+ protected Collection<String>excludedCarriers = new LinkedHashSet<String>();
+
+ /** The included service brands. */
+ protected Collection<Integer>includedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The excluded service brands. */
+ protected Collection<Integer>excludedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The class code. */
+ protected IBoardingOrArrivalType boardingOrArrival = IBoardingOrArrivalType.boarding;
+
+ /** The valid from utc coffset. */
+ protected Long validFromUTCoffset;
+
+ /** The valid until utc coffset. */
+ protected Long validUntilUTCoffset;
+
+
+ /**
+ * Gets the included carriers.
+ *
+ * @return the included carriers
+ */
+ public Collection<String> getIncludedCarriers() {
+ return includedCarriers;
+ }
+
+
+ /**
+ * Adds the included carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addIncludedCarrier(String carrier) {
+ this.includedCarriers.add(carrier);
+ }
+
+ /**
+ * Gets the excluded carriers.
+ *
+ * @return the excluded carriers
+ */
+ public Collection<String> getExcludedCarriers() {
+ return excludedCarriers;
+ }
+
+ /**
+ * Adds the excluded carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addExcludedCarrier(String carrier) {
+ this.excludedCarriers.add(carrier);
+ }
+
+ /**
+ * Gets the included service brands.
+ *
+ * @return the included service brands
+ */
+ public Collection<Integer> getIncludedServiceBrands() {
+ return includedServiceBrands;
+ }
+
+ /**
+ * Adds the included service brand.
+ *
+ * @param includedServiceBrand the included service brand
+ */
+ public void addIncludedServiceBrand(Integer includedServiceBrand) {
+ this.includedServiceBrands.add(includedServiceBrand);
+ }
+
+ /**
+ * Gets the excluded service brands.
+ *
+ * @return the excluded service brands
+ */
+ public Collection<Integer> getExcludedServiceBrands() {
+ return excludedServiceBrands;
+ }
+
+ /**
+ * Adds the excluded service brand.
+ *
+ * @param excludedServiceBrand the excluded service brand
+ */
+ public void addExcludedServiceBrand(Integer excludedServiceBrand) {
+ this.excludedServiceBrands.add(excludedServiceBrand);
+ }
+
+ public Date getFromDate() {
+ return validFrom;
+ }
+
+ public void setFromDate(Date validFrom) {
+ this.validFrom = validFrom;
+ }
+
+
+
+
+
+ /**
+ * Gets the valid from UT coffset.
+ *
+ * @return the valid from UT coffset
+ */
+ public Long getValidFromUTCoffset() {
+ return validFromUTCoffset;
+ }
+
+ /**
+ * Sets the valid from UT coffset.
+ *
+ * @param validFromUTCoffset the new valid from UT coffset
+ */
+ public void setValidFromUTCoffset(Long validFromUTCoffset) {
+ this.validFromUTCoffset = validFromUTCoffset;
+ }
+
+ /**
+ * Gets the valid until UT coffset.
+ *
+ * @return the valid until UT coffset
+ */
+ public Long getValidUntilUTCoffset() {
+ return validUntilUTCoffset;
+ }
+
+ /**
+ * Sets the valid until UT coffset.
+ *
+ * @param validUntilUTCoffset the new valid until UT coffset
+ */
+ public void setValidUntilUTCoffset(Long validUntilUTCoffset) {
+ this.validUntilUTCoffset = validUntilUTCoffset;
+ }
+
+ /**
+ * Sets the until date.
+ *
+ * @param date the new until date
+ */
+ @Override
+ public void setUntilDate(Date validUntil) {
+ this.validUntil = validUntil;
+ }
+
+
+ public Date getUntilDate() {
+ return validUntil;
+ }
+
+
+
+
+ @Override
+ public IBoardingOrArrivalType getBoardingOrArrival() {
+ return this.boardingOrArrival;
+ }
+
+
+ @Override
+ public void setBoardingOrArrival(IBoardingOrArrivalType boardingOrArrival) {
+ this.boardingOrArrival = boardingOrArrival;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
index 3e3eac0..0d284ba 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
@@ -35,6 +35,7 @@ import org.uic.barcode.ticket.api.spec.ITicketLink;
import org.uic.barcode.ticket.api.spec.ITimeRange;
import org.uic.barcode.ticket.api.spec.IToken;
import org.uic.barcode.ticket.api.spec.ITrainLink;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
import org.uic.barcode.ticket.api.spec.ITraveler;
import org.uic.barcode.ticket.api.spec.ITravelerDetail;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
@@ -236,6 +237,12 @@ public class SimpleUicTicketObjectFactory implements IUicTicketObjectFactory {
return new SimpleVatDetail();
}
+
+ @Override
+ public ITrainValidity createTrainValidity() {
+ return new SimpleTrainValidity();
+ }
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
index da0d815..4419ea2 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
@@ -39,6 +39,13 @@ public class SimpleViaStation implements IViaStation {
/** The series id. */
protected int seriesId;
+ /** The included service brands. */
+ protected Collection<Integer>includedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The excluded service brands. */
+ protected Collection<Integer>excludedServiceBrands = new LinkedHashSet<Integer>();
+
+
/* (nicht-Javadoc)
* @see org.uic.ticket.api.spec.IViaStation#getStationCodeTable()
*/
@@ -151,7 +158,22 @@ public class SimpleViaStation implements IViaStation {
public void setSeriesId(int seriesId) {
this.seriesId = seriesId;
}
+
+ public Collection<Integer> getIncludedServiceBrands() {
+ return includedServiceBrands;
+ }
+
+ public void addIncludedServiceBrand(Integer includedServiceBrand) {
+ this.includedServiceBrands.add(includedServiceBrand);
+ }
+
+ public Collection<Integer> getExcludedServiceBrands() {
+ return excludedServiceBrands;
+ }
+ public void addExcludedServiceBrand(Integer excludedServiceBrand) {
+ this.excludedServiceBrands.add(excludedServiceBrand);
+ }
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/spec/IBoardingOrArrivalType.java b/src/main/java/org/uic/barcode/ticket/api/spec/IBoardingOrArrivalType.java
new file mode 100644
index 0000000..7f9b1f2
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/spec/IBoardingOrArrivalType.java
@@ -0,0 +1,39 @@
+/*
+ * This file was generated by openASN.1 - an open source ASN.1 toolkit for java
+ *
+ * openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
+ *
+ * openASN.1 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * openASN.1 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.uic.barcode.ticket.api.spec;
+
+import org.uic.barcode.asn1.datatypes.HasExtensionMarker;
+
+@HasExtensionMarker
+public enum IBoardingOrArrivalType {
+ boarding("boarding"),
+ arrival("arrival");
+
+ public String text;
+
+ IBoardingOrArrivalType(String text) {
+ this.text = text;
+ }
+
+ public String toString(){
+ return text;
+ }
+}
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/spec/IPass.java b/src/main/java/org/uic/barcode/ticket/api/spec/IPass.java
index 5968b03..440bd9b 100644
--- a/src/main/java/org/uic/barcode/ticket/api/spec/IPass.java
+++ b/src/main/java/org/uic/barcode/ticket/api/spec/IPass.java
@@ -6,6 +6,7 @@ package org.uic.barcode.ticket.api.spec;
import java.util.Collection;
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* The Interface IPass.
*
@@ -339,8 +340,7 @@ public interface IPass extends IDocumentData {
/**
* Sets the price.
*
- *
- * @param price
+ * @param price the new price
*/
public void setPrice(Long price);
@@ -369,7 +369,7 @@ public interface IPass extends IDocumentData {
*
* E.g. an included local transport ticket at the beginning or end of the route.
*
- * @param includedAddOn the included add on
+ * @param vatDetail the vat detail
*/
public void addVatDetail(IVatDetail vatDetail) ;
@@ -391,7 +391,7 @@ public interface IPass extends IDocumentData {
/**
* Sets the validFrom date time.
*
- * @param validFromDateTime the new validFrom date time
+ * @param validFromUTCoffset the new valid from UT coffset
*/
public void setValidFromUTCoffset(Long validFromUTCoffset) ;
@@ -405,8 +405,24 @@ public interface IPass extends IDocumentData {
/**
* Sets the validUntil date time.
*
- * @param validUntilDateTime the new validUntil date time
+ * @param validUntilUTCoffset the new valid until UT coffset
*/
public void setValidUntilUTCoffset(Long validUntilUTCoffset) ;
+
+ /**
+ * Sets the train validity.
+ *
+ * @param trainValidity the new train validity
+ */
+ public void setTrainValidity(ITrainValidity trainValidity);
+
+ /**
+ * Gets the train validity.
+ *
+ * @return the train validity
+ */
+ public ITrainValidity getTrainValidity();
+
+
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/spec/ITrainValidity.java b/src/main/java/org/uic/barcode/ticket/api/spec/ITrainValidity.java
new file mode 100644
index 0000000..3fdf8a1
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/spec/ITrainValidity.java
@@ -0,0 +1,146 @@
+package org.uic.barcode.ticket.api.spec;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * The Interface IValidityRange.
+ *
+ * IValidityRange describes a validity range by from / until date and time
+ */
+public interface ITrainValidity {
+
+
+ /**
+ * Gets the from date and time.
+ *
+ * @return the from date and time
+ */
+ public Date getFromDate();
+
+ /**
+ * Gets the until date and time.
+ *
+ * @return the until date and time
+ */
+ public Date getUntilDate();
+
+
+ /**
+ * Sets the from date and time.
+ *
+ * @param date the new from date and time
+ */
+ public void setFromDate(Date date);
+
+ /**
+ * Sets the until date and time.
+ *
+ * @param date the new until date and time
+ */
+ public void setUntilDate(Date date);
+
+
+ /**
+ * Gets the validFrom date time offset to UTC in units of 15 minutes.
+ *
+ * @return the validFrom date time UTC offset
+ */
+ public Long getValidFromUTCoffset();
+
+ /**
+ * Sets the validFrom date time.
+ *
+ * @param validFromDateTime the new validFrom date time
+ */
+ public void setValidFromUTCoffset(Long validFromUTCoffset) ;
+
+ /**
+ * Gets the validUntil date time offset to UTC in units of 15 minutes.
+ *
+ * @return the validUntil date time UTC offset
+ */
+ public Long getValidUntilUTCoffset();
+
+ /**
+ * Sets the validUntil date time.
+ *
+ * @param validUntilDateTime the new validUntil date time
+ */
+ public void setValidUntilUTCoffset(Long validUntilUTCoffset) ;
+
+
+ /**
+ * Gets the included carriers.
+ *
+ * @return the included carriers
+ */
+ public Collection<String> getIncludedCarriers();
+
+ /**
+ * Adds the included carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addIncludedCarrier(String carrier);
+
+ /**
+ * Gets the excluded carriers.
+ *
+ * @return the excluded carriers
+ */
+ public Collection<String> getExcludedCarriers();
+
+ /**
+ * Adds the excluded carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addExcludedCarrier(String carrier);
+
+ /**
+ * Gets the included service brands.
+ *
+ * @return the included service brands
+ */
+ public Collection<Integer> getIncludedServiceBrands();
+
+ /**
+ * Adds the included service brand.
+ *
+ * @param includedServiceBrand the included service brand
+ */
+ public void addIncludedServiceBrand(Integer includedServiceBrand);
+
+ /**
+ * Gets the excluded service brands.
+ *
+ * @return the excluded service brands
+ */
+ public Collection<Integer> getExcludedServiceBrands();
+
+ /**
+ * Adds the excluded service brand.
+ *
+ * @param excludedServiceBrand the excluded service brand
+ */
+ public void addExcludedServiceBrand(Integer excludedServiceBrand);
+
+
+ /**
+ * Gets the class code.
+ *
+ * @return the class code
+ */
+ public IBoardingOrArrivalType getBoardingOrArrival();
+
+ /**
+ * Sets the travel class code.
+ *
+ * @param classCode the new travel class code
+ */
+ public void setBoardingOrArrival(IBoardingOrArrivalType boardingOrArrival);
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/spec/IUicTicketObjectFactory.java b/src/main/java/org/uic/barcode/ticket/api/spec/IUicTicketObjectFactory.java
index 075ee81..d785a4b 100644
--- a/src/main/java/org/uic/barcode/ticket/api/spec/IUicTicketObjectFactory.java
+++ b/src/main/java/org/uic/barcode/ticket/api/spec/IUicTicketObjectFactory.java
@@ -46,6 +46,8 @@ public interface IUicTicketObjectFactory {
public abstract IDocumentExtension createDocumentExtension();
public abstract IServiceBrand createServiceBrand();
public abstract IVatDetail createVatDetail();
+ public abstract ITrainValidity createTrainValidity();
+
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/spec/IViaStation.java b/src/main/java/org/uic/barcode/ticket/api/spec/IViaStation.java
index 34900a8..3590aa0 100644
--- a/src/main/java/org/uic/barcode/ticket/api/spec/IViaStation.java
+++ b/src/main/java/org/uic/barcode/ticket/api/spec/IViaStation.java
@@ -166,5 +166,35 @@ public interface IViaStation extends IRegionalValidity {
*/
public void setSeriesId(int seriesId);
+
+ /**
+ * Gets the included service brands.
+ *
+ * @return the included service brands
+ */
+ public Collection<Integer> getIncludedServiceBrands();
+
+ /**
+ * Adds the included service brand.
+ *
+ * @param includedServiceBrand the included service brand
+ */
+ public void addIncludedServiceBrand(Integer includedServiceBrand);
+
+ /**
+ * Gets the excluded service brands.
+ *
+ * @return the excluded service brands
+ */
+ public Collection<Integer> getExcludedServiceBrands();
+
+ /**
+ * Adds the excluded service brand.
+ *
+ * @param excludedServiceBrand the excluded service brand
+ */
+ public void addExcludedServiceBrand(Integer excludedServiceBrand);
+
+
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java
new file mode 100644
index 0000000..11052b0
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java
@@ -0,0 +1,13 @@
+package org.uic.barcode.ticket.api.utils;
+
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv1.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+
+public abstract interface Api2AsnEncoder {
+
+
+ public byte[] encode(IUicRailTicket uicTicket) throws EncodingFormatException;
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java
index 3f781ef..cab9b53 100644
--- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java
@@ -151,7 +151,7 @@ import org.uic.barcode.ticket.api.spec.IZone;
/**
* The Class Api2OpenAsnEncoder.
*/
-public class Api2OpenAsnEncoder {
+public class Api2OpenAsnEncoder implements Api2AsnEncoder {
/**
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java
index 61bdba1..184dfd7 100644
--- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java
@@ -152,7 +152,7 @@ import org.uic.barcode.ticket.api.spec.IZone;
/**
* The Class Api2OpenAsnEncoder.
*/
-public class Api2OpenAsnEncoderV2 {
+public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder {
/**
* encode to asn1 model.
@@ -1512,9 +1512,13 @@ public class Api2OpenAsnEncoderV2 {
asnData.setValidity(document.getValidFrom(), document.getValidUntil());
- asnData.setType(UicEncoderUtils.getRestrictedInt(document.getType(), 1,9999));
+ if (document.getType() != null) {
+ asnData.setType(UicEncoderUtils.getRestrictedInt(document.getType(), 1,32000));
+ }
- asnData.setValue(UicEncoderUtils.getRestrictedInt(document.getAmount(),1,9999999));
+ if (document.getAmount() != null) {
+ asnData.setValue(UicEncoderUtils.getRestrictedInt(document.getAmount(),1,9999999));
+ }
return asnDocument;
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java
new file mode 100644
index 0000000..9084d7a
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java
@@ -0,0 +1,2339 @@
+/*
+ *
+ */
+package org.uic.barcode.ticket.api.utils;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringUTF8;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.BerthDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.BerthTypeType;
+import org.uic.barcode.ticket.api.asn.omv3.BoardingOrArrivalType;
+import org.uic.barcode.ticket.api.asn.omv3.CarCarriageReservationData;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.CodeTableType;
+import org.uic.barcode.ticket.api.asn.omv3.CompartmentDetailsType;
+import org.uic.barcode.ticket.api.asn.omv3.CompartmentGenderType;
+import org.uic.barcode.ticket.api.asn.omv3.ConfirmationTypeType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CountermarkData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerCardData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DelayConfirmation;
+import org.uic.barcode.ticket.api.asn.omv3.DeltaCoordinates;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.FIPTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.GenderType;
+import org.uic.barcode.ticket.api.asn.omv3.GeoCoordinateSystemType;
+import org.uic.barcode.ticket.api.asn.omv3.GeoCoordinateType;
+import org.uic.barcode.ticket.api.asn.omv3.GeoUnitType;
+import org.uic.barcode.ticket.api.asn.omv3.HemisphereLatitudeType;
+import org.uic.barcode.ticket.api.asn.omv3.HemisphereLongitudeType;
+import org.uic.barcode.ticket.api.asn.omv3.IncludedOpenTicketType;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LineType;
+import org.uic.barcode.ticket.api.asn.omv3.LinkMode;
+import org.uic.barcode.ticket.api.asn.omv3.LoadingDeckType;
+import org.uic.barcode.ticket.api.asn.omv3.LuggageRestrictionType;
+import org.uic.barcode.ticket.api.asn.omv3.OpenTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.ParkingGroundData;
+import org.uic.barcode.ticket.api.asn.omv3.PassData;
+import org.uic.barcode.ticket.api.asn.omv3.PassengerType;
+import org.uic.barcode.ticket.api.asn.omv3.PlacesType;
+import org.uic.barcode.ticket.api.asn.omv3.PolygoneType;
+import org.uic.barcode.ticket.api.asn.omv3.PriceTypeType;
+import org.uic.barcode.ticket.api.asn.omv3.RegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.RegisteredLuggageType;
+import org.uic.barcode.ticket.api.asn.omv3.ReservationData;
+import org.uic.barcode.ticket.api.asn.omv3.ReturnRouteDescriptionType;
+import org.uic.barcode.ticket.api.asn.omv3.RoofRackType;
+import org.uic.barcode.ticket.api.asn.omv3.RouteSectionType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfBerthDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCarrierNum;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCountries;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDeltaCoordinates;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfIncludedOpenTicketType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfPlaceNum;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfRegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfRegisteredLuggageType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfServiceBrands;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTariffType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTransportTypes;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerId;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfViaStationType;
+import org.uic.barcode.ticket.api.asn.omv3.SeriesDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ServiceType;
+import org.uic.barcode.ticket.api.asn.omv3.StationPassageData;
+import org.uic.barcode.ticket.api.asn.omv3.TariffType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketType;
+import org.uic.barcode.ticket.api.asn.omv3.TimeRangeType;
+import org.uic.barcode.ticket.api.asn.omv3.TokenType;
+import org.uic.barcode.ticket.api.asn.omv3.TrainLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TrainValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.ValidityPeriodDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ValidityPeriodType;
+import org.uic.barcode.ticket.api.asn.omv3.VatDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ViaStationType;
+import org.uic.barcode.ticket.api.asn.omv3.VoucherData;
+import org.uic.barcode.ticket.api.asn.omv3.ZoneType;
+import org.uic.barcode.ticket.api.spec.IBerth;
+import org.uic.barcode.ticket.api.spec.ICarCarriageReservation;
+import org.uic.barcode.ticket.api.spec.ICardReference;
+import org.uic.barcode.ticket.api.spec.ICompartmentDetails;
+import org.uic.barcode.ticket.api.spec.ICompartmentGenderType;
+import org.uic.barcode.ticket.api.spec.IControlDetail;
+import org.uic.barcode.ticket.api.spec.ICounterMark;
+import org.uic.barcode.ticket.api.spec.ICustomerCard;
+import org.uic.barcode.ticket.api.spec.ICustomerStatusDescription;
+import org.uic.barcode.ticket.api.spec.IDelayConfirmation;
+import org.uic.barcode.ticket.api.spec.IDocumentData;
+import org.uic.barcode.ticket.api.spec.IExtension;
+import org.uic.barcode.ticket.api.spec.IFipTicket;
+import org.uic.barcode.ticket.api.spec.IGeoCoordinate;
+import org.uic.barcode.ticket.api.spec.IGeoCoordinateSystemType;
+import org.uic.barcode.ticket.api.spec.IGeoUnitType;
+import org.uic.barcode.ticket.api.spec.IHemisphereLatitudeType;
+import org.uic.barcode.ticket.api.spec.IHemisphereLongitudeType;
+import org.uic.barcode.ticket.api.spec.IIncludedOpenTicket;
+import org.uic.barcode.ticket.api.spec.IIssuingDetail;
+import org.uic.barcode.ticket.api.spec.ILine;
+import org.uic.barcode.ticket.api.spec.ILinkMode;
+import org.uic.barcode.ticket.api.spec.ILoadingDeckType;
+import org.uic.barcode.ticket.api.spec.ILuggageRestriction;
+import org.uic.barcode.ticket.api.spec.IOpenTicket;
+import org.uic.barcode.ticket.api.spec.IParkingGround;
+import org.uic.barcode.ticket.api.spec.IPass;
+import org.uic.barcode.ticket.api.spec.IPlaces;
+import org.uic.barcode.ticket.api.spec.IPolygone;
+import org.uic.barcode.ticket.api.spec.IPriceTypeType;
+import org.uic.barcode.ticket.api.spec.IRegionalValidity;
+import org.uic.barcode.ticket.api.spec.IRegisteredLuggage;
+import org.uic.barcode.ticket.api.spec.IReservation;
+import org.uic.barcode.ticket.api.spec.IReturnRouteDescription;
+import org.uic.barcode.ticket.api.spec.IRoofRackType;
+import org.uic.barcode.ticket.api.spec.IRouteSection;
+import org.uic.barcode.ticket.api.spec.ISeriesDataDetails;
+import org.uic.barcode.ticket.api.spec.IServiceType;
+import org.uic.barcode.ticket.api.spec.IStationCodeTable;
+import org.uic.barcode.ticket.api.spec.IStationPassage;
+import org.uic.barcode.ticket.api.spec.ITariff;
+import org.uic.barcode.ticket.api.spec.ITicketLink;
+import org.uic.barcode.ticket.api.spec.ITicketType;
+import org.uic.barcode.ticket.api.spec.ITimeRange;
+import org.uic.barcode.ticket.api.spec.IToken;
+import org.uic.barcode.ticket.api.spec.ITrainLink;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
+import org.uic.barcode.ticket.api.spec.ITravelClassType;
+import org.uic.barcode.ticket.api.spec.ITraveler;
+import org.uic.barcode.ticket.api.spec.ITravelerDetail;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.spec.IValidityDetails;
+import org.uic.barcode.ticket.api.spec.IValidityRange;
+import org.uic.barcode.ticket.api.spec.IVatDetail;
+import org.uic.barcode.ticket.api.spec.IViaStation;
+import org.uic.barcode.ticket.api.spec.IVoucher;
+import org.uic.barcode.ticket.api.spec.IZone;
+
+/**
+ * The Class Api2OpenAsnEncoder.
+ */
+public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder {
+
+ /**
+ * encode to asn1 model.
+ *
+ * @param uicTicket the uic ticket
+ * @return the encoded byte array
+ * @throws EncodingFormatException the encoding format exception
+ */
+ public byte[] encode(IUicRailTicket uicTicket) throws EncodingFormatException {
+
+ UicRailTicketData asnUicRailTicketData = populateToAsn1Model(uicTicket);
+
+ return asnUicRailTicketData.encode();
+
+ }
+
+
+ /**
+ * Populate asn1 model.
+ *
+ * @param uicTicket the uic ticket
+ * @return the org.uic.ticket.asn.om. uic rail ticket data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ public UicRailTicketData populateToAsn1Model(IUicRailTicket uicTicket) throws EncodingFormatException {
+
+ UicRailTicketData asnTicket = new UicRailTicketData();
+
+ if (uicTicket.getIssuerDetails() != null) {
+ asnTicket.setIssuingDetail(encodeIssuingDetails(uicTicket.getIssuerDetails()));
+ }
+
+
+ if (uicTicket.getControlDetails() != null) {
+ asnTicket.setControlDetail(encodeControlDetails(uicTicket.getControlDetails(), uicTicket.getIssuerDetails().getIssuingDate()));
+ }
+
+
+ if (uicTicket.getExtensions() != null && !uicTicket.getExtensions().isEmpty()){
+
+ SequenceOfExtensionData asnList = new SequenceOfExtensionData();
+ for (IExtension extension : uicTicket.getExtensions()){
+ ExtensionData asnExtension = encodeExtension(extension);
+ if (asnExtension!= null) {
+ asnList.add(asnExtension);
+ }
+ }
+ if (!asnList.isEmpty()){
+ asnTicket.setExtension(asnList);
+ }
+
+
+ }
+
+
+ if (uicTicket.getTravelerDetails() != null) {
+ asnTicket.setTravelerDetail(encodeTravelers(uicTicket.getTravelerDetails(),uicTicket.getIssuerDetails().getIssuingDate() ));
+ }
+
+ if (uicTicket.getDocumentData() != null && !uicTicket.getDocumentData().isEmpty()) {
+
+ SequenceOfDocumentData documents = new SequenceOfDocumentData();
+
+ for (IDocumentData document : uicTicket.getDocumentData()){
+
+ DocumentData asnDocument = null;
+
+ if (document instanceof IReservation) {
+ asnDocument = convertReservation((IReservation) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IOpenTicket) {
+ asnDocument = convertOpenTicket((IOpenTicket) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof ICarCarriageReservation) {
+ asnDocument = convertCarCarriageReservation((ICarCarriageReservation) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IFipTicket) {
+ asnDocument = convertFipTicket((IFipTicket) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IPass) {
+ asnDocument = convertPass((IPass) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IVoucher) {
+ asnDocument = convertVoucher((IVoucher) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof ICounterMark) {
+ asnDocument = convertCounterMark((ICounterMark) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IParkingGround) {
+ asnDocument = convertParkingGround((IParkingGround) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof IStationPassage) {
+ asnDocument = convertStationPassage((IStationPassage) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+ if (document instanceof ICustomerCard) {
+ asnDocument = encodeCustomerCard((ICustomerCard) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+
+ if (document instanceof IDelayConfirmation) {
+ asnDocument = encodeDelayConfirmation((IDelayConfirmation) document , uicTicket.getIssuerDetails().getIssuingDate());
+ }
+
+
+ if (asnDocument!= null && document.getToken()!= null) {
+ asnDocument.setToken(encodeToken(document.getToken()));
+ }
+
+ if (asnDocument != null) {
+ documents.add(asnDocument);
+ }
+ }
+ asnTicket.setTransportDocument(documents);
+ }
+
+
+ return asnTicket;
+ }
+
+ private DocumentData encodeDelayConfirmation(IDelayConfirmation document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ DelayConfirmation asnData = new DelayConfirmation();
+ asnDocument.getTicket().setDelayConfirmation(asnData);
+
+ asnData.setTrainIA5(UicEncoderUtils.getIA5NonNum(document.getTrain()));
+ asnData.setTrainNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getTrain())));
+
+ asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+ asnData.setStationIA5(UicEncoderUtils.getIA5NonNum(document.getStation()));
+ asnData.setStationNum(UicEncoderUtils.getNum(document.getStation()));
+
+
+ asnData.setPlannedArrivalDate(document.getArrivalDate());
+ asnData.setDepartureUTCOffset(document.getArrivalUTCoffset());
+
+ asnData.setAffectedTickets(encodeTicketLickList(document.getLinkedTickets()));
+
+ asnData.setConfirmationType(ConfirmationTypeType.values()[document.getConfirmationType()]);
+
+ asnData.setDelay(new Long(document.getDelay()));
+
+ asnData.setTrainCancelled(document.isTrainCancelled());
+
+
+ asnData.setInfoText(document.getInfoText());
+
+ asnData.setStationNameUTF8(document.getStationName());
+
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ return asnDocument;
+ }
+
+
+ /**
+ * Convert car carriage reservation.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertCarCarriageReservation( ICarCarriageReservation document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ CarCarriageReservationData asnData = new CarCarriageReservationData();
+ asnDocument.getTicket().setCarCarriageReservation(asnData);
+
+ asnData.setTrainIA5(UicEncoderUtils.getIA5NonNum(document.getTrain()));
+ asnData.setTrainNum(UicEncoderUtils.getNum(document.getTrain()));
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUICReservation && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setCarrierNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getCarriers())));
+ asnData.setCarrierIA5(UicEncoderUtils.getIA5NonNumList(document.getCarriers()));
+
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ asnData.setCompartmentDetails(encodeCompartmentDetails(document.getCompartmentDetails()));
+
+
+ if (document.getPriceType()!= IPriceTypeType.travelPrice && document.getPriceType() != null){
+ asnData.setPriceType(PriceTypeType.valueOf(document.getPriceType().name()));
+ }
+
+
+ if (document.getServiceBrand()!= null) {
+ asnData.setServiceBrand(UicEncoderUtils.getRestrictedInt(document.getServiceBrand().getServiceBrand(),1,9999));
+ asnData.setServiceBrandAbrUTF8(document.getServiceBrand().getServiceBrandAbbreviation());
+ asnData.setServiceBrandNameUTF8(document.getServiceBrand().getServiceBrandDescription());
+
+ }
+ if (document.getStationCodeTable() != IStationCodeTable.stationUICReservation && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnData.setFromStationNameUTF8(document.getFromStationName());
+ asnData.setToStationNameUTF8(document.getToStationName());
+
+
+ asnData.setAttachedBicycles(UicEncoderUtils.getRestrictedInt(document.getAttachedBicycles(),1,5));
+ asnData.setAttachedBoats(UicEncoderUtils.getRestrictedInt(document.getAttachedBoats(),1,2));
+ asnData.setAttachedSurfboards(UicEncoderUtils.getRestrictedInt(document.getAttachedSurfboards(),1,5));
+
+ if (document.getLoadingDeck() != ILoadingDeckType.upper && document.getLoadingDeck() != null){
+ asnData.setLoadingDeck(LoadingDeckType.valueOf(document.getLoadingDeck().name()));
+ }
+
+ asnData.setLoadingListEntry(UicEncoderUtils.getRestrictedInt(document.getAttachedSurfboards(),1,200));
+
+ asnData.setBoatCategory(UicEncoderUtils.getRestrictedInt(document.getBoatCategory(),1,6));
+ asnData.setCarCategory(UicEncoderUtils.getRestrictedInt(document.getCarCategory(),1,9));
+ asnData.setCoach(UicEncoderUtils.getIA5(document.getCoach()));
+
+ asnData.setRoofRackHeight(UicEncoderUtils.getRestrictedInt(document.getRoofRackHeight(),1,99));
+
+ if (document.getRoofRackType()!= IRoofRackType.norack && document.getRoofRackType() != null) {
+ asnData.setRoofRackType(RoofRackType.valueOf(document.getRoofRackType().name()));
+ }
+
+ if (document.getTariff() != null) {
+ asnData.setTariff(encodeTariff(document.getTariff()));
+ }
+ asnData.setNumberPlate(UicEncoderUtils.getIA5(document.getNumberPlate()));
+ asnData.setPlace(UicEncoderUtils.getIA5(document.getPlace()));
+
+ if (document.isTextileRoof() ) {
+ asnData.setTextileRoof(true);
+ } else {
+ asnData.setTextileRoof(false);
+ }
+
+ asnData.setTrailerPlate(UicEncoderUtils.getIA5(document.getTrailerPlate()));
+
+ asnData.setLoadingDates(document.getBeginLoading(),document.getEndLoading(), issuingDate);
+
+ asnData.setLoadingUTCOffset(document.getLoadingTimeUTCoffset());
+
+ asnData.setPrice(document.getPrice());
+
+ if (document.getVatDetails() != null && !document.getVatDetails().isEmpty()){
+ for (IVatDetail vat : document.getVatDetails()) {
+ asnData.addVatDetail(encodeVatDetail(vat));
+ }
+ }
+
+
+ return asnDocument;
+ }
+
+
+ /**
+ * Encode places.
+ *
+ * @param places the places
+ * @return the places type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private PlacesType encodePlaces(IPlaces places) throws EncodingFormatException {
+
+ if (places == null) {
+ return null;
+ }
+
+ PlacesType asnData = new PlacesType();
+
+ asnData.setCoach(UicEncoderUtils.getIA5(places.getCoach()));
+ asnData.setPlaceDescription(places.getPlaceDescription());
+ asnData.setPlaceString(UicEncoderUtils.getIA5(places.getPlaceString()));
+ asnData.setPlaceNum(SequenceOfPlaceNum.getSequence(UicEncoderUtils.getNumList(places.getPlaces())));
+ asnData.setPlaceIA5(UicEncoderUtils.getIA5NonNumList(places.getPlaces()));
+
+ return asnData;
+ }
+
+
+ /**
+ * Encode compartment details.
+ *
+ * @param compartmentDetails the compartment details
+ * @return the compartment details type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private CompartmentDetailsType encodeCompartmentDetails(ICompartmentDetails compartmentDetails) throws EncodingFormatException {
+
+ if (compartmentDetails == null) {
+ return null;
+ }
+ CompartmentDetailsType asnData = new CompartmentDetailsType();
+
+ asnData.setCoachType(UicEncoderUtils.getRestrictedInt(compartmentDetails.getCoachType(), 1,99));
+ asnData.setCoachTypeDescr(compartmentDetails.getCoachTypeDescr());
+ asnData.setCompartmentType(UicEncoderUtils.getRestrictedInt(compartmentDetails.getCompartmentType(), 1,99));
+ asnData.setCompartmentTypeDescr(compartmentDetails.getCompartmentTypeDescr());
+ asnData.setSpecialAllocation(UicEncoderUtils.getRestrictedInt(compartmentDetails.getSpecialAllocation(), 1,99));
+ asnData.setSpecialAllocationDescr(compartmentDetails.getSpecialAllocationDescr());
+
+ return asnData;
+ }
+
+ /**
+ * Encode berths.
+ *
+ * @param berths the berths
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfBerthDetailData encodeBerths(Collection<IBerth> berths) throws EncodingFormatException {
+
+ if (berths == null || berths.isEmpty()) {
+ return null;
+ }
+ SequenceOfBerthDetailData asnList = new SequenceOfBerthDetailData();
+
+ for ( IBerth berth : berths){
+ BerthDetailData asnBerth = new BerthDetailData();
+
+ if (berth.getType() != null) {
+ asnBerth.setBerthType(BerthTypeType.valueOf(berth.getType().name()));
+ }
+
+ if (berth.getGender()!= ICompartmentGenderType.family && berth.getGender() != null) {
+ asnBerth.setGender(CompartmentGenderType.valueOf(berth.getGender().name()));
+ }
+
+ asnBerth.setNumberOfBerths(UicEncoderUtils.getRestrictedInt(berth.getNumberOfBerths(), 1 , 999 ));
+
+ asnList.add(asnBerth);
+ }
+
+ if (asnList.isEmpty()) {
+ return null;
+ }
+ return asnList;
+ }
+
+ /**
+ * Convert reservation.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertReservation(IReservation document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ ReservationData asnData = new ReservationData();
+ asnDocument.getTicket().setReservation(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ asnData.setCarrierNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getCarriers())));
+ asnData.setCarrierIA5(UicEncoderUtils.getIA5NonNumList(document.getCarriers()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUICReservation && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnData.setFromStationNameUTF8(document.getFromStationName());
+ asnData.setToStationNameUTF8(document.getToStationName());
+
+ asnData.setTrainIA5(UicEncoderUtils.getIA5NonNum(document.getTrain()));
+ asnData.setTrainNum(UicEncoderUtils.getNum(document.getTrain()));
+
+ asnData.setTariff(encodeTariffCollection(document.getTariffs()));
+
+ asnData.setDepartureArrivalDates(document.getDepartureDate(),document.getArrivalDate(), issuingDate);
+
+ if (document.getDepartureUTCoffset() != null) {
+ asnData.setDepartureUTCOffset(document.getDepartureUTCoffset());
+ if (document.getArrivalUTCoffset() != null && document.getArrivalUTCoffset() != document.getDepartureUTCoffset()){
+ asnData.setArrivalUTCOffset(document.getArrivalUTCoffset());
+ }
+ }
+
+
+
+ if (document.getClassCode() != ITravelClassType.second && document.getClassCode() != null){
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+
+ asnData.setBerth(encodeBerths(document.getBerths()));
+
+ asnData.setCompartmentDetails(encodeCompartmentDetails(document.getCompartmentDetails()));
+
+ asnData.setLuggage(encodeLuggage(document.getLuggageRestriction()));
+
+ asnData.setNumberOfOverbooked(UicEncoderUtils.getRestrictedInt(document.getNumberOfOverbooked(), 1, 200));
+ asnData.setNumberOfSupplements(UicEncoderUtils.getRestrictedInt(document.getNumberOfSupplements(), 1, 200));
+
+ if (document.getPriceType()!= IPriceTypeType.travelPrice && document.getPriceType() != null){
+ asnData.setPriceType(PriceTypeType.valueOf(document.getPriceType().name()));
+ }
+ asnData.setTypeOfSupplement(UicEncoderUtils.getRestrictedInt(document.getTypeOfSupplement(), 1, 9));
+
+ asnData.setPlaces(encodePlaces(document.getPlaces()));
+ asnData.setBicyclePlaces(encodePlaces(document.getBicyclePlaces()));
+
+
+ if (document.getService() != IServiceType.seat && document.getService() != null) {
+ asnData.setService(ServiceType.valueOf(document.getService().name()));
+ }
+
+ if (document.getServiceBrand()!= null) {
+ asnData.setServiceBrand(UicEncoderUtils.getRestrictedInt(document.getServiceBrand().getServiceBrand(),1,9999));
+ asnData.setServiceBrandAbrUTF8(document.getServiceBrand().getServiceBrandAbbreviation());
+ asnData.setServiceBrandNameUTF8(document.getServiceBrand().getServiceBrandDescription());
+
+ }
+
+ if (document.getServiceLevel() != null && document.getServiceLevel().length() > 2) {
+ throw new EncodingFormatException("Service level too long");
+ }
+ asnData.setServiceLevel(UicEncoderUtils.getIA5(document.getServiceLevel()));
+
+ asnData.setPrice(document.getPrice());
+
+ if (document.getVatDetails() != null && !document.getVatDetails().isEmpty()){
+ for (IVatDetail vat : document.getVatDetails()) {
+ asnData.addVatDetail(encodeVatDetail(vat));
+ }
+ }
+
+ return asnDocument;
+ }
+
+ /**
+ * Encode included addons.
+ *
+ * @param tickets the tickets
+ * @param issuingDate the issuing date
+ * @param classCode the class code
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfIncludedOpenTicketType encodeIncludedAddons(Collection<IIncludedOpenTicket> tickets, Date issuingDate, ITravelClassType classCode) throws EncodingFormatException {
+
+ if (tickets == null || tickets.isEmpty()) {
+ return null;
+ }
+ SequenceOfIncludedOpenTicketType asnList = new SequenceOfIncludedOpenTicketType();
+
+ for ( IIncludedOpenTicket ticket : tickets){
+
+ IncludedOpenTicketType asnTicket = encodeIncludedOpenTicket(ticket,issuingDate,classCode);
+ if (asnTicket!=null) {
+ asnList.add(asnTicket);
+ }
+ }
+
+ if (asnList.isEmpty()) {
+ return null;
+ }
+ return asnList;
+ }
+
+
+ /**
+ * Encode included open ticket.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @param classCode the class code
+ * @return the included open ticket type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private IncludedOpenTicketType encodeIncludedOpenTicket(IIncludedOpenTicket document, Date issuingDate, ITravelClassType classCode) throws EncodingFormatException {
+
+ if (document == null) return null;
+
+ IncludedOpenTicketType asnData = new IncludedOpenTicketType();
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setIncludedCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getIncludedCarriers())));
+ asnData.setIncludedCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getIncludedCarriers()));
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,9999)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,9999)));
+
+ asnData.setExcludedTransportTypes(SequenceOfTransportTypes.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedTransportTypes(),0,31)));
+ asnData.setIncludedTransportTypes(SequenceOfTransportTypes.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedTransportTypes(),0,31)));
+
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+
+ if (document.getTariffs() != null && document.getTariffs().size() > 0){
+ asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
+ }
+
+ if (document.getClassCode() != classCode && document.getClassCode() != null){
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+ if (document.getExternalIssuer() > 0) {
+ asnData.setExternalIssuerId(new Long(document.getExternalIssuer()));
+ }
+
+ if (document.getAuthorizationCode() > 0) {
+ asnData.setIssuerAutorizationId(new Long(document.getAuthorizationCode()));
+ }
+
+ if (document.getValidRegionList()!= null && document.getValidRegionList().size() > 0) {
+ asnData.setValidRegion(encodeRegionCollection(document.getValidRegionList(), issuingDate));
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Encode return description.
+ *
+ * @param route the route
+ * @param issuingDate the issuing date
+ * @return the return route description type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private ReturnRouteDescriptionType encodeReturnDescription(IReturnRouteDescription route, Date issuingDate) throws EncodingFormatException {
+
+ if (route == null) return null;
+
+ ReturnRouteDescriptionType asnData = new ReturnRouteDescriptionType();
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(route.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(route.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(route.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(route.getToStation()));
+
+ asnData.setFromStationNameUTF8(route.getFromStationName());
+ asnData.setToStationNameUTF8(route.getToStationName());
+
+ if (route.getValidRegionList()!= null && route.getValidRegionList().size() > 0) {
+ asnData.setValidReturnRegion(encodeRegionCollection(route.getValidRegionList(), issuingDate));
+ }
+
+ if (route.getValidRegionDesc() != null && route.getValidRegionDesc().length() > 0){
+ asnData.setValidReturnRegionDesc(route.getValidRegionDesc());
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Encode luggage.
+ *
+ * @param luggageRestriction the luggage restriction
+ * @return the luggage restriction type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private LuggageRestrictionType encodeLuggage(ILuggageRestriction luggageRestriction) throws EncodingFormatException {
+
+ if (luggageRestriction== null) return null;
+
+ LuggageRestrictionType asnData = new LuggageRestrictionType();
+
+ asnData.setMaxHandLuggagePieces(UicEncoderUtils.getRestrictedIntWithDefault(luggageRestriction.getMaxHandLuggagePieces(),1,99,3));
+
+ asnData.setMaxNonHandLuggagePieces(UicEncoderUtils.getRestrictedIntWithDefault(luggageRestriction.getMaxNonHandLuggagePieces(),1,99,1));
+
+ if (luggageRestriction.getRegisteredLuggage() != null && luggageRestriction.getRegisteredLuggage().size() > 0) {
+ asnData.setRegisteredLuggage(encodeRegisteredLuggage(luggageRestriction.getRegisteredLuggage()));
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Encode registered luggage.
+ *
+ * @param registeredLuggage the registered luggage
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfRegisteredLuggageType encodeRegisteredLuggage(Collection<IRegisteredLuggage> registeredLuggage) throws EncodingFormatException {
+ if (registeredLuggage== null || registeredLuggage.isEmpty()) {
+ return null;
+ }
+ SequenceOfRegisteredLuggageType asnList = new SequenceOfRegisteredLuggageType();
+
+ for ( IRegisteredLuggage luggage : registeredLuggage){
+ RegisteredLuggageType asnLuggage = new RegisteredLuggageType();
+ asnLuggage.setMaxSize(UicEncoderUtils.getRestrictedInt(luggage.getMaxSize(),1,300));
+ asnLuggage.setMaxWeight(UicEncoderUtils.getRestrictedInt(luggage.getMaxWeight(),1,99));
+ asnLuggage.setRegistrationId(luggage.getRegistrationId());
+
+ asnList.add(asnLuggage);
+ }
+
+ if (asnList.isEmpty()){
+ return null;
+ }
+ return asnList;
+ }
+
+ /**
+ * Convert open ticket.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertOpenTicket(IOpenTicket document,Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ OpenTicketData asnData = new OpenTicketData();
+ asnTicket.setOpenTicket(asnData);
+
+ asnDocument.setTicket(asnTicket);
+ asnTicket.setOpenTicket(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+ asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnData.setFromStationNameUTF8(document.getFromStationName());
+ asnData.setToStationNameUTF8(document.getToStationName());
+
+ asnData.setCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getIncludedCarriers())));
+ asnData.setCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getIncludedCarriers()));
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,32000)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,32000)));
+
+ asnData.setExcludedTransportTypes(SequenceOfTransportTypes.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedTransportTypes(),0,31)));
+ asnData.setIncludedTransportTypes(SequenceOfTransportTypes.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedTransportTypes(),0,31)));
+
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+
+ asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
+
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
+ }
+ if (document.getClassCode() != ITravelClassType.second && document.getClassCode() != null){
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+ if (document.getExternalIssuer()>0) {
+ asnData.setExtIssuerId(new Long(document.getExternalIssuer()));
+ }
+
+ if (document.getAuthorizationCode()>0) {
+ asnData.setIssuerAutorizationId(new Long (document.getAuthorizationCode()));
+ }
+
+ if (document.getValidRegionList() != null && document.getValidRegionList().size() > 0) {
+ asnData.setValidRegion(encodeRegionCollection(document.getValidRegionList(), issuingDate));
+ }
+ asnData.setValidRegionDesc(document.getValidRegionDesc());
+
+ if (document.getIncludedAddOns() != null && document.getIncludedAddOns().size() > 0) {
+ asnData.setIncludedAddOns(encodeIncludedAddons(document.getIncludedAddOns(),issuingDate, document.getClassCode()));
+ }
+
+ if (document.getLuggageRestriction() != null) {
+ asnData.setLuggage(encodeLuggage(document.getLuggageRestriction()));
+ }
+
+ if (document.isReturnIncluded()) {
+ asnData.setReturnIncluded(true);
+ asnData.setReturnDescription(encodeReturnDescription(document.getReturnDescription(),issuingDate));
+ } else {
+ asnData.setReturnIncluded(false);
+ }
+
+ asnData.setPrice(document.getPrice());
+
+ if (document.getVatDetails() != null && !document.getVatDetails().isEmpty()){
+ for (IVatDetail vat : document.getVatDetails()) {
+ asnData.addVatDetail(encodeVatDetail(vat));
+ }
+ }
+
+
+ return asnDocument;
+ }
+
+ /**
+ * Convert counter mark.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertCounterMark(ICounterMark document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ CountermarkData asnData = new CountermarkData();
+ asnDocument.getTicket().setCounterMark(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+
+ asnData.setTicketReferenceNum(UicEncoderUtils.getNum(document.getTicketReference()));
+ asnData.setTicketReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getTicketReference()));
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnData.setFromStationNameUTF8(document.getFromStationName());
+ asnData.setToStationNameUTF8(document.getToStationName());
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+
+
+ asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnData.setFromStationNameUTF8(document.getFromStationName());
+ asnData.setToStationNameUTF8(document.getToStationName());
+
+ asnData.setCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getIncludedCarriers())));
+ asnData.setCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getIncludedCarriers()));
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,32000)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,32000)));
+
+ if (document.getValidRegionList() != null && document.getValidRegionList().size() > 0) {
+ asnData.setValidRegion(encodeRegionCollection(document.getValidRegionList(), issuingDate));
+ }
+ asnData.setValidRegionDesc(document.getValidRegionDesc());
+
+ if (document.getClassCode() != ITravelClassType.second && document.getClassCode() != null){
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+
+
+ if (document.isReturnIncluded()) {
+ asnData.setReturnIncluded(true);
+ if (document.getReturnDescription()!= null) {
+ asnData.setReturnDescription(encodeReturnDescription(document.getReturnDescription(),issuingDate));
+ }
+ } else {
+ asnData.setReturnIncluded(false);
+ }
+
+ return asnDocument;
+ }
+
+
+
+ /**
+ * Encode via station collection.
+ *
+ * @param stations the stations
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfViaStationType encodeViaStationCollection(Collection<IViaStation> stations) throws EncodingFormatException {
+ if (stations== null || stations.isEmpty()) {
+ return null;
+ }
+ SequenceOfViaStationType asnList = new SequenceOfViaStationType();
+
+ for ( IViaStation station : stations) {
+ ViaStationType asnData = encodeViaStation(station);
+ if (asnData != null) {
+ asnList.add(asnData);
+ }
+ }
+
+ if (asnList.isEmpty()) {
+ return null;
+ }
+
+ return asnList;
+ }
+
+
+ /**
+ * Encode via station.
+ *
+ * @param document the data
+ * @return the via station type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private ViaStationType encodeViaStation(IViaStation document) throws EncodingFormatException {
+ if (document == null) return null;
+
+ ViaStationType asnData =new ViaStationType();
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setStationIA5(UicEncoderUtils.getIA5NonNum(document.getStation()));
+ asnData.setStationNum(UicEncoderUtils.getNum(document.getStation()));
+
+ asnData.setAlternativeRoutes(encodeViaStationCollection(document.getAlternativeRoutes()));
+
+ if (document.isBorder()) {
+ asnData.setBorder(true);
+ } else {
+ asnData.setBorder(false);
+ }
+
+ asnData.setCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getCarriers())));
+ asnData.setCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getCarriers()));
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,32000)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,32000)));
+
+ asnData.setRoute(encodeViaStationCollection(document.getRoute()));
+
+ if (document.getRouteId() > 0){
+ asnData.setSeriesId(new Long(document.getRouteId()));
+ }
+ return asnData;
+ }
+
+ /**
+ * Encode zone.
+ *
+ * @param document the data
+ * @return the zone type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private ZoneType encodeZone(IZone document) throws EncodingFormatException {
+ if (document == null) return null;
+
+ ZoneType asnData =new ZoneType();
+
+ if (document.getBinaryZoneId() != null && document.getBinaryZoneId().length > 0) {
+ asnData.setBinaryZoneId(document.getBinaryZoneId());
+ }
+ asnData.setCarrierNum(UicEncoderUtils.getNum(document.getCarrier()));
+ asnData.setCarrierIA5(UicEncoderUtils.getIA5NonNum(document.getCarrier()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+ asnData.setEntryStationIA5(UicEncoderUtils.getIA5NonNum(document.getEntryStation()));
+ asnData.setEntryStationNum(UicEncoderUtils.getNum(document.getEntryStation()));
+
+ asnData.setTerminatingStationIA5(UicEncoderUtils.getIA5NonNum(document.getTerminatingStation()));
+ asnData.setTerminatingStationNum(UicEncoderUtils.getNum(document.getTerminatingStation()));
+
+ asnData.setZoneId(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.encodeIntegerCollection(document.getZoneIds())));
+
+ if (document.getCity() > 0) {
+ asnData.setCity(Asn1BigInteger.toAsn1(document.getCity()));
+ }
+
+ if (document.getNUTScode() != null && document.getNUTScode().length() > 0) {
+ asnData.setNutsCode(document.getNUTScode());
+ }
+
+ return asnData;
+ }
+
+
+
+
+
+ /**
+ * Encode train link.
+ *
+ * @param data the data
+ * @param issuingDate the issuing date
+ * @return the train link type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private TrainLinkType encodeTrainLink(ITrainLink data, Date issuingDate) throws EncodingFormatException {
+ if (data == null) return null;
+
+ TrainLinkType asnData =new TrainLinkType();
+
+ asnData.setFromStationIA5(UicEncoderUtils.getIA5NonNum(data.getFromStation()));
+ asnData.setFromStationNum(UicEncoderUtils.getNum(data.getFromStation()));
+
+ asnData.setToStationIA5(UicEncoderUtils.getIA5NonNum(data.getToStation()));
+ asnData.setToStationNum(UicEncoderUtils.getNum(data.getToStation()));
+
+ asnData.setFromStationName(data.getFromStationName());
+ asnData.setToStationName(data.getToStationName());
+
+ asnData.setTrainIA5(UicEncoderUtils.getIA5NonNum(data.getTrain()));
+ asnData.setTrainNum(UicEncoderUtils.getNum(data.getTrain()));
+
+ asnData.setDepartureDate(data.getDepartureDateTime(), issuingDate);
+
+ return asnData;
+ }
+
+ /**
+ * Encode polygone.
+ *
+ * @param data the data
+ * @return the polygone type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private PolygoneType encodePolygone(IPolygone data) throws EncodingFormatException {
+ if (data == null) return null;
+ if (data.getEdges() == null || data.getEdges().isEmpty()) {
+ return null;
+ }
+
+ PolygoneType asnData = new PolygoneType();
+ SequenceOfDeltaCoordinates asnList = new SequenceOfDeltaCoordinates();
+
+ boolean firstEdge = true;
+
+ for ( IGeoCoordinate edge : data.getEdges()) {
+
+ if (firstEdge) {
+ asnData.setFirstEdge(encodeGeoCoordinate(edge));
+ firstEdge = false;
+ } else {
+ DeltaCoordinates delta = new DeltaCoordinates();
+ delta.setLatitude(Asn1BigInteger.toAsn1(asnData.getFirstEdge().getLatitude() - edge.getLatitude()));
+ delta.setLatitude(Asn1BigInteger.toAsn1(asnData.getFirstEdge().getLongitude() - edge.getLongitude()));
+ }
+
+ }
+ if (!asnList.isEmpty()) {
+ asnData.setEdges(asnList);
+ }
+ return asnData;
+ }
+
+ /**
+ * Encode line.
+ *
+ * @param document the data
+ * @return the line type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private LineType encodeLine(ILine document) throws EncodingFormatException {
+ if (document == null) return null;
+ LineType asnData =new LineType();
+
+ asnData.setBinaryZoneId(document.getBinaryZoneId());
+ asnData.setCarrierNum(UicEncoderUtils.getNum(document.getCarrier()));
+ asnData.setCarrierIA5(UicEncoderUtils.getIA5NonNum(document.getCarrier()));
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+ asnData.setEntryStationIA5(UicEncoderUtils.getIA5NonNum(document.getEntryStation()));
+ asnData.setEntryStationNum(UicEncoderUtils.getNum(document.getEntryStation()));
+
+ asnData.setTerminatingStationIA5(UicEncoderUtils.getIA5NonNum(document.getTerminatingStation()));
+ asnData.setTerminatingStationNum(UicEncoderUtils.getNum(document.getTerminatingStation()));
+
+ if (document.getCity() > 0) {
+ asnData.setCity(new Long(document.getCity()));
+ }
+
+ asnData.setLineId(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.encodeIntegerCollection(document.getLineIds())));
+
+ return asnData;
+ }
+
+
+
+ /**
+ * Encode region collection.
+ *
+ * @param regionList the region list
+ * @param issuingDate the issuing date
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfRegionalValidityType encodeRegionCollection(Collection<IRegionalValidity> regionList, Date issuingDate) throws EncodingFormatException {
+
+ if (regionList == null || regionList.isEmpty()) {
+ return null;
+ }
+
+ SequenceOfRegionalValidityType asnList = new SequenceOfRegionalValidityType();
+
+ for ( IRegionalValidity region :regionList) {
+
+ RegionalValidityType asnRegion = new RegionalValidityType();
+
+ if (region instanceof ILine ) {
+ LineType line = encodeLine((ILine)region);
+ if (line == null){
+ break;
+ }
+ asnRegion.setLines(line);
+ asnList.add(asnRegion);
+ } else if (region instanceof IPolygone ) {
+ PolygoneType line = encodePolygone((IPolygone)region);
+ if (line == null){
+ break;
+ }
+ asnRegion.setPolygone(line);
+ asnList.add(asnRegion);
+ } else if (region instanceof ITrainLink ) {
+ TrainLinkType trainLink = encodeTrainLink((ITrainLink)region, issuingDate);
+ if (trainLink == null){
+ break;
+ }
+ asnRegion.setTrainLink(trainLink);
+ asnList.add(asnRegion);
+ } else if (region instanceof IViaStation ) {
+ ViaStationType viaStation = encodeViaStation((IViaStation)region);
+ if (viaStation == null){
+ break;
+ }
+ asnRegion.setViaStations(viaStation);
+ asnList.add(asnRegion);
+ } else if (region instanceof IZone ) {
+ ZoneType zone = encodeZone((IZone)region);
+ if (zone == null){
+ break;
+ }
+ asnRegion.setZones(zone);
+ asnList.add(asnRegion);
+ }
+
+ }
+
+ if (asnList.isEmpty()) {
+ return null;
+ }
+
+ return asnList;
+ }
+
+ /**
+ * Convert parking ground.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertParkingGround(IParkingGround document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ ParkingGroundData asnData = new ParkingGroundData();
+ asnDocument.getTicket().setParkingGround(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setReferenceNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getReference())));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnData.setStationIA5(UicEncoderUtils.getIA5NonNum(document.getStation()));
+ asnData.setStationNum(UicEncoderUtils.getNum(document.getStation()));
+
+ asnData.setAccessCode(UicEncoderUtils.getIA5(document.getAccessCode()));
+ asnData.setEntryTrack(document.getEntryTrack());
+
+ if (document.getFromParkingDate() != null){
+ asnData.setParkingDates(document.getFromParkingDate(),document.getToParkingDate(),issuingDate);
+ }
+
+ asnData.setLocation(document.getLocation());
+ asnData.setNumberPlate(UicEncoderUtils.getIA5(document.getNumberPlate()));
+ asnData.setParkingGroundId(UicEncoderUtils.getIA5(document.getParkingGroundId()));
+ asnData.setSpecialInformation(document.getSpecialInformation());
+
+ asnData.setPrice(document.getPrice());
+
+ if (document.getVatDetails() != null && !document.getVatDetails().isEmpty()){
+ for (IVatDetail vat : document.getVatDetails()) {
+ asnData.addVatDetail(encodeVatDetail(vat));
+ }
+ }
+
+ return asnDocument;
+ }
+
+
+ /**
+ * Encode route section.
+ *
+ * @param document the route
+ * @return the route section type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private RouteSectionType encodeRouteSection(IRouteSection document) throws EncodingFormatException {
+
+ if (document == null) return null;
+
+ RouteSectionType asnRoute = new RouteSectionType();
+
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnRoute.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+ asnRoute.setFromStationIA5(UicEncoderUtils.getIA5NonNum(document.getFromStation()));
+ asnRoute.setFromStationNum(UicEncoderUtils.getNum(document.getFromStation()));
+
+ asnRoute.setToStationIA5(UicEncoderUtils.getIA5NonNum(document.getToStation()));
+ asnRoute.setToStationNum(UicEncoderUtils.getNum(document.getToStation()));
+
+ asnRoute.setFromStationNameUTF8(document.getFromStationName());
+ asnRoute.setToStationNameUTF8(document.getToStationName());
+
+
+ return asnRoute;
+ }
+
+ /**
+ * Encode tariff collection.
+ *
+ * @param tariffs the tariffs
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfTariffType encodeTariffCollection(Collection<ITariff> tariffs) throws EncodingFormatException {
+
+ if (tariffs== null || tariffs.isEmpty()) {
+ return null;
+ }
+
+ SequenceOfTariffType tariffList = new SequenceOfTariffType();
+
+ for (ITariff tariff :tariffs){
+
+ TariffType asnTariff = encodeTariff(tariff);
+
+ if (asnTariff != null) {
+ tariffList.add(asnTariff);
+ }
+ }
+
+ if (tariffList.isEmpty()) {
+ return null;
+ }
+
+ return tariffList;
+ }
+
+ /**
+ * Encode tariff.
+ *
+ * @param tariff the tariff
+ * @return the tariff type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private TariffType encodeTariff(ITariff tariff) throws EncodingFormatException {
+
+ if (tariff == null ) {
+ return null;
+ }
+
+ TariffType asnTariff = new TariffType();
+
+ asnTariff.setAgeAbove(UicEncoderUtils.getRestrictedInt(tariff.getAgeAbove(),2,120));
+ asnTariff.setAgeBelow(UicEncoderUtils.getRestrictedInt(tariff.getAgeBelow(),1,40));
+
+ asnTariff.setNumberOfPassengers(UicEncoderUtils.getRestrictedIntWithDefault(tariff.getNumberOfPassengers(),1,200,1));
+
+
+ try {
+ if (tariff.getPassengerType() != null) {
+ asnTariff.setPassengerType(PassengerType.valueOf(tariff.getPassengerType().name()));
+ }
+ } catch (Exception e){
+ //no value found
+ }
+
+
+ asnTariff.setReductionCard(encodeCardReferences(tariff.getReductionCards()));
+ asnTariff.setRestrictedToCountryOfResidence(tariff.isRestrictedToCountryOfResidence());
+ asnTariff.setRestrictedToRouteSection(encodeRouteSection(tariff.getRestrictedToRouteSection()));
+
+ if (tariff.getSeriesDataDetails()!= null) {
+ asnTariff.setSeriesDataDetails(encodeSeriesDataDetails(tariff.getSeriesDataDetails()));
+ }
+
+
+ asnTariff.setTariffDesc(tariff.getTariffDescription());
+ asnTariff.setTariffIdIA5(UicEncoderUtils.getIA5NonNum(tariff.getTariffId()));
+ asnTariff.setTariffIdNum(UicEncoderUtils.getNum(tariff.getTariffId()));
+
+ asnTariff.setTraverlerid(SequenceOfTravelerId.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(tariff.getTravelerIds(), 1, 254)));
+
+ return asnTariff;
+ }
+
+ private SeriesDetailType encodeSeriesDataDetails( ISeriesDataDetails seriesDataDetails) throws EncodingFormatException {
+ SeriesDetailType details = new SeriesDetailType();
+ details.setSeries(UicEncoderUtils.getRestrictedInt(seriesDataDetails.getSeries(), 1, 99999));
+ details.setSupplyingCarrier(UicEncoderUtils.getRestrictedInt(seriesDataDetails.getSupplyingCarrier(), 1, 9999));
+ details.setOfferIdentification(UicEncoderUtils.getRestrictedInt(seriesDataDetails.getOfferIdentification(), 1, 99));
+ return null;
+ }
+
+ /**
+ * Convert voucher.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertVoucher(IVoucher document, Date issuingDate) throws EncodingFormatException {
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ VoucherData asnData = new VoucherData();
+ asnDocument.getTicket().setVoucher(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+ asnData.setReferenceNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getReference())));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setInfoText(document.getInfoText());
+
+ asnData.setValidity(document.getValidFrom(), document.getValidUntil());
+
+ if (document.getType() != null) {
+ asnData.setType(UicEncoderUtils.getRestrictedInt(document.getType(), 1,32000));
+ }
+
+ if (document.getAmount() != null) {
+ asnData.setValue(UicEncoderUtils.getRestrictedInt(document.getAmount(),1,9999999));
+ }
+
+ return asnDocument;
+ }
+
+ /**
+ * Convert pass.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertPass(IPass document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ PassData asnData = new PassData();
+ asnDocument.getTicket().setPass(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+ asnData.setReferenceNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getReference())));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setInfoText(document.getInfoText());
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ asnData.setIncludedCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getIncludedCarriers())));
+ asnData.setIncludedCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getIncludedCarriers()));
+
+ asnData.setExcludedCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getExcludedCarriers())));
+ asnData.setExcludedCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getExcludedCarriers()));
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
+ }
+ if (document.getClassCode() != null) {
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+ if (document.getCountries() != null && document.getCountries().size() > 0){
+ asnData.setCountries(SequenceOfCountries.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getCountries(),1,250)));
+ }
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,32000)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,32000)));
+
+ asnData.setNumberOfDaysOfTravel(UicEncoderUtils.getRestrictedInt(document.getNumberOfDaysOfTravel(), 1, 93));
+ asnData.setNumberOfPossibleTrips(UicEncoderUtils.getRestrictedInt(document.getNumberOfPossibleTrips(), 1, 30));
+ asnData.setNumberOfValidityDays(UicEncoderUtils.getRestrictedInt(document.getNumberOfValidityDays(), 1, 370));
+ asnData.setPassDescription(document.getPassDescription());
+ if (document.getPassType() > 0 ){
+ asnData.setPassType(new Long(document.getPassType()));
+ }
+
+ asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
+
+
+
+ if(document.getValidRegionList()!= null && document.getValidRegionList().size() > 0) {
+ asnData.setValidRegion(encodeRegionCollection(document.getValidRegionList(), issuingDate));
+ }
+
+ if (document.getValidityDetails() != null) {
+ asnData.setValidityPeriodDetails(encodeValidityDetails(document.getValidityDetails(), issuingDate));
+ }
+
+
+
+ asnData.setPrice(document.getPrice());
+
+ if (document.getVatDetails() != null && !document.getVatDetails().isEmpty()){
+ for (IVatDetail vat : document.getVatDetails()) {
+ asnData.addVatDetail(encodeVatDetail(vat));
+ }
+ }
+
+ if (document.getTrainValidity() != null) {
+ asnData.setTrainValidity(convert(document.getTrainValidity(), issuingDate));
+ }
+
+ return asnDocument;
+ }
+
+
+ private TrainValidityType convert(ITrainValidity document, Date issuingDate) throws EncodingFormatException {
+
+ TrainValidityType asnData = new TrainValidityType();
+
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+ asnData.setIncludedCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getIncludedCarriers())));
+ asnData.setIncludedCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getIncludedCarriers()));
+
+ asnData.setExcludedCarriersNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getExcludedCarriers())));
+ asnData.setExcludedCarriersIA5(UicEncoderUtils.getIA5NonNumList(document.getExcludedCarriers()));
+
+ asnData.setExcludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getExcludedServiceBrands(),1,32000)));
+ asnData.setIncludedServiceBrands(SequenceOfServiceBrands.getSequence(UicEncoderUtils.encodeRestrictedIntegerCollection(document.getIncludedServiceBrands(),1,32000)));
+
+ asnData.setValidityDates(document.getFromDate(), document.getUntilDate(), issuingDate);
+
+ if (document.getBoardingOrArrival() != null) {
+ asnData.setBordingOrArrival(BoardingOrArrivalType.valueOf(document.getBoardingOrArrival().name()));
+ }
+
+ return asnData;
+ }
+
+
+ private ValidityPeriodDetailType encodeValidityDetails( IValidityDetails validityDetails, Date referenceDate) throws EncodingFormatException {
+
+ if ( (validityDetails.getTimeRanges() == null || validityDetails.getTimeRanges().isEmpty())
+ ||
+ (validityDetails.getValidityRanges() == null || validityDetails.getValidityRanges().isEmpty()) ) {
+ return null;
+ }
+
+
+ ValidityPeriodDetailType asnData = new ValidityPeriodDetailType();
+
+ if (validityDetails.getTimeRanges() != null) {
+ for (ITimeRange range : validityDetails.getTimeRanges()) {
+
+ if (range.getFromTime() == range.getUntilTime()){
+ break;
+ }
+
+ TimeRangeType asnRange = new TimeRangeType();
+ asnRange.setFromTime(new Long(range.getFromTime()));
+ asnRange.setUntilTime(new Long(range.getUntilTime()));
+
+ asnData.getExcludedTimeRange().add(asnRange);
+ }
+ }
+
+ if (validityDetails.getValidityRanges() != null) {
+ for (IValidityRange range : validityDetails.getValidityRanges()) {
+
+ ValidityPeriodType asnRange = new ValidityPeriodType();
+
+ asnRange.setValidityDates(range.getFromDate(), range.getUntilDate(), referenceDate);
+
+ if (range.getValidFromUTCoffset() != null) {
+ asnRange.setValidFromUTCOffset(range.getValidFromUTCoffset());
+ if (range.getValidUntilUTCoffset() != null && range.getValidUntilUTCoffset() != range.getValidFromUTCoffset()){
+ asnRange.setValidUntilUTCOffset(range.getValidUntilUTCoffset());
+ }
+ }
+
+
+ asnData.getValidityPeriod().add(asnRange);
+ }
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Convert fip ticket.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertFipTicket(IFipTicket document, Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+
+ FIPTicketData asnData = new FIPTicketData();
+ asnDocument.getTicket().setFipTicket(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+ asnData.setReferenceNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getReference())));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ asnData.setCarrierNum(SequenceOfCarrierNum.getSequence(UicEncoderUtils.getNumList(document.getCarriers())));
+ asnData.setCarrierIA5(UicEncoderUtils.getIA5NonNumList(document.getCarriers()));
+
+ if (document.getClassCode() != null) {
+ asnData.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+ if (!document.isIncludesSupplements()){
+ asnData.setIncludesSupplements(false);
+ }
+ asnData.setNumberOfTravelDays(UicEncoderUtils.getRestrictedInt(document.getNumberOfTravelDates(), 1, 8));
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getActivatedDays() != null && !document.getActivatedDays().isEmpty()) {
+ asnData.addActivatedDays(DateTimeUtils.getActivatedDays(document.getValidFrom(), document.getActivatedDays()));
+ }
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ return asnDocument;
+ }
+
+ /**
+ * Convert station passage.
+ *
+ * @param document the document
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData convertStationPassage(IStationPassage document,Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ StationPassageData asnData = new StationPassageData();
+ asnDocument.getTicket().setStationPassage(asnData);
+
+ asnData.setProductOwnerNum(UicEncoderUtils.getNum(document.getProductOwner()));
+ asnData.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(document.getProductOwner()));
+
+ asnData.setProductIdNum(UicEncoderUtils.getNum(document.getProductId()));
+ asnData.setProductIdIA5(UicEncoderUtils.getIA5NonNum(document.getProductId()));
+
+ asnData.setReferenceNum(Asn1BigInteger.toAsn1(UicEncoderUtils.getNum(document.getReference())));
+ asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
+
+ if (document.getNumberOfdaysAllowed() > 0) {
+ asnData.setNumberOfDaysValid(new Long(document.getNumberOfdaysAllowed()));
+ }
+
+ asnData.setProductName(document.getProductName());
+
+ if (document.getStationCodeTable() != IStationCodeTable.stationUIC && document.getStationCodeTable() != null){
+ asnData.setStationCodeTable(CodeTableType.valueOf(document.getStationCodeTable().name()));
+ }
+
+
+ if (document.getStations()!= null && !document.getStations().isEmpty()){
+ SequenceOfStringIA5 stationsIA5 = new SequenceOfStringIA5();
+ SequenceOfUnrestrictedLong stationsNum = new SequenceOfUnrestrictedLong();
+
+ for (String station : document.getStations()) {
+ String ia5 = UicEncoderUtils.getIA5NonNum(station);
+ Long num = UicEncoderUtils.getNum(station);
+ if (ia5 != null && ia5.length() > 0) {
+ stationsIA5.add(ia5);
+ }
+ if (num != null && num > 0){
+ stationsNum.add(num);
+ }
+ }
+ if (!stationsIA5.isEmpty()){
+ asnData.setStationIA5(stationsIA5);
+ }
+ if (!stationsNum.isEmpty()){
+ asnData.setStationNum(stationsNum);
+ }
+ }
+
+ if (document.getStationNames()!= null && !document.getStationNames().isEmpty()) {
+
+ SequenceOfStringUTF8 asnList = new SequenceOfStringUTF8();
+ for ( String text :document.getStationNames()){
+ if (text.length() > 0) {
+ asnList.add(text);
+ }
+ }
+
+ if (!asnList.isEmpty()) {
+ asnData.setStationNameUTF8(asnList);
+ }
+
+ }
+
+ asnData.setValidityDates(document.getValidFrom(), document.getValidUntil(), issuingDate);
+
+ if (document.getValidFromUTCoffset() != null) {
+ asnData.setValidFromUTCOffset(document.getValidFromUTCoffset());
+ if (document.getValidUntilUTCoffset() != null && document.getValidUntilUTCoffset() != document.getValidFromUTCoffset()){
+ asnData.setValidUntilUTCOffset(document.getValidUntilUTCoffset());
+ }
+ }
+
+
+ asnData.setExtension(encodeExtension(document.getExtension()));
+
+ asnData.setAreaCodeNum(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.getNumList(document.getAreaCodes())));
+ asnData.setAreaCodeIA5(UicEncoderUtils.getIA5NonNumList(document.getAreaCodes()));
+
+ asnData.setAreaNameUTF8(UicEncoderUtils.encodeStringCollection(document.getAreaNames()));
+
+ return asnDocument;
+ }
+
+
+ /**
+ * Encode control details.
+ *
+ * @param data the data
+ * @param issuingDate the issuing date
+ * @return the control data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private ControlData encodeControlDetails(IControlDetail data, Date issuingDate) throws EncodingFormatException {
+
+ if (data == null) return null;
+
+ ControlData asnData = new ControlData();
+
+ asnData.setExtension(encodeExtension(data.getExtension()));
+
+ if (data.isAgeCheckRequired()) {
+ asnData.setAgeCheckRequired(true);
+ } else {
+ asnData.setAgeCheckRequired(false);
+ }
+
+ if (data.isIdentificationByIdCard()){
+ asnData.setIdentificationByIdCard(true);
+ } else {
+ asnData.setIdentificationByIdCard(false);
+ }
+
+ if (data.isIdentificationByPassportId()){
+ asnData.setIdentificationByPassportId(true);
+ } else {
+ asnData.setIdentificationByPassportId(false);
+ }
+
+ if (data.isOnlineValidationRequired()){
+ asnData.setOnlineValidationRequired(true);
+ } else {
+ asnData.setOnlineValidationRequired(false);
+ }
+
+ if (data.isPassportValidationRequired()){
+ asnData.setPassportValidationRequired(true);
+ } else {
+ asnData.setPassportValidationRequired(false);
+ }
+
+ if (data.isReductionCardCheckRequired()){
+ asnData.setReductionCardCheckRequired(true);
+ } else {
+ asnData.setReductionCardCheckRequired(false);
+ }
+
+ asnData.setInfoText(data.getInfoText());
+
+ asnData.setRandomDetailedValidationRequired(UicEncoderUtils.getRestrictedInt(data.getRandomDetailedValidationRequired(), 0,99));
+
+ asnData.setIdentificationItem(UicEncoderUtils.getUnRestrictedInt(data.getIdentificationItem()));
+
+ asnData.setIncludedTickets(encodeTicketLickList(data.getLinkedTickets()));
+
+ asnData.setIdentificationByCardReference(encodeCardReferences(data.getIdentificationByCardReference()));
+
+ return asnData;
+ }
+
+
+
+ /**
+ * Encode card references.
+ *
+ * @param cardReferences the card references
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfCardReferenceType encodeCardReferences(Collection<ICardReference> cardReferences) throws EncodingFormatException {
+
+ if (cardReferences == null || cardReferences.isEmpty()) return null;
+
+ SequenceOfCardReferenceType asnList = new SequenceOfCardReferenceType();
+
+ for (ICardReference card : cardReferences){
+
+ CardReferenceType asnCard = new CardReferenceType();
+
+ if (card.getCardId() != null && card.getCardId().length() > 0){
+ //only longs allowed
+ try {
+ long num = Long.parseLong(card.getCardId());
+ asnCard.setCardIdNum(num);
+ } catch (Exception e ){
+ asnCard.setCardIdIA5(card.getCardId());
+ }
+ }
+
+
+ asnCard.setCardIssuerNum(UicEncoderUtils.getNum(card.getCardIssuer()));
+ asnCard.setCardIssuerIA5(UicEncoderUtils.getIA5NonNum(card.getCardIssuer()));
+ asnCard.setCardName(card.getCardName());
+ asnCard.setCardType(UicEncoderUtils.getUnRestrictedInt(card.getCardType()));
+
+ asnCard.setLeadingCardIdNum(UicEncoderUtils.getNum(card.getLeadingCardId()));
+ asnCard.setLeadingCardIdIA5(UicEncoderUtils.getIA5NonNum(card.getLeadingCardId()));
+
+ asnCard.setTrailingCardIdNum(UicEncoderUtils.getNum(card.getTrailingCardId()));
+ asnCard.setTrailingCardIdIA5(UicEncoderUtils.getIA5NonNum(card.getTrailingCardId()));
+
+ asnList.add(asnCard);
+
+ }
+
+
+ if (asnList.isEmpty()) return null;
+
+ return asnList;
+ }
+
+ /**
+ * Encode ticket lick list.
+ *
+ * @param linkedTickets the linked tickets
+ * @return the list
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private SequenceOfTicketLinkType encodeTicketLickList(Collection<ITicketLink> linkedTickets) throws EncodingFormatException {
+
+ if (linkedTickets == null || linkedTickets.isEmpty()) return null;
+
+ SequenceOfTicketLinkType asnList = new SequenceOfTicketLinkType();
+
+ for (ITicketLink ticket : linkedTickets){
+
+ TicketLinkType asnTicket = new TicketLinkType();
+
+ asnTicket.setIssuerName(ticket.getIssuer());
+
+ asnTicket.setIssuerPNR(ticket.getIssuerPNR());
+
+ asnTicket.setProductOwnerNum(UicEncoderUtils.getNum(ticket.getProductOwner()));
+ asnTicket.setProductOwnerIA5(UicEncoderUtils.getIA5NonNum(ticket.getProductOwner()));
+
+ asnTicket.setReferenceNum(UicEncoderUtils.getNum(ticket.getReference()));
+ asnTicket.setReferenceIA5(UicEncoderUtils.getIA5NonNum(ticket.getReference()));
+
+ if (ticket.getTicketType() != ITicketType.openTicket && ticket.getTicketType() != null){
+ asnTicket.setTicketType(TicketType.valueOf(ticket.getTicketType().name()));
+ }
+
+ if (ticket.getLinkMode() != ILinkMode.issuedTogether && ticket.getLinkMode() != null){
+ asnTicket.setLinkMode(LinkMode.valueOf(ticket.getLinkMode().name()));
+ }
+
+ asnList.add(asnTicket);
+ }
+
+ if (asnList.isEmpty()) return null;
+
+ return asnList;
+ }
+
+ /**
+ * Encode travelers.
+ *
+ * @param data the data
+ * @param issuingDate the issuing date
+ * @return the traveler data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private TravelerData encodeTravelers(ITravelerDetail data,Date issuingDate) throws EncodingFormatException {
+
+ if (data == null) return null;
+
+ TravelerData asnData = new TravelerData();
+
+ asnData.setGroupName(data.getGroupName());
+
+ asnData.setPreferedLanguage(data.getPreferredLanguage());
+
+ if (data.getTravelers()!=null && !data.getTravelers().isEmpty()) {
+
+ SequenceOfTravelerType asnTravelers = new SequenceOfTravelerType();
+
+ for (ITraveler traveler : data.getTravelers()){
+
+ TravelerType asnTraveler = encodeTraveler(traveler);
+
+ if (asnTraveler !=null){
+ asnTravelers.add(asnTraveler);
+ }
+ }
+
+ if (!asnTravelers.isEmpty()) {
+ asnData.setTraveler(asnTravelers);
+ }
+
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Encode issuing details.
+ *
+ * @param data the data
+ * @return the issuing data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private IssuingData encodeIssuingDetails(IIssuingDetail data) throws EncodingFormatException {
+
+ if (data == null){
+ throw new EncodingFormatException("Issuind data missing");
+ }
+
+ IssuingData asnData = new IssuingData();
+
+ if (!data.isActivated()){
+ asnData.setActivated(false);
+ } else {
+ asnData.setActivated(true);
+ }
+
+ if (!data.isSecurePaperTicket()) {
+ asnData.setSecurePaperTicket(false);
+ } else {
+ asnData.setSecurePaperTicket(true);
+ }
+
+ asnData.setExtension(encodeExtension(data.getExtension()));
+
+
+ asnData.setIssuedOnLine(UicEncoderUtils.getRestrictedInt(data.getIssuedOnLine(), 1, 99999));
+
+ asnData.setIssuedOnTrainNum(UicEncoderUtils.getNum(data.getIssuedOnTrain()));
+ asnData.setIssuedOnTrainIA5(UicEncoderUtils.getIA5NonNum(data.getIssuedOnTrain()));
+
+
+ asnData.setSecurityProviderNum(UicEncoderUtils.getNum(data.getSecurityProvider()));
+
+
+ if (data.getIssuer()!= null && !data.getIssuer().equals(data.getSecurityProvider()) ){
+ asnData.setIssuerNum(UicEncoderUtils.getNum(data.getIssuer()));
+ asnData.setIssuerIA5(UicEncoderUtils.getIA5NonNum(data.getIssuer()));
+ }
+
+ asnData.setIssuerName(data.getIssuerName());
+ asnData.setIssuerPNR(UicEncoderUtils.getIA5(data.getIssuerPNR()));
+
+
+ asnData.setIssuingDate(data.getIssuingDate());
+
+ if (data.isSpecimen()){
+ asnData.setSpecimen(true);
+ } else {
+ asnData.setSpecimen(false);
+ }
+
+ if (data.getPointOfSale()!= null){
+ asnData.setPointOfSale(encodeGeoCoordinate(data.getPointOfSale()));
+ }
+
+ return asnData;
+ }
+
+ /**
+ * Encode geo coordinate.
+ *
+ * @param point the point
+ * @return the geo coordinate type
+ */
+ private GeoCoordinateType encodeGeoCoordinate(IGeoCoordinate point) {
+
+ if (point == null) return null;
+
+ GeoCoordinateType asnPoint = new GeoCoordinateType();
+
+ asnPoint.setLatitude(point.getLatitude());
+ asnPoint.setLongitude(point.getLongitude());
+
+ if (point.getUnit() != IGeoUnitType.milliDegree && point.getUnit() != null){
+ asnPoint.setGeoUnit(GeoUnitType.valueOf(point.getUnit().name()));
+ }
+
+ if (point.getAccuracy() != null) {
+ asnPoint.setAccuracy(GeoUnitType.valueOf(point.getAccuracy().name()));
+ }
+
+ if (point.getHemisphereLatitude() != IHemisphereLatitudeType.east && point.getHemisphereLatitude() != null) {
+ asnPoint.setHemisphereLatitude(HemisphereLatitudeType.valueOf(point.getHemisphereLatitude().name()));
+ }
+
+ if (point.getHemisphereLongitude() != IHemisphereLongitudeType.north && point.getHemisphereLongitude() != null) {
+ asnPoint.setHemisphereLongitude(HemisphereLongitudeType.valueOf(point.getHemisphereLongitude().name()));
+ }
+
+ if (point.getSystem() != IGeoCoordinateSystemType.wgs84 && point.getSystem() != null){
+ asnPoint.setCoordinateSystem(GeoCoordinateSystemType.valueOf(point.getSystem().name()));
+ }
+
+
+ return asnPoint;
+ }
+
+ /**
+ * Encode customer card.
+ *
+ * @param document the customer card
+ * @param issuingDate the issuing date
+ * @return the document data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private DocumentData encodeCustomerCard(ICustomerCard document,Date issuingDate) throws EncodingFormatException {
+
+ DocumentData asnDocument = new DocumentData();
+ TicketDetailData asnTicket = new TicketDetailData();
+ asnDocument.setTicket(asnTicket);
+
+ CustomerCardData asnCustomerCard = new CustomerCardData();
+ asnDocument.getTicket().setCustomerCard(asnCustomerCard);
+
+
+ if (document.getCardId() != null && document.getCardId().length() > 0){
+ //only longs allowed
+ try {
+ long num = Long.parseLong(document.getCardId());
+ asnCustomerCard.setCardIdNum(num);
+ } catch (Exception e ){
+ asnCustomerCard.setCardIdIA5(document.getCardId());
+ }
+ }
+
+
+ asnCustomerCard.setCardType(UicEncoderUtils.getRestrictedInt(document.getCardType(),1,1000));
+
+ asnCustomerCard.setCardTypeDescr(document.getCardTypeDescr());
+
+ if (document.getClassCode() != null) {
+ asnCustomerCard.setClassCode(TravelClassType.valueOf(document.getClassCode().name()));
+ }
+
+ if (document.getCustomer()!=null){
+ asnCustomerCard.setCustomer(encodeTraveler(document.getCustomer()));
+ }
+
+ asnCustomerCard.setCustomerStatus(UicEncoderUtils.getUnRestrictedInt(document.getCustomerStatus()));
+
+ asnCustomerCard.setCustomerStatusDescr(document.getCustomerStatusDescr());
+
+ asnCustomerCard.setExtension(encodeExtension(document.getExtension()));
+
+ asnCustomerCard.setIncludedServices(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.getUnRestrictedIntList(document.getIncludedServices())));
+
+ asnCustomerCard.setValidity(document.getValidFrom(), document.getValidUntil());
+
+ return asnDocument;
+ }
+
+ private TokenType encodeToken(IToken token) throws EncodingFormatException {
+ TokenType asnToken = new TokenType();
+ asnToken.setToken(token.getToken());
+ asnToken.setTokenProviderNum(UicEncoderUtils.getNum(token.getTokenProvider()));
+ asnToken.setTokenProviderIA5(UicEncoderUtils.getIA5NonNum(token.getTokenProvider()));
+ asnToken.setTokenSpecification(token.getTokenSpecification());
+ return asnToken;
+ }
+
+
+
+
+ private VatDetailType encodeVatDetail(IVatDetail vatDetail) {
+
+ if (vatDetail == null) return null;
+
+ VatDetailType asnVatDetail = new VatDetailType();
+
+ asnVatDetail.setAmount(vatDetail.getAmount());
+ asnVatDetail.setCountry(new Long(vatDetail.getCountry()));
+ asnVatDetail.setPercentage(new Long(vatDetail.getPercentage()));
+ asnVatDetail.setVatId(vatDetail.getVatId());
+
+ return asnVatDetail;
+
+ }
+
+ /**
+ * Encode traveler.
+ *
+ * @param traveler the traveler
+ * @return the traveler type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private TravelerType encodeTraveler(ITraveler traveler) throws EncodingFormatException {
+
+ if (traveler == null) return null;
+
+ TravelerType asnTraveler = new TravelerType();
+
+ asnTraveler.setCountryOfResidence(UicEncoderUtils.getRestrictedInt(traveler.getCountryOfResidence(), 1, 999));
+ asnTraveler.setCountryOfPassport(UicEncoderUtils.getRestrictedInt(traveler.getPassportCountry(), 1, 999));
+ asnTraveler.setCountryOfIdCard(UicEncoderUtils.getRestrictedInt(traveler.getIDCardCountry(), 1, 999));
+
+
+ asnTraveler.setCustomerIdNum(UicEncoderUtils.getNum(traveler.getCustomerId()));
+ asnTraveler.setCustomerIdIA5(UicEncoderUtils.getIA5NonNum(traveler.getCustomerId()));
+
+ asnTraveler.setDateOfBirth(traveler.getDateOfBirth());
+
+ asnTraveler.setFirstName(traveler.getFirstName());
+ asnTraveler.setSecondName(traveler.getSecondName());
+ asnTraveler.setLastName(traveler.getLastName());
+ if (traveler.getGender() != null) {
+ asnTraveler.setGender(GenderType.valueOf(traveler.getGender().toString()));
+ }
+ asnTraveler.setIdCard(UicEncoderUtils.getIA5(traveler.getIdCard()));
+ asnTraveler.setPassportId(UicEncoderUtils.getIA5(traveler.getPassportId()));
+ asnTraveler.setTitle(UicEncoderUtils.getIA5(traveler.getTitle()));
+
+ if (traveler.getPassengerType() != null) {
+ asnTraveler.setPassengerType(PassengerType.valueOf(traveler.getPassengerType().name()));
+ }
+
+ asnTraveler.setPassengerWithReducedMobility(traveler.isPassengerWithReducedMobility());
+ if (traveler.isTicketHolder()){
+ asnTraveler.setTicketHolder(true);
+ } else {
+ asnTraveler.setTicketHolder(false);
+ }
+
+ if (traveler.getStatusCollection()!= null && !traveler.getStatusCollection().isEmpty()){
+
+ SequenceOfCustomerStatusType asnList = new SequenceOfCustomerStatusType();
+
+ for (ICustomerStatusDescription status : traveler.getStatusCollection() ) {
+ asnList.add(mapCustomerStatusType(status));
+ }
+ if (!asnList.isEmpty()) {
+ asnTraveler.setStatus(asnList);
+ }
+ }
+
+
+ return asnTraveler;
+ }
+
+ /**
+ * Map customer status type.
+ *
+ * @param status the status
+ * @return the customer status type
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private CustomerStatusType mapCustomerStatusType(ICustomerStatusDescription status) throws EncodingFormatException {
+
+ CustomerStatusType asnStatus = new CustomerStatusType();
+
+ if (status.getStatus() > 0) {
+ asnStatus.setCustomerStatus(new Long(status.getStatus()));
+ }
+ asnStatus.setCustomerStatusDescr(status.getDescription());
+ asnStatus.setStatusProviderIA5(UicEncoderUtils.getIA5NonNum(status.getStatusProvider()));
+ asnStatus.setStatusProviderNum(UicEncoderUtils.getNum(status.getStatusProvider()));
+
+ return asnStatus;
+ }
+
+ /**
+ * Encode extension.
+ *
+ * @param extension the extension
+ * @return the extension data
+ * @throws EncodingFormatException the encoding format exception
+ */
+ private ExtensionData encodeExtension(IExtension extension) throws EncodingFormatException {
+
+ if (extension==null) return null;
+
+ if (extension.getBinarydata() == null || extension.getBinarydata().length == 0) {
+ throw new EncodingFormatException("Extension does not include data");
+ }
+
+ if (extension.getId() == null || extension.getId().length() == 0) {
+ throw new EncodingFormatException("Extension does not include id");
+ }
+
+ ExtensionData asnExtension = new ExtensionData();
+
+ asnExtension.setExtensionData(extension.getBinarydata());
+ asnExtension.setExtensionId(UicEncoderUtils.getIA5(extension.getId()));
+
+ return asnExtension;
+ }
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Asn2ApiDecoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/Asn2ApiDecoder.java
new file mode 100644
index 0000000..e751f48
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/Asn2ApiDecoder.java
@@ -0,0 +1,13 @@
+package org.uic.barcode.ticket.api.utils;
+
+import java.io.IOException;
+
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+
+public interface Asn2ApiDecoder {
+
+
+ public IUicRailTicket decodeFromAsn (byte[] data) throws IOException;
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java
index d203487..bf3918c 100644
--- a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java
@@ -118,7 +118,7 @@ import org.uic.barcode.ticket.api.spec.IZone;
/**
* The Class OpenAsn2ApiDecoder.
*/
-public class OpenAsn2ApiDecoder {
+public class OpenAsn2ApiDecoder implements Asn2ApiDecoder {
IUicTicketObjectFactory factory = SimpleUicTicketObjectFactory.getInstance();
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java
index b8ee363..fc68f91 100644
--- a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java
@@ -118,7 +118,7 @@ import org.uic.barcode.ticket.api.spec.IZone;
/**
* The Class OpenAsn2ApiDecoder.
*/
-public class OpenAsn2ApiDecoderV2 {
+public class OpenAsn2ApiDecoderV2 implements Asn2ApiDecoder {
IUicTicketObjectFactory factory = SimpleUicTicketObjectFactory.getInstance();
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java
new file mode 100644
index 0000000..56efcb1
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java
@@ -0,0 +1,2324 @@
+/*
+ *
+ */
+package org.uic.barcode.ticket.api.utils;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+import org.uic.barcode.ticket.api.asn.omv3.BerthDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.CarCarriageReservationData;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.CompartmentDetailsType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CountermarkData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerCardData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DelayConfirmation;
+import org.uic.barcode.ticket.api.asn.omv3.DeltaCoordinates;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.FIPTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.GeoCoordinateType;
+import org.uic.barcode.ticket.api.asn.omv3.IncludedOpenTicketType;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LineType;
+import org.uic.barcode.ticket.api.asn.omv3.LuggageRestrictionType;
+import org.uic.barcode.ticket.api.asn.omv3.OpenTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.ParkingGroundData;
+import org.uic.barcode.ticket.api.asn.omv3.PassData;
+import org.uic.barcode.ticket.api.asn.omv3.PlacesType;
+import org.uic.barcode.ticket.api.asn.omv3.PolygoneType;
+import org.uic.barcode.ticket.api.asn.omv3.RegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.RegisteredLuggageType;
+import org.uic.barcode.ticket.api.asn.omv3.ReservationData;
+import org.uic.barcode.ticket.api.asn.omv3.ReturnRouteDescriptionType;
+import org.uic.barcode.ticket.api.asn.omv3.RouteSectionType;
+import org.uic.barcode.ticket.api.asn.omv3.SeriesDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.StationPassageData;
+import org.uic.barcode.ticket.api.asn.omv3.TariffType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TimeRangeType;
+import org.uic.barcode.ticket.api.asn.omv3.TokenType;
+import org.uic.barcode.ticket.api.asn.omv3.TrainLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TrainValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.ValidityPeriodDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ValidityPeriodType;
+import org.uic.barcode.ticket.api.asn.omv3.VatDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ViaStationType;
+import org.uic.barcode.ticket.api.asn.omv3.VoucherData;
+import org.uic.barcode.ticket.api.asn.omv3.ZoneType;
+import org.uic.barcode.ticket.api.impl.SimpleUicTicketObjectFactory;
+import org.uic.barcode.ticket.api.spec.IBerth;
+import org.uic.barcode.ticket.api.spec.IBerthTypeType;
+import org.uic.barcode.ticket.api.spec.IBoardingOrArrivalType;
+import org.uic.barcode.ticket.api.spec.ICarCarriageReservation;
+import org.uic.barcode.ticket.api.spec.ICardReference;
+import org.uic.barcode.ticket.api.spec.ICompartmentDetails;
+import org.uic.barcode.ticket.api.spec.ICompartmentGenderType;
+import org.uic.barcode.ticket.api.spec.ICompartmentPositionType;
+import org.uic.barcode.ticket.api.spec.IControlDetail;
+import org.uic.barcode.ticket.api.spec.ICounterMark;
+import org.uic.barcode.ticket.api.spec.ICustomerCard;
+import org.uic.barcode.ticket.api.spec.ICustomerStatusDescription;
+import org.uic.barcode.ticket.api.spec.IDelayConfirmation;
+import org.uic.barcode.ticket.api.spec.IDocumentExtension;
+import org.uic.barcode.ticket.api.spec.IExtension;
+import org.uic.barcode.ticket.api.spec.IFipTicket;
+import org.uic.barcode.ticket.api.spec.IGenderType;
+import org.uic.barcode.ticket.api.spec.IGeoCoordinate;
+import org.uic.barcode.ticket.api.spec.IGeoCoordinateSystemType;
+import org.uic.barcode.ticket.api.spec.IGeoUnitType;
+import org.uic.barcode.ticket.api.spec.IHemisphereLatitudeType;
+import org.uic.barcode.ticket.api.spec.IHemisphereLongitudeType;
+import org.uic.barcode.ticket.api.spec.IIncludedOpenTicket;
+import org.uic.barcode.ticket.api.spec.IIssuingDetail;
+import org.uic.barcode.ticket.api.spec.ILine;
+import org.uic.barcode.ticket.api.spec.ILinkMode;
+import org.uic.barcode.ticket.api.spec.ILoadingDeckType;
+import org.uic.barcode.ticket.api.spec.ILuggageRestriction;
+import org.uic.barcode.ticket.api.spec.IOpenTicket;
+import org.uic.barcode.ticket.api.spec.IParkingGround;
+import org.uic.barcode.ticket.api.spec.IPass;
+import org.uic.barcode.ticket.api.spec.IPassengerType;
+import org.uic.barcode.ticket.api.spec.IPlaces;
+import org.uic.barcode.ticket.api.spec.IPolygone;
+import org.uic.barcode.ticket.api.spec.IPriceTypeType;
+import org.uic.barcode.ticket.api.spec.IRegionalValidity;
+import org.uic.barcode.ticket.api.spec.IRegisteredLuggage;
+import org.uic.barcode.ticket.api.spec.IReservation;
+import org.uic.barcode.ticket.api.spec.IReturnRouteDescription;
+import org.uic.barcode.ticket.api.spec.IRoofRackType;
+import org.uic.barcode.ticket.api.spec.IRouteSection;
+import org.uic.barcode.ticket.api.spec.ISeriesDataDetails;
+import org.uic.barcode.ticket.api.spec.IServiceBrand;
+import org.uic.barcode.ticket.api.spec.IStationCodeTable;
+import org.uic.barcode.ticket.api.spec.IStationPassage;
+import org.uic.barcode.ticket.api.spec.ITariff;
+import org.uic.barcode.ticket.api.spec.ITicketLink;
+import org.uic.barcode.ticket.api.spec.ITicketType;
+import org.uic.barcode.ticket.api.spec.ITimeRange;
+import org.uic.barcode.ticket.api.spec.IToken;
+import org.uic.barcode.ticket.api.spec.ITrainLink;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
+import org.uic.barcode.ticket.api.spec.ITravelClassType;
+import org.uic.barcode.ticket.api.spec.ITraveler;
+import org.uic.barcode.ticket.api.spec.ITravelerDetail;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.spec.IUicTicketObjectFactory;
+import org.uic.barcode.ticket.api.spec.IValidityDetails;
+import org.uic.barcode.ticket.api.spec.IValidityRange;
+import org.uic.barcode.ticket.api.spec.IVatDetail;
+import org.uic.barcode.ticket.api.spec.IViaStation;
+import org.uic.barcode.ticket.api.spec.IVoucher;
+import org.uic.barcode.ticket.api.spec.IZone;
+
+
+/**
+ * The Class OpenAsn2ApiDecoder.
+ */
+public class OpenAsn2ApiDecoderV3 implements Asn2ApiDecoder {
+
+ IUicTicketObjectFactory factory = SimpleUicTicketObjectFactory.getInstance();
+
+ /**
+ * Decode from asn.1 unaligned PER encoded data.
+ *
+ * @param asnUicRailTicketData the asn uic rail ticket data
+ * @return the decoded uic rail ticket
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public IUicRailTicket decodeFromAsn (UicRailTicketData asnUicRailTicketData) throws IOException{
+
+ IUicRailTicket uicRailTicket = factory.createUicRailTicket();
+
+ populateFromAsn1Model(uicRailTicket, asnUicRailTicketData);
+
+ return uicRailTicket;
+
+ }
+
+ /**
+ * Decode from asn.1 unaligned PER encoded data.
+ *
+ * @param data byte array of the asn.1 encoded FCB data
+ * @return the decoded uic rail ticket
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public IUicRailTicket decodeFromAsn (byte[] data) throws IOException{
+
+ UicRailTicketData asnUicRailTicketData = UicRailTicketData.decode(data);
+
+ IUicRailTicket uicRailTicket = factory.createUicRailTicket();
+
+ populateFromAsn1Model(uicRailTicket, asnUicRailTicketData);
+
+ return uicRailTicket;
+
+ }
+
+
+
+
+
+
+
+ /**
+ * Populate from asn1 model.
+ *
+ * @param uicRailTicket the uic rail ticket
+ * @param asnUicRailTicketData the asn uic rail ticket data
+ */
+ protected void populateFromAsn1Model(IUicRailTicket uicRailTicket, UicRailTicketData asnUicRailTicketData) {
+
+ if (asnUicRailTicketData.getExtension()!= null && !asnUicRailTicketData.getExtension().isEmpty()) {
+ for (ExtensionData asnExtension : asnUicRailTicketData.getExtension()){
+ uicRailTicket.addExtension(convertExtension(asnExtension));
+ }
+ }
+
+ if (asnUicRailTicketData.getIssuingDetail() != null) {
+ populateIssuingDetail(asnUicRailTicketData.getIssuingDetail(), uicRailTicket.getIssuerDetails());
+ }
+
+ if (asnUicRailTicketData.getControlDetail() != null) {
+ populateControlDetails(asnUicRailTicketData.getControlDetail(),uicRailTicket.getControlDetails());
+ }
+
+ if (asnUicRailTicketData.getTravelerDetail() != null) {
+ populateTravelerDetails(asnUicRailTicketData.getTravelerDetail(),uicRailTicket.getTravelerDetails());
+ }
+
+ if (asnUicRailTicketData.getTransportDocument() != null && !asnUicRailTicketData.getTransportDocument().isEmpty()) {
+
+ // date is already converted to local time, use UTC for internal calculations
+ Date localIssuingDate = uicRailTicket.getIssuerDetails().getIssuingDate();
+ Date issuingDate = DateTimeUtils.dateToUTC(localIssuingDate);
+
+ populateTravelDocuments(asnUicRailTicketData.getTransportDocument(),uicRailTicket, issuingDate);
+ }
+
+
+ }
+
+
+
+
+
+
+ /**
+ * Populate travel documents.
+ *
+ * @param asnTransportDocuments the asn transport documents
+ * @param uicRailTicket the uic rail ticket
+ * @param issuingDate the issuing date
+ */
+ protected void populateTravelDocuments(List<DocumentData> asnTransportDocuments,IUicRailTicket uicRailTicket, Date issuingDate) {
+
+ for ( DocumentData asnDocument : asnTransportDocuments){
+
+ if (asnDocument.getTicket() == null) {
+ break;
+ }
+
+ if (asnDocument.getTicket().getExtension() != null) {
+ IDocumentExtension ticket = convertDocumentExtension(asnDocument.getTicket().getExtension());
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addDocumentExtension(ticket);
+ }
+
+ if (asnDocument.getTicket().getCarCarriageReservation() != null) {
+ ICarCarriageReservation ticket = convertCarCarriage(asnDocument.getTicket().getCarCarriageReservation(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addCarCarriageReservation(ticket);
+ }
+
+ if (asnDocument.getTicket().getCounterMark() != null) {
+ ICounterMark ticket = convertCountermark(asnDocument.getTicket().getCounterMark(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addCounterMark(ticket);
+ }
+
+ if (asnDocument.getTicket().getCustomerCard()!= null) {
+ ICustomerCard ticket = convertCustomerCard(asnDocument.getTicket().getCustomerCard(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addCustomerCard(ticket);
+ }
+
+ if (asnDocument.getTicket().getFipTicket()!= null) {
+ IFipTicket ticket = convertFipTicket(asnDocument.getTicket().getFipTicket(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addFipTicket(ticket);
+ }
+
+ if (asnDocument.getTicket().getOpenTicket()!= null) {
+ IOpenTicket ticket = convertOpenTicket(asnDocument.getTicket().getOpenTicket(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addOpenTicket(ticket);
+ }
+
+
+ if (asnDocument.getTicket().getParkingGround()!= null) {
+ IParkingGround ticket = convertParkingGround(asnDocument.getTicket().getParkingGround(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addParkingGround(ticket);
+ }
+
+ if (asnDocument.getTicket().getPass() != null) {
+ IPass ticket = convertPass(asnDocument.getTicket().getPass(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addPass(ticket);
+ }
+
+ if (asnDocument.getTicket().getStationPassage() != null) {
+ IStationPassage ticket = convertStationPassage(asnDocument.getTicket().getStationPassage(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addStationPassage(ticket);
+ }
+
+ if (asnDocument.getTicket().getReservation() != null) {
+ IReservation ticket = convertReservation(asnDocument.getTicket().getReservation(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addReservation(ticket);
+ }
+
+ if (asnDocument.getTicket().getVoucher()!= null) {
+ IVoucher ticket = convertVoucher(asnDocument.getTicket().getVoucher(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addVoucher(ticket);
+ }
+
+ if (asnDocument.getTicket().getDelayConfirmation()!= null) {
+ IDelayConfirmation ticket = convertDelayConfirmation(asnDocument.getTicket().getDelayConfirmation(),issuingDate);
+ if (asnDocument.getToken() != null) {
+ IToken token = convertToken(asnDocument.getToken());
+ ticket.setToken(token);
+ }
+ uicRailTicket.addDelayConfirmation(ticket);
+ }
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+ private IToken convertToken(TokenType asnToken) {
+
+ if (asnToken == null) return null;
+
+ IToken token = factory.createToken();
+ token.setToken(asnToken.getToken());
+ token.setTokenProvider(UicEncoderUtils.mapToString(asnToken.getTokenProviderNum(), asnToken.getTokenProviderIA5()));
+ token.setTokenSpecification(asnToken.getTokenSpecification());
+ return token;
+ }
+
+
+
+ private IDelayConfirmation convertDelayConfirmation(DelayConfirmation asnDocument, Date issuingDate) {
+
+ IDelayConfirmation document = factory.createDelayConfirmation();
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum().longValue(),asnDocument.getReferenceIA5()));
+
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().toString()));
+ }
+ document.setStation(UicEncoderUtils.mapToString(asnDocument.getStationNum(),asnDocument.getStationIA5()));
+
+ document.setStationName(asnDocument.getStationNameUTF8());
+
+ document.setArrivalDate(asnDocument.getPlannedArrivalDate());
+ document.setArrivalUTCoffset(asnDocument.getDepartureUTCOffset());
+
+ if (asnDocument.getConfirmationType() != null) {
+ document.setConfirmationType(asnDocument.getConfirmationType().ordinal());
+ }
+
+ if (asnDocument.getDelay() != null) {
+ document.setDelay(asnDocument.getDelay().intValue());
+ }
+
+ if (asnDocument.getTrainCancelled() != null) {
+ document.setTrainCancelled(asnDocument.getTrainCancelled());
+ } else {
+ document.setTrainCancelled(false);
+ }
+
+ if (asnDocument.getAffectedTickets() !=null && !asnDocument.getAffectedTickets().isEmpty()) {
+ for (TicketLinkType asnTicketLink : asnDocument.getAffectedTickets()) {
+ document.addLinkedTicket(convertTicketLink(asnTicketLink));
+ }
+ }
+
+ return document;
+ }
+
+
+
+
+
+
+ /**
+ * Convert reservation.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i reservation
+ */
+ protected IReservation convertReservation(ReservationData asnDocument, Date issuingDate) {
+
+ IReservation document = factory.createReservation();
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ document.setFromStation(UicEncoderUtils.mapToString(asnDocument.getFromStationNum(),asnDocument.getFromStationIA5()));
+ document.setToStation(UicEncoderUtils.mapToString(asnDocument.getToStationNum(),asnDocument.getToStationIA5()));
+ document.setFromStationName(asnDocument.getFromStationNameUTF8());
+ document.setToStationName(asnDocument.getToStationNameUTF8());
+
+ document.setDepartureDate(asnDocument.getDepartureDate(issuingDate));
+ document.setArrivalDate(asnDocument.getArrivalDate(issuingDate));
+
+ document.setDepartureUTCoffset(asnDocument.getDepartureUTCOffset());
+ if (asnDocument.getArrivalUTCOffset() != null) {
+ document.setArrivalUTCoffset(asnDocument.getArrivalUTCOffset());
+ } else {
+ document.setArrivalUTCoffset(asnDocument.getDepartureUTCOffset());
+ }
+
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+
+ document.setCompartmentDetails(convertCompartmentDetails(asnDocument.getCompartmentDetails()));
+
+ document.setLuggageRestriction(convertLuggageRestriction(asnDocument.getLuggage()));
+
+ if (asnDocument.getNumberOfOverbooked() != null) {
+ document.setNumberOfOverbooked(asnDocument.getNumberOfOverbooked().intValue());
+ }
+
+ if (asnDocument.getNumberOfSupplements() != null) {
+ document.setNumberOfSupplements(asnDocument.getNumberOfSupplements().intValue());
+ }
+
+ if (asnDocument.getPlaces()!=null) {
+ document.setPlaces(convertPlaces(asnDocument.getPlaces()));
+ }
+
+ if (asnDocument.getBicyclePlaces()!=null) {
+ document.setBicyclePlaces(convertPlaces(asnDocument.getBicyclePlaces()));
+ }
+
+ document.setPriceType(IPriceTypeType.valueOf(asnDocument.getPriceType().name()));
+
+ IServiceBrand serviceBrand = factory.createServiceBrand();
+
+ if (asnDocument.getServiceBrand()!=null){
+ serviceBrand.setServiceBrand(asnDocument.getServiceBrand().intValue());
+ }
+ serviceBrand.setServiceBrandAbbreviation(asnDocument.getServiceBrandAbrUTF8());
+ serviceBrand.setServiceBrandDescription(asnDocument.getServiceBrandNameUTF8());
+
+ document.setServiceBrand(serviceBrand);
+
+ if (asnDocument.getServiceLevel()!=null && asnDocument.getServiceLevel().length() != 0) {
+ document.setServiceLevel(asnDocument.getServiceLevel());
+ }
+
+ document.setTrain(UicEncoderUtils.mapToString(asnDocument.getTrainNum(), asnDocument.getTrainIA5()));
+
+ if (asnDocument.getTypeOfSupplement()!=null) {
+ document.setTypeOfSupplement(asnDocument.getTypeOfSupplement().intValue());
+ }
+
+ if (asnDocument.getBerth()!=null && !asnDocument.getBerth().isEmpty()){
+ for (BerthDetailData asnBerth : asnDocument.getBerth()){
+ document.addBerth(convertBerth(asnBerth));
+ }
+ }
+
+ if (asnDocument.getCarrierNum()!=null && !asnDocument.getCarrierNum().isEmpty()){
+ for(Long carrier :asnDocument.getCarrierNum()){
+ document.addCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getCarrierIA5()!=null && !asnDocument.getCarrierIA5().isEmpty()){
+ for(String carrier :asnDocument.getCarrierIA5()){
+ document.addCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getTariff()!=null && !asnDocument.getTariff().isEmpty()){
+ for (TariffType asnTariff : asnDocument.getTariff()) {
+ document.addTariff(convertTariff(asnTariff));
+ }
+ }
+
+ document.setPrice(asnDocument.getPrice());
+
+ if (asnDocument.getVatDetails() != null && !asnDocument.getVatDetails().isEmpty()){
+ for (VatDetailType vat : asnDocument.getVatDetails()) {
+ document.addVatDetail(decodeVatDetail(vat));
+ }
+ }
+
+ return document;
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * Convert car carriage.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i car carriage reservation
+ */
+ protected ICarCarriageReservation convertCarCarriage(CarCarriageReservationData asnDocument , Date issuingDate) {
+
+ ICarCarriageReservation document = factory.createCarCarriageReservation();
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ document.setFromStation(UicEncoderUtils.mapToString(asnDocument.getFromStationNum(),asnDocument.getFromStationIA5()));
+ document.setToStation(UicEncoderUtils.mapToString(asnDocument.getToStationNum(),asnDocument.getToStationIA5()));
+ document.setFromStationName(asnDocument.getFromStationNameUTF8());
+ document.setToStationName(asnDocument.getToStationNameUTF8());
+
+ document.setBeginLoading(asnDocument.getBeginLoadingDate(issuingDate));
+ document.setEndLoading(asnDocument.getEndLoadingDate(issuingDate));
+
+ document.setLoadingTimeUTCoffset(asnDocument.getLoadingUTCOffset());
+
+
+ if(asnDocument.getAttachedBicycles()!=null){
+ document.setAttachedBicycles(asnDocument.getAttachedBicycles().intValue());
+ }
+
+ if (asnDocument.getAttachedBoats()!=null) {
+ document.setAttachedBoats(asnDocument.getAttachedBoats().intValue());
+ }
+
+ if(asnDocument.getAttachedSurfboards()!=null) {
+ document.setAttachedSurfboards(asnDocument.getAttachedSurfboards().intValue());
+ }
+
+ if (asnDocument.getBoatCategory()!=null){
+ document.setBoatCategory(asnDocument.getBoatCategory().intValue());
+ }
+
+ if(asnDocument.getCarCategory()!=null){
+ document.setCarCategory(asnDocument.getCarCategory().intValue());
+ }
+
+ if (asnDocument.getLoadingDeck()!=null){
+ document.setLoadingDeck(ILoadingDeckType.valueOf(asnDocument.getLoadingDeck().name()));
+ }
+
+ if(asnDocument.getLoadingListEntry()!=null){
+ document.setLoadingListEntry(asnDocument.getLoadingListEntry().intValue());
+ }
+
+ if (asnDocument.getRoofRackHeight()!=null){
+ document.setRoofRackHeight(asnDocument.getRoofRackHeight().intValue());
+ }
+
+ document.setNumberPlate(asnDocument.getNumberPlate());
+ document.setTrailerPlate(asnDocument.getTrailerPlate());
+
+ if(asnDocument.getRoofRackType()!=null){
+ document.setRoofRackType(IRoofRackType.valueOf(asnDocument.getRoofRackType().name()));
+ }
+
+ if(asnDocument.getTextileRoof()) {
+ document.setTextileRoof(asnDocument.getTextileRoof());
+ }
+
+
+ document.setCompartmentDetails(convertCompartmentDetails(asnDocument.getCompartmentDetails()));
+
+ if (asnDocument.getCarrierNum()!=null && !asnDocument.getCarrierNum().isEmpty()){
+ for(Long carrier :asnDocument.getCarrierNum()){
+ document.addCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getCarrierIA5()!=null && !asnDocument.getCarrierIA5().isEmpty()){
+ for(String carrier :asnDocument.getCarrierIA5()){
+ document.addCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getCoach()!=null) {
+ document.setCoach(asnDocument.getCoach());
+ }
+ if (asnDocument.getPlace()!=null) {
+ document.setPlace(asnDocument.getPlace());
+ }
+
+
+ document.setPriceType(IPriceTypeType.valueOf(asnDocument.getPriceType().name()));
+
+ IServiceBrand serviceBrand = factory.createServiceBrand();
+
+ if (asnDocument.getServiceBrand()!=null){
+ serviceBrand.setServiceBrand(asnDocument.getServiceBrand().intValue());
+ }
+ serviceBrand.setServiceBrandAbbreviation(asnDocument.getServiceBrandAbrUTF8());
+ serviceBrand.setServiceBrandDescription(asnDocument.getServiceBrandNameUTF8());
+
+ document.setServiceBrand(serviceBrand);
+
+ document.setTrain(UicEncoderUtils.mapToString(asnDocument.getTrainNum(), asnDocument.getTrainIA5()));
+
+
+ if (asnDocument.getTariff()!=null){
+ document.setTariff(convertTariff(asnDocument.getTariff()));
+ }
+
+ document.setPrice(asnDocument.getPrice());
+
+ if (asnDocument.getVatDetails() != null && !asnDocument.getVatDetails().isEmpty()){
+ for (VatDetailType vat : asnDocument.getVatDetails()) {
+ document.addVatDetail(decodeVatDetail(vat));
+ }
+ }
+
+ return null;
+ }
+
+
+ private IVatDetail decodeVatDetail(VatDetailType asnVat) {
+
+ IVatDetail vat = factory.createVatDetail();
+
+ vat.setAmount(asnVat.getAmount());
+ if (asnVat.getPercentage() != null){
+ vat.setPercentage(asnVat.getPercentage().intValue());
+ }
+ if (asnVat.getCountry() != null) {
+ vat.setCountry(asnVat.getCountry().intValue());
+ }
+ vat.setVatId(asnVat.getVatId());
+ return vat;
+ }
+
+
+
+
+
+
+
+ /**
+ * Convert compartment details.
+ *
+ * @param asnDetails the asn details
+ * @return the i compartment details
+ */
+ protected ICompartmentDetails convertCompartmentDetails(CompartmentDetailsType asnDetails) {
+
+ if (asnDetails == null) return null;
+
+ ICompartmentDetails details = factory.createCompartmentDetails();
+
+ if (asnDetails.getCompartmentType()!=null) {
+ details.setCompartmentType(asnDetails.getCompartmentType().intValue());
+ }
+
+ if (asnDetails.getCoachType()!=null){
+ details.setCoachType(asnDetails.getCoachType().intValue());
+ }
+
+ if (asnDetails.getSpecialAllocation()!=null) {
+ details.setSpecialAllocation(asnDetails.getSpecialAllocation().intValue());
+ }
+
+ details.setCoachTypeDescr(asnDetails.getCoachTypeDescr());
+ details.setCompartmentTypeDescr(asnDetails.getCompartmentTypeDescr());
+ details.setSpecialAllocationDescr(asnDetails.getSpecialAllocationDescr());
+
+ details.setPosition(ICompartmentPositionType.valueOf(asnDetails.getPosition().name()));
+
+ return details;
+ }
+
+ /**
+ * Convert places.
+ *
+ * @param asnPlaces the asn places
+ * @return the i places
+ */
+ protected IPlaces convertPlaces(PlacesType asnPlaces) {
+
+ if (asnPlaces == null) return null;
+
+ IPlaces places = factory.createPlaces();
+
+ places.setCoach(asnPlaces.getCoach());
+ places.setPlaceDescription(asnPlaces.getPlaceDescription());
+
+ if (asnPlaces.getPlaceNum()!=null && !asnPlaces.getPlaceNum().isEmpty()){
+ for (Long place: asnPlaces.getPlaceNum()){
+ places.addPlace(place.toString());
+ }
+ }
+
+ if (asnPlaces.getPlaceIA5()!=null && !asnPlaces.getPlaceIA5().isEmpty()){
+ for (String place: asnPlaces.getPlaceIA5()){
+ places.addPlace(place);
+ }
+ }
+
+ places.setPlaceString(asnPlaces.getPlaceString());
+
+ return places;
+ }
+
+ /**
+ * Convert berth.
+ *
+ * @param asnBerth the asn berth
+ * @return the i berth
+ */
+ protected IBerth convertBerth(BerthDetailData asnBerth) {
+
+ if (asnBerth == null) return null;
+
+ IBerth berth = factory.createBerth();
+ if (asnBerth.getGender()!= null) {
+ berth.setGender(ICompartmentGenderType.valueOf(asnBerth.getGender().name()));
+ }
+ if (asnBerth.getNumberOfBerths()!=null) {
+ berth.setNumberOfBerths(asnBerth.getNumberOfBerths().intValue());
+ }
+ if (asnBerth.getBerthType()!=null){
+ berth.setType(IBerthTypeType.valueOf(asnBerth.getBerthType().name()));
+ }
+
+ return berth;
+ }
+
+ /**
+ * Convert countermark.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i counter mark
+ */
+ protected ICounterMark convertCountermark(CountermarkData asnDocument , Date issuingDate) {
+
+ ICounterMark document = factory.createCounterMark();
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+ if (asnDocument.getValidUntilUTCOffset() != null) {
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+ } else {
+ document.setValidUntilUTCoffset(asnDocument.getValidFromUTCOffset());
+ }
+
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+ document.setTicketReference(UicEncoderUtils.mapToString(asnDocument.getTicketReferenceNum(),asnDocument.getTicketReferenceIA5()));
+
+ document.setFromStation(UicEncoderUtils.mapToString(asnDocument.getFromStationNum(),asnDocument.getFromStationIA5()));
+ document.setToStation(UicEncoderUtils.mapToString(asnDocument.getToStationNum(),asnDocument.getToStationIA5()));
+
+ document.setFromStationName(asnDocument.getFromStationNameUTF8());
+ document.setToStationName(asnDocument.getToStationNameUTF8());
+ document.setValidRegionDesc(asnDocument.getValidRegionDesc());
+
+ if (asnDocument.getValidRegion()!= null && !asnDocument.getValidRegion().isEmpty()) {
+ for (RegionalValidityType validRegion :asnDocument.getValidRegion()){
+ document.addValidRegionList(convertValidRegion(validRegion, issuingDate));
+ }
+ }
+
+ document.setReturnDescription(convertReturnDescription(asnDocument.getReturnDescription(), issuingDate));
+
+
+ if(asnDocument.getReturnIncluded()!=null){
+ document.setReturnIncluded(asnDocument.getReturnIncluded());
+ } else {
+ document.setReturnIncluded(false);
+ }
+
+
+
+ document.setGroupName(asnDocument.getGroupName());
+
+ if (asnDocument.getNumberOfCountermark() != null) {
+ document.setNumberOfCountermark(asnDocument.getNumberOfCountermark().intValue());
+ }
+
+ if (asnDocument.getTotalOfCountermarks() != null) {
+ document.setTotalOfCountermarks(asnDocument.getTotalOfCountermarks().intValue());
+ }
+
+ return document;
+
+ }
+
+ /**
+ * Convert return description.
+ *
+ * @param asnReturnRoute the asn return route
+ * @param issuingDate the issuing date
+ * @return the i return route description
+ */
+ protected IReturnRouteDescription convertReturnDescription(ReturnRouteDescriptionType asnReturnRoute, Date issuingDate) {
+
+ if (asnReturnRoute == null) return null;
+
+ IReturnRouteDescription route = factory.createReturnRouteDescription();
+
+ route.setFromStation(UicEncoderUtils.mapToString(asnReturnRoute.getFromStationNum(),asnReturnRoute.getFromStationIA5()));
+ route.setToStation(UicEncoderUtils.mapToString(asnReturnRoute.getToStationNum(),asnReturnRoute.getToStationIA5()));
+
+ route.setFromStationName(asnReturnRoute.getFromStationNameUTF8());
+ route.setToStationName(asnReturnRoute.getToStationNameUTF8());
+ route.setValidRegionDesc(asnReturnRoute.getValidReturnRegionDesc());
+
+ if (asnReturnRoute.getValidReturnRegion()!= null && !asnReturnRoute.getValidReturnRegion().isEmpty()) {
+ for (RegionalValidityType validRegion :asnReturnRoute.getValidReturnRegion()){
+ route.addValidRegionList(convertValidRegion(validRegion, issuingDate));
+ }
+ }
+
+ return route;
+ }
+
+ /**
+ * Convert luggage restriction.
+ *
+ * @param asnLuggage the asn luggage
+ * @return the i luggage restriction
+ */
+ protected ILuggageRestriction convertLuggageRestriction(LuggageRestrictionType asnLuggage) {
+
+ if (asnLuggage == null) return null;
+
+ ILuggageRestriction luggage = factory.createLuggageRestriction();
+ if (asnLuggage.getMaxHandLuggagePieces()!=null){
+ luggage.setMaxHandLuggagePieces(asnLuggage.getMaxHandLuggagePieces().intValue());
+ }
+ if (asnLuggage.getMaxNonHandLuggagePieces()!=null){
+ luggage.setMaxNonHandLuggagePieces(asnLuggage.getMaxNonHandLuggagePieces().intValue());
+ }
+
+
+ if (asnLuggage.getRegisteredLuggage()!= null &&!asnLuggage.getRegisteredLuggage().isEmpty()){
+ for (RegisteredLuggageType rl: asnLuggage.getRegisteredLuggage()){
+ luggage.addRegisteredLuggage(convertRegisteredLuggage(rl));
+ }
+ }
+ return luggage;
+ }
+
+ /**
+ * Convert registered luggage.
+ *
+ * @param rl the rl
+ * @return the i registered luggage
+ */
+ protected IRegisteredLuggage convertRegisteredLuggage(RegisteredLuggageType rl) {
+
+ if (rl == null) return null;
+
+ IRegisteredLuggage luggage= factory.createRegisteredLuggage();
+ if (rl.getMaxSize()!=null){
+ if (rl.getMaxSize()!=null) {
+ luggage.setMaxSize(rl.getMaxSize().intValue());
+ }
+ }
+ if (rl.getMaxWeight()!=null){
+ if(rl.getMaxWeight()!=null){
+ luggage.setMaxWeight(rl.getMaxWeight().intValue());
+ }
+ }
+ luggage.setRegistrationId(rl.getRegistrationId());
+ return luggage;
+ }
+
+
+ /**
+ * Convert open ticket.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i open ticket
+ */
+ protected IOpenTicket convertOpenTicket(OpenTicketData asnDocument , Date issuingDate) {
+
+ IOpenTicket document = factory.createOpenTicket();
+
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+ if (asnDocument.getValidUntilUTCOffset() != null) {
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+ } else {
+ document.setValidUntilUTCoffset(asnDocument.getValidFromUTCOffset());
+ }
+
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ if (asnDocument.getExcludedServiceBrands()!=null && !asnDocument.getExcludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getExcludedServiceBrands()){
+ document.addExcludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getCarriersNum()!=null && !asnDocument.getCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getCarriersNum()){
+ document.addIncludedCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getCarriersIA5()!=null && !asnDocument.getCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getCarriersIA5()){
+ document.addIncludedCarrier(carrier);
+ }
+ }
+
+
+ if (asnDocument.getIncludedServiceBrands()!=null && !asnDocument.getIncludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getIncludedServiceBrands()){
+ document.addIncludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getIncludedTransportTypes()!=null && !asnDocument.getIncludedTransportTypes().isEmpty()){
+ for(Long number :asnDocument.getIncludedTransportTypes()){
+ document.addInludedTransportType(number.intValue());
+ }
+ }
+
+ if (asnDocument.getExcludedTransportTypes()!=null && !asnDocument.getExcludedTransportTypes().isEmpty()){
+ for(Long number :asnDocument.getExcludedTransportTypes()){
+ document.addExcludedTransportType(number.intValue());
+ }
+ }
+
+
+
+ if (asnDocument.getTariffs()!=null && !asnDocument.getTariffs().isEmpty()){
+ for(TariffType asnTariff :asnDocument.getTariffs()){
+ document.addTariff(convertTariff(asnTariff));
+ }
+ }
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ document.setFromStation(UicEncoderUtils.mapToString(asnDocument.getFromStationNum(),asnDocument.getFromStationIA5()));
+ document.setToStation(UicEncoderUtils.mapToString(asnDocument.getToStationNum(),asnDocument.getToStationIA5()));
+ document.setFromStationName(asnDocument.getFromStationNameUTF8());
+ document.setToStationName(asnDocument.getToStationNameUTF8());
+ document.setValidRegionDesc(asnDocument.getValidRegionDesc());
+ if (asnDocument.getValidRegion()!= null && !asnDocument.getValidRegion().isEmpty()) {
+ for (RegionalValidityType validRegion :asnDocument.getValidRegion()){
+ document.addValidRegionList(convertValidRegion(validRegion, issuingDate));
+ }
+ }
+
+ if (asnDocument.getIssuerAutorizationId() != null) {
+ document.setAuthorizationCode(asnDocument.getIssuerAutorizationId().intValue());
+ }
+
+ if (asnDocument.getExtIssuerId() != null) {
+ document.setExternalIssuer(asnDocument.getExtIssuerId().intValue());
+ }
+
+ document.setLuggageRestriction(convertLuggageRestriction(asnDocument.getLuggage()));
+
+ document.setReturnDescription(convertReturnDescription(asnDocument.getReturnDescription(), issuingDate));
+ if(asnDocument.getReturnIncluded()!=null){
+ document.setReturnIncluded(asnDocument.getReturnIncluded());
+ }
+
+ if (asnDocument.getActivatedDay()!=null && !asnDocument.getActivatedDay().isEmpty()) {
+ document.getActivatedDays().addAll(asnDocument.getActivatedDays(issuingDate));
+ }
+
+ if (asnDocument.getIncludedAddOns()!= null && !asnDocument.getIncludedAddOns().isEmpty()) {
+
+ for (IncludedOpenTicketType asnAddOn :asnDocument.getIncludedAddOns()) {
+
+ IIncludedOpenTicket addOn = convertIncludedOpenTicket(asnAddOn, issuingDate, document.getClassCode());
+ if (addOn != null) {
+ document.addIncludedAddOn(addOn);
+ }
+ }
+
+
+
+ }
+
+ document.setPrice(asnDocument.getPrice());
+
+ if (asnDocument.getVatDetails() != null && !asnDocument.getVatDetails().isEmpty()){
+ for (VatDetailType vat : asnDocument.getVatDetails()) {
+ document.addVatDetail(decodeVatDetail(vat));
+ }
+ }
+
+ return document;
+
+ }
+
+
+
+ /**
+ * Convert included open ticket.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @param classCode the class code
+ * @return the simple included open ticket
+ */
+ private IIncludedOpenTicket convertIncludedOpenTicket( IncludedOpenTicketType asnDocument, Date issuingDate, ITravelClassType classCode) {
+
+ IIncludedOpenTicket document = factory.createIncludedOpenTicket();
+
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ } else {
+ document.setClassCode(classCode);
+ }
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+ if (asnDocument.getValidUntilUTCOffset() != null) {
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+ } else {
+ document.setValidUntilUTCoffset(asnDocument.getValidFromUTCOffset());
+ }
+
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ if (asnDocument.getExcludedServiceBrands()!=null && !asnDocument.getExcludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getExcludedServiceBrands()){
+ document.addExcludedServiceBrand(number.intValue());
+ }
+ }
+ if (asnDocument.getIncludedCarriersNum()!=null && !asnDocument.getIncludedCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getIncludedCarriersNum()){
+ document.addIncludedCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getIncludedCarriersIA5()!=null && !asnDocument.getIncludedCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getIncludedCarriersIA5()){
+ document.addIncludedCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getIncludedServiceBrands()!=null && !asnDocument.getIncludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getIncludedServiceBrands()){
+ document.addIncludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getIncludedTransportTypes()!=null && !asnDocument.getIncludedTransportTypes().isEmpty()){
+ for(Long number :asnDocument.getIncludedTransportTypes()){
+ document.addInludedTransportType(number.intValue());
+ }
+ }
+
+ if (asnDocument.getExcludedTransportTypes()!=null && !asnDocument.getExcludedTransportTypes().isEmpty()){
+ for(Long number :asnDocument.getExcludedTransportTypes()){
+ document.addExcludedTransportType(number.intValue());
+ }
+ }
+
+ if (asnDocument.getTariffs()!=null && !asnDocument.getTariffs().isEmpty()){
+ for(TariffType asnTariff :asnDocument.getTariffs()){
+ document.addTariff(convertTariff(asnTariff));
+ }
+ }
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+
+ if (asnDocument.getValidRegion()!= null && !asnDocument.getValidRegion().isEmpty()) {
+ for (RegionalValidityType validRegion :asnDocument.getValidRegion()){
+ document.addValidRegionList(convertValidRegion(validRegion, issuingDate));
+ }
+ }
+
+ if (asnDocument.getIssuerAutorizationId()!=null){
+ document.setAuthorizationCode(asnDocument.getIssuerAutorizationId().intValue());
+ }
+ if (asnDocument.getExternalIssuerId()!=null){
+ document.setExternalIssuer(asnDocument.getExternalIssuerId().intValue());
+ }
+ return document;
+ }
+
+
+
+
+
+
+
+ /**
+ * Convert station passage.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i station passage
+ */
+ protected IStationPassage convertStationPassage(StationPassageData asnDocument , Date issuingDate) {
+
+ IStationPassage document = factory.createStationPassage();
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+ if (asnDocument.getValidUntilUTCOffset() != null) {
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+ } else {
+ document.setValidUntilUTCoffset(asnDocument.getValidFromUTCOffset());
+ }
+
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ if (asnDocument.getNumberOfDaysValid()!=null) {
+ document.setNumberOfdaysAllowed(asnDocument.getNumberOfDaysValid().intValue());
+ }
+
+ if (asnDocument.getStationNum()!=null && !asnDocument.getStationNum().isEmpty()){
+ for (Long station : asnDocument.getStationNum()) {
+ if (station != null) {
+ document.addStation(station.toString());
+ }
+ }
+ }
+ if (asnDocument.getStationIA5()!=null && !asnDocument.getStationIA5().isEmpty()){
+ for (String station : asnDocument.getStationIA5()) {
+ document.addStation(station);
+ }
+ }
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ document.setProductName(asnDocument.getProductName());
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+ if (asnDocument.getStationNameUTF8()!= null && asnDocument.getStationNameUTF8().isEmpty() ) {
+ for (String name : asnDocument.getStationNameUTF8()) {
+ document.addStation(name);
+ }
+ }
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+
+ if (asnDocument.getAreaCodeIA5() != null && !asnDocument.getAreaCodeIA5().isEmpty()) {
+ for (String code : asnDocument.getAreaCodeIA5()) {
+ document.addAreaCode(code);
+ }
+ }
+ if (asnDocument.getAreaCodeNum() != null && !asnDocument.getAreaCodeNum().isEmpty()) {
+ for (Long code : asnDocument.getAreaCodeNum()) {
+ if (code != null) {
+ document.addAreaCode(code.toString());
+ }
+ }
+ }
+
+ if (asnDocument.getAreaNameUTF8() != null && !asnDocument.getAreaNameUTF8().isEmpty()) {
+ for (String code : asnDocument.getAreaNameUTF8()) {
+ document.addAreaName(code);
+ }
+ }
+
+
+
+ return document;
+ }
+
+
+ /**
+ * Convert valid region.
+ *
+ * @param asnRegion the asn region
+ * @param issuingDate the issuing date
+ * @return the i regional validity
+ */
+ protected IRegionalValidity convertValidRegion(RegionalValidityType asnRegion, Date issuingDate) {
+
+ if (asnRegion == null) return null;
+
+ if (asnRegion.getLines()!=null){
+ return convertLine(asnRegion.getLines());
+ }
+ if (asnRegion.getPolygone()!=null){
+ return convertPolygone(asnRegion.getPolygone());
+ }
+ if (asnRegion.getTrainLink()!=null){
+ return convertTrainLink(asnRegion.getTrainLink(),issuingDate);
+ }
+ if (asnRegion.getViaStations()!=null){
+ return convertViaStation(asnRegion.getViaStations());
+ }
+ if (asnRegion.getZones()!=null){
+ return convertZone(asnRegion.getZones());
+ }
+ return null;
+ }
+
+
+ /**
+ * Convert parking ground.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i parking ground
+ */
+ protected IParkingGround convertParkingGround(ParkingGroundData asnDocument , Date issuingDate) {
+
+ IParkingGround document = factory.createParkingGround();
+
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+
+
+ document.setAccessCode(asnDocument.getAccessCode());
+ document.setLocation(asnDocument.getLocation());
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+
+ document.setNumberPlate(asnDocument.getNumberPlate());
+ document.setEntryTrack(asnDocument.getEntryTrack());
+
+
+ document.setFromParkingDate(asnDocument.getFromParkingDate(issuingDate));
+ document.setToParkingDate(asnDocument.getToParkingDate(issuingDate));
+
+ document.setParkingGroundId(asnDocument.getParkingGroundId());
+
+ document.setSpecialInformation(asnDocument.getSpecialInformation());
+
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+
+ document.setStation(UicEncoderUtils.mapToString(asnDocument.getStationNum(),asnDocument.getStationIA5()));
+
+ document.setPrice(asnDocument.getPrice());
+
+ if (asnDocument.getVatDetails() != null && !asnDocument.getVatDetails().isEmpty()){
+ for (VatDetailType vat : asnDocument.getVatDetails()) {
+ document.addVatDetail(decodeVatDetail(vat));
+ }
+ }
+
+ return document;
+ }
+
+ /**
+ * Convert via station.
+ *
+ * @param asnDocument the asn via
+ * @return the i via station
+ */
+ protected IViaStation convertViaStation(ViaStationType asnDocument) {
+
+ if (asnDocument == null) return null;
+
+ IViaStation via = factory.createViaStation();
+
+ if (asnDocument.getBorder()!=null) {
+ via.setBorder(asnDocument.getBorder());
+ }
+
+ if (asnDocument.getRouteId() != null) {
+ via.setRouteId(asnDocument.getRouteId().intValue());
+ }
+
+ if (asnDocument.getStationCodeTable()!=null){
+ via.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+
+ if (asnDocument.getStationNum() != null) {
+ via.setStation(asnDocument.getStationNum().toString());
+ } else if (asnDocument.getStationIA5() != null) {
+ via.setStation(asnDocument.getStationIA5());
+ }
+
+ if (asnDocument.getCarriersNum()!=null && !asnDocument.getCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getCarriersNum()){
+ via.addCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getCarriersIA5()!=null && !asnDocument.getCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getCarriersIA5()){
+ via.addCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getExcludedServiceBrands()!=null && !asnDocument.getExcludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getExcludedServiceBrands()){
+ via.addExcludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getIncludedServiceBrands()!=null && !asnDocument.getIncludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getIncludedServiceBrands()){
+ via.addIncludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getRoute()!= null && !asnDocument.getRoute().isEmpty()) {
+ for ( ViaStationType routeVia: asnDocument.getRoute()) {
+ via.addRouteStation(convertViaStation(routeVia));
+ }
+ }
+ if (asnDocument.getAlternativeRoutes()!= null && !asnDocument.getAlternativeRoutes().isEmpty()) {
+ for ( ViaStationType routeVia: asnDocument.getAlternativeRoutes()) {
+ via.addRouteStation(convertViaStation(routeVia));
+ }
+ }
+
+
+ return via;
+ }
+
+ /**
+ * Convert train link.
+ *
+ * @param asnTrainLink the asn train link
+ * @param issuingDate the issuing date
+ * @return the i regional validity
+ */
+ protected IRegionalValidity convertTrainLink(TrainLinkType asnTrainLink, Date issuingDate) {
+
+ ITrainLink trainLink = factory.createTrainLink();
+
+ trainLink.setTrain(UicEncoderUtils.mapToString(asnTrainLink.getTrainNum(), asnTrainLink.getTrainIA5()));
+
+ trainLink.setFromStation(UicEncoderUtils.mapToString(asnTrainLink.getFromStationNum(),asnTrainLink.getFromStationIA5()));
+ trainLink.setToStation(UicEncoderUtils.mapToString(asnTrainLink.getToStationNum(),asnTrainLink.getToStationIA5()));
+ trainLink.setFromStationName(asnTrainLink.getFromStationName());
+ trainLink.setToStationName(asnTrainLink.getToStationName());
+
+ trainLink.setDepartureDateTime(asnTrainLink.getDepartureDate(issuingDate));
+
+ return trainLink;
+ }
+
+ /**
+ * Convert zone.
+ *
+ * @param asnDocument the asn zone
+ * @return the i regional validity
+ */
+ protected IRegionalValidity convertZone(ZoneType asnDocument) {
+
+ if (asnDocument == null) return null;
+
+ IZone zone = factory.createZone();
+
+ zone.setBinaryZoneId(asnDocument.getBinaryZoneId());
+ zone.setCarrier(UicEncoderUtils.mapToString(asnDocument.getCarrierNum(),asnDocument.getCarrierIA5()));
+
+ if (asnDocument.getCity() != null) {
+ zone.setCity(asnDocument.getCity().intValue());
+ }
+ if (asnDocument.getStationCodeTable()!=null){
+ zone.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ zone.setEntryStation(UicEncoderUtils.mapToString(asnDocument.getEntryStationNum(),asnDocument.getEntryStationIA5()));
+ zone.setTerminatingStation(UicEncoderUtils.mapToString(asnDocument.getTerminatingStationNum(),asnDocument.getTerminatingStationIA5()));
+
+ zone.setNUTScode(asnDocument.getNutsCode());
+
+ return zone;
+ }
+
+ /**
+ * Convert polygone.
+ *
+ * @param asnPolygone the asn polygone
+ * @return the i regional validity
+ */
+ protected IRegionalValidity convertPolygone(PolygoneType asnPolygone) {
+
+ if (asnPolygone == null) return null;
+
+ IPolygone polygone = factory.createPolygone();
+
+ IGeoCoordinate firstEdge = convertGeoCoordinate(asnPolygone.getFirstEdge());
+
+ if (firstEdge == null) return null;
+
+ if (asnPolygone.getEdges()!=null && !asnPolygone.getEdges().isEmpty()) {
+ for (DeltaCoordinates asnEdge :asnPolygone.getEdges()){
+
+ IGeoCoordinate edge = firstEdge.clone();
+ try {
+ edge.addLongitude(asnEdge.getLongitude().longValue());
+ edge.addLatitude(asnEdge.getLatitude().longValue());
+ } catch (Exception e) {
+
+ }
+ polygone.addEdge(edge);
+ }
+ }
+ return polygone;
+ }
+
+ /**
+ * Convert line.
+ *
+ * @param asnDocument the asn line
+ * @return the i regional validity
+ */
+ protected IRegionalValidity convertLine(LineType asnDocument) {
+
+ if (asnDocument == null) return null;
+
+ ILine line = factory.createLine();
+
+ line.setBinaryZoneId(asnDocument.getBinaryZoneId());
+ line.setCarrier(UicEncoderUtils.mapToString(asnDocument.getCarrierNum(),asnDocument.getCarrierIA5()));
+ if (asnDocument.getCity()!=null) {
+ line.setCity(asnDocument.getCity().intValue());
+ }
+ if (asnDocument.getStationCodeTable()!=null){
+ line.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ line.setEntryStation(UicEncoderUtils.mapToString(asnDocument.getEntryStationNum(),asnDocument.getEntryStationIA5()));
+ line.setTerminatingStation(UicEncoderUtils.mapToString(asnDocument.getTerminatingStationNum(),asnDocument.getTerminatingStationIA5()));
+ if (asnDocument.getLineId()!=null && !asnDocument.getLineId().isEmpty()){
+ for (Long lineId : asnDocument.getLineId()) {
+ line.addLineId(lineId.intValue());
+ }
+ }
+ return line;
+ }
+
+ /**
+ * Convert tariff.
+ *
+ * @param asnTariff the asn tariff
+ * @return the i tariff
+ */
+ protected ITariff convertTariff(TariffType asnTariff) {
+
+ if (asnTariff== null) return null;
+
+ ITariff tariff = factory.createTariff();
+
+ if (asnTariff.getAgeAbove() != null) {
+ tariff.setAgeAbove(asnTariff.getAgeAbove().intValue());
+ }
+
+ if (asnTariff.getAgeBelow() != null) {
+ tariff.setAgeBelow(asnTariff.getAgeBelow().intValue());
+ }
+
+ if(asnTariff.getNumberOfPassengers()!=null){
+ tariff.setNumberOfPassengers(asnTariff.getNumberOfPassengers().intValue());
+ }
+
+ if (asnTariff.getSeriesDataDetails() != null) {
+ tariff.setSeriesDataDetails(convertSeriesDataDetails(asnTariff.getSeriesDataDetails()));
+ }
+
+
+ if (asnTariff.getPassengerType()!=null) {
+ tariff.setPassengerType(IPassengerType.valueOf(asnTariff.getPassengerType().name()));
+ }
+
+
+ if(asnTariff.getRestrictedToCountryOfResidence()!=null){
+ tariff.setRestrictedToCountryOfResidence(asnTariff.getRestrictedToCountryOfResidence());
+ }
+ if (asnTariff.getRestrictedToRouteSection()!=null){
+ tariff.setRestrictedToRouteSection(convertRouteSection(asnTariff.getRestrictedToRouteSection()));
+ }
+
+
+ tariff.setTariffDescription(asnTariff.getTariffDesc());
+ tariff.setTariffId(UicEncoderUtils.mapToString(asnTariff.getTariffIdNum(),asnTariff.getTariffIdIA5()));
+
+ if (asnTariff.getTraverlerid()!= null && !asnTariff.getTraverlerid().isEmpty() ) {
+ for (Long number : asnTariff.getTraverlerid()){
+ tariff.addTravelerId(number.intValue());
+ }
+ }
+
+ if (asnTariff.getReductionCard()!=null && !asnTariff.getReductionCard().isEmpty()){
+ for(CardReferenceType card : asnTariff.getReductionCard()){
+ tariff.addReductionCard(convertCardReference(card));
+ }
+ }
+
+ return tariff;
+ }
+
+ private ISeriesDataDetails convertSeriesDataDetails(SeriesDetailType asnDetails) {
+
+ if (asnDetails == null) return null;
+
+ ISeriesDataDetails details = factory.createSeriesDataDetails();
+
+ if (asnDetails.getSeries() != null) {
+ details.setSeries(asnDetails.getSeries().intValue());
+ }
+
+ if (asnDetails.getSupplyingCarrier() != null) {
+ details.setSupplyingCarrier(asnDetails.getSupplyingCarrier().intValue());
+ }
+
+ if (asnDetails.getOfferIdentification() != null) {
+ details.setOfferIdentification(asnDetails.getOfferIdentification().intValue());
+ }
+
+ return details;
+ }
+
+
+
+
+
+
+
+ /**
+ * Convert route section.
+ *
+ * @param asnDocument the asn document
+ * @return the i route section
+ */
+ protected IRouteSection convertRouteSection(RouteSectionType asnDocument) {
+
+ if (asnDocument == null) return null;
+
+ IRouteSection document = factory.createRouteSection();
+ if (asnDocument.getStationCodeTable()!=null){
+ document.setStationCodeTable(IStationCodeTable.valueOf(asnDocument.getStationCodeTable().name()));
+ }
+ document.setFromStation(UicEncoderUtils.mapToString(asnDocument.getFromStationNum(),asnDocument.getFromStationIA5()));
+ document.setToStation(UicEncoderUtils.mapToString(asnDocument.getToStationNum(),asnDocument.getToStationIA5()));
+ document.setFromStationName(asnDocument.getFromStationNameUTF8());
+ document.setToStationName(asnDocument.getToStationNameUTF8());
+ return document;
+ }
+
+ /**
+ * Convert fip ticket.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i fip ticket
+ */
+ protected IFipTicket convertFipTicket(FIPTicketData asnDocument , Date issuingDate) {
+
+ if (asnDocument == null) return null;
+
+ IFipTicket document = factory.createFipTicket();
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+
+
+
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ if (asnDocument.getActivatedDay() != null && !asnDocument.getActivatedDay().isEmpty()) {
+ document.getActivatedDays().addAll(asnDocument.getActivatedDays(issuingDate));
+ }
+
+ if(asnDocument.getIncludesSupplements()!=null) {
+ document.setIncludesSupplements(asnDocument.getIncludesSupplements());
+ }
+ if(asnDocument.getNumberOfTravelDays()!=null){
+ document.setNumberOfTravelDates(asnDocument.getNumberOfTravelDays().intValue());
+ }
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+
+ return document;
+ }
+
+ /**
+ * Convert pass.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i pass
+ */
+ protected IPass convertPass(PassData asnDocument, Date issuingDate) {
+
+ if (asnDocument == null) return null;
+
+ IPass document = factory.createPass();
+
+ if(asnDocument.getClassCode()!=null){
+ document.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+
+ document.setValidFrom(asnDocument.getValidFromDate(issuingDate));
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+
+ document.setValidUntil(asnDocument.getValidUntilDate(issuingDate));
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+
+ if (asnDocument.getActivatedDay() != null && !asnDocument.getActivatedDay().isEmpty()) {
+ document.getActivatedDays().addAll(asnDocument.getActivatedDays(issuingDate));
+ }
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+ document.setInfoText(asnDocument.getInfoText());
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ if (asnDocument.getNumberOfDaysOfTravel() != null) {
+ document.setNumberOfDaysOfTravel(asnDocument.getNumberOfDaysOfTravel().intValue());
+ }
+ if (asnDocument.getNumberOfPossibleTrips() != null) {
+ document.setNumberOfPossibleTrips(asnDocument.getNumberOfPossibleTrips().intValue());
+ }
+
+ document.setPassDescription(asnDocument.getPassDescription());
+ if(asnDocument.getPassType()!=null){
+ document.setPassType(asnDocument.getPassType().intValue());
+ }
+
+
+
+ if (asnDocument.getCountries()!=null && !asnDocument.getCountries().isEmpty()){
+ for(Long number :asnDocument.getCountries()){
+ document.addCountry(number.intValue());
+ }
+ }
+
+ if (asnDocument.getExcludedServiceBrands()!=null && !asnDocument.getExcludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getExcludedServiceBrands()){
+ document.addExcludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getIncludedCarriersNum()!=null && !asnDocument.getIncludedCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getIncludedCarriersNum()){
+ document.addIncludedCarrier(carrier.toString());
+ }
+ }
+
+ if (asnDocument.getIncludedCarriersIA5()!=null && !asnDocument.getIncludedCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getIncludedCarriersIA5()){
+ document.addIncludedCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getExcludedCarriersNum()!=null && !asnDocument.getExcludedCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getExcludedCarriersNum()){
+ document.addExcludedCarrier(carrier.toString());
+ }
+ }
+ if (asnDocument.getExcludedCarriersIA5()!=null && !asnDocument.getExcludedCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getExcludedCarriersIA5()){
+ document.addExcludedCarrier(carrier);
+ }
+ }
+
+
+ if (asnDocument.getIncludedServiceBrands()!=null && !asnDocument.getIncludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getIncludedServiceBrands()){
+ document.addIncludedServiceBrand(number.intValue());
+ }
+ }
+
+ if (asnDocument.getTariffs()!=null && !asnDocument.getTariffs().isEmpty()){
+ for(TariffType asnTariff :asnDocument.getTariffs()){
+ document.addTariff(convertTariff(asnTariff));
+ }
+ }
+
+ if (asnDocument.getValidRegion()!=null && !asnDocument.getValidRegion().isEmpty()){
+ for(RegionalValidityType asnRegion :asnDocument.getValidRegion()){
+ document.addValidRegion(convertValidRegion(asnRegion, issuingDate));
+ }
+ }
+
+
+ if (asnDocument.getValidityPeriodDetails() != null) {
+ document.setValidityDetails(convertValidityDetails(asnDocument.getValidityPeriodDetails(), issuingDate));
+ }
+
+ document.setPrice(asnDocument.getPrice());
+
+ if (asnDocument.getVatDetails() != null && !asnDocument.getVatDetails().isEmpty()){
+ for (VatDetailType vat : asnDocument.getVatDetails()) {
+ document.addVatDetail(decodeVatDetail(vat));
+ }
+ }
+
+ if (asnDocument.getTrainValidity() != null) {
+ document.setTrainValidity(convert(asnDocument.getTrainValidity(), issuingDate));
+ }
+
+ return document;
+ }
+
+ private ITrainValidity convert(TrainValidityType asnDocument, Date issuingDate) {
+
+ if (asnDocument == null) return null;
+
+ ITrainValidity document = factory.createTrainValidity();
+
+ document.setFromDate(asnDocument.getValidFromDate(issuingDate));
+ document.setValidFromUTCoffset(asnDocument.getValidFromUTCOffset());
+
+ document.setUntilDate(asnDocument.getValidUntilDate(issuingDate));
+ document.setValidUntilUTCoffset(asnDocument.getValidUntilUTCOffset());
+
+ if (asnDocument.getBordingOrArrival()!=null){
+ document.setBoardingOrArrival(IBoardingOrArrivalType.valueOf(asnDocument.getBordingOrArrival().name()));
+ }
+
+ if (asnDocument.getExcludedServiceBrands()!=null && !asnDocument.getExcludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getExcludedServiceBrands()){
+ document.addExcludedServiceBrand(number.intValue());
+ }
+ }
+ if (asnDocument.getIncludedCarriersNum()!=null && !asnDocument.getIncludedCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getIncludedCarriersNum()){
+ document.addIncludedCarrier(carrier.toString());
+ }
+ }
+
+ if (asnDocument.getIncludedCarriersIA5()!=null && !asnDocument.getIncludedCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getIncludedCarriersIA5()){
+ document.addIncludedCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getExcludedCarriersNum()!=null && !asnDocument.getExcludedCarriersNum().isEmpty()){
+ for(Long carrier :asnDocument.getExcludedCarriersNum()){
+ document.addExcludedCarrier(carrier.toString());
+ }
+ }
+
+ if (asnDocument.getExcludedCarriersIA5()!=null && !asnDocument.getExcludedCarriersIA5().isEmpty()){
+ for(String carrier :asnDocument.getExcludedCarriersIA5()){
+ document.addExcludedCarrier(carrier);
+ }
+ }
+
+ if (asnDocument.getIncludedServiceBrands()!=null && !asnDocument.getIncludedServiceBrands().isEmpty()){
+ for(Long number :asnDocument.getIncludedServiceBrands()){
+ document.addIncludedServiceBrand(number.intValue());
+ }
+ }
+
+ return document;
+ }
+
+ private IValidityDetails convertValidityDetails(ValidityPeriodDetailType asnDetails, Date issuingDate) {
+
+ if (asnDetails == null) return null;
+
+ IValidityDetails details = factory.createValidityDetails();
+
+ if (asnDetails.getExcludedTimeRange()!= null && !asnDetails.getExcludedTimeRange().isEmpty()) {
+
+ ITimeRange range = factory.createTimeRange();
+
+ for (TimeRangeType asnRange : asnDetails.getExcludedTimeRange() ) {
+
+ if (asnRange.getFromTime() != null) {
+ range.setFromTime(asnRange.getFromTime().intValue());
+ }
+ if (asnRange.getUntilTime() != null) {
+ range.setUntilTime(asnRange.getUntilTime().intValue());
+ }
+
+ details.addTimeRanges(range);
+ }
+
+
+
+ }
+
+ if (asnDetails.getValidityPeriod()!= null && !asnDetails.getValidityPeriod().isEmpty()) {
+
+ IValidityRange range = factory.createValidityRange();
+
+ for (ValidityPeriodType asnRange : asnDetails.getValidityPeriod() ) {
+
+ range.setFromDate(asnRange.getValidFromDate(issuingDate));
+ range.setUntilDate(asnRange.getValidUntilDate(issuingDate));
+
+ range.setValidFromUTCoffset(asnRange.getValidFromUTCOffset());
+ if (asnRange.getValidUntilUTCOffset() != null) {
+ range.setValidUntilUTCoffset(asnRange.getValidUntilUTCOffset());
+ } else {
+ range.setValidUntilUTCoffset(asnRange.getValidFromUTCOffset());
+ }
+
+ details.addValidityRanges(range);
+ }
+
+ }
+
+ return details;
+ }
+
+
+
+
+
+
+
+ /**
+ * Convert voucher.
+ *
+ * @param asnDocument the asn document
+ * @param issuingDate the issuing date
+ * @return the i voucher
+ */
+ protected IVoucher convertVoucher(VoucherData asnDocument , Date issuingDate) {
+
+ if (asnDocument == null) return null;
+
+ IVoucher document = factory.createVoucher();
+
+ document.setValidFrom(asnDocument.getValidFrom());
+
+ document.setValidUntil(asnDocument.getValidUntil());
+
+ document.setInfoText(asnDocument.getInfoText());
+ document.setProductId(UicEncoderUtils.mapToString(asnDocument.getProductIdNum(),asnDocument.getProductIdIA5()));
+ document.setProductOwner(UicEncoderUtils.mapToString(asnDocument.getProductOwnerNum(),asnDocument.getProductOwnerIA5()));
+ document.setReference(UicEncoderUtils.mapToString(asnDocument.getReferenceNum(),asnDocument.getReferenceIA5()));
+
+ if (asnDocument.getValue()!=null) {
+ document.setAmount(asnDocument.getValue().intValue());
+ }
+
+ if (asnDocument.getType()!= null) {
+ document.setType(asnDocument.getType().intValue());
+ }
+
+ document.setExtension(convertExtension(asnDocument.getExtension()));
+
+ return document;
+ }
+
+ /**
+ * Convert customer card.
+ *
+ * @param asnDocument the asn card
+ * @param issuingDate the issuing date
+ * @return the i customer card
+ */
+ protected ICustomerCard convertCustomerCard(CustomerCardData asnDocument, Date issuingDate ) {
+
+ if (asnDocument == null) return null;
+
+ ICustomerCard card = factory.createCustomerCard();
+
+ card.setCardId(UicEncoderUtils.mapToString(asnDocument.getCardIdNum(), asnDocument.getCardIdIA5()));
+ if (asnDocument.getCardType()!= null) {
+ card.setCardType(asnDocument.getCardType().intValue());
+ }
+ card.setCardTypeDescr(asnDocument.getCardTypeDescr());
+ if(asnDocument.getClassCode()!=null){
+ card.setClassCode(ITravelClassType.valueOf(asnDocument.getClassCode().name()));
+ }
+ if(asnDocument.getCustomer()!=null) {
+ card.setCustomer(convertTraveler(asnDocument.getCustomer()));
+ }
+ if (asnDocument.getCustomerStatus()!=null) {
+ card.setCustomerStatus(asnDocument.getCustomerStatus().intValue());
+ }
+
+ card.setCustomerStatusDescr(asnDocument.getCustomerStatusDescr());
+
+ card.setValidFrom(asnDocument.getValidFromDate());
+
+ card.setValidUntil(asnDocument.getValidUntilDate());
+
+
+ if (asnDocument.getIncludedServices() != null && !asnDocument.getIncludedServices().isEmpty()){
+ for (Long service: asnDocument.getIncludedServices()){
+ card.addIncludedService(new Integer(service.intValue()));
+ }
+ }
+ return card;
+ }
+
+
+ /**
+ * Convert document extension.
+ *
+ * @param extension the extension
+ * @return the i document extension
+ */
+ protected IDocumentExtension convertDocumentExtension(ExtensionData asnExtension) {
+
+ if (asnExtension == null) return null;
+
+ IDocumentExtension documentExtension = factory.createDocumentExtension();
+ documentExtension.setId(asnExtension.getExtensionId());
+ documentExtension.setBinarydata(asnExtension.getExtensionData());
+ return documentExtension;
+ }
+
+
+ /**
+ * Populate traveler details.
+ *
+ * @param asnTravelerDetails the asn traveler details
+ * @param travelerDetails the traveler details
+ */
+ protected void populateTravelerDetails(TravelerData asnTravelerDetails,ITravelerDetail travelerDetails) {
+
+ if (asnTravelerDetails == null) return;
+
+ travelerDetails.setGroupName(asnTravelerDetails.getGroupName());
+
+ travelerDetails.setPreferredLanguage(asnTravelerDetails.getPreferedLanguage());
+
+ if (asnTravelerDetails.getTraveler() != null && !asnTravelerDetails.getTraveler().isEmpty() ) {
+ for ( TravelerType asnTraveler : asnTravelerDetails.getTraveler() ){
+ travelerDetails.addTraveler(convertTraveler(asnTraveler));
+ }
+ }
+ }
+
+ /**
+ * Convert traveler.
+ *
+ * @param asnTraveler the asn traveler
+ * @return the i traveler
+ */
+ protected ITraveler convertTraveler(TravelerType asnTraveler) {
+
+ if (asnTraveler == null) return null;
+
+ ITraveler traveler = factory.createTraveler();
+
+ if (asnTraveler.getCountryOfResidence() != null){
+ traveler.setCountryOfResidence(asnTraveler.getCountryOfResidence().intValue());
+ }
+ if (asnTraveler.getCountryOfPassport() != null) {
+ traveler.setPassportCountry(asnTraveler.getCountryOfPassport().intValue());
+ }
+
+ if (asnTraveler.getCountryOfIdCard() != null) {
+ traveler.setIDCardCountry(asnTraveler.getCountryOfIdCard().intValue());
+ }
+
+
+ traveler.setCustomerId(UicEncoderUtils.mapToString(asnTraveler.getCustomerIdNum(),asnTraveler.getCustomerIdIA5()));
+
+ traveler.setDateOfBirth(asnTraveler.getDateOfBirth());
+
+ traveler.setFirstName(asnTraveler.getFirstName());
+ if (asnTraveler.getGender()!= null) {
+ traveler.setGender(IGenderType.valueOf(asnTraveler.getGender().name()));
+ }
+ traveler.setIdCard(asnTraveler.getIdCard());
+ traveler.setLastName(asnTraveler.getLastName());
+
+ if (asnTraveler.getPassengerType()!= null) {
+ traveler.setPassengerType(IPassengerType.valueOf(asnTraveler.getPassengerType().name()));
+ }
+ if (asnTraveler.getPassengerWithReducedMobility()!= null) {
+ traveler.setPassengerWithReducedMobility(asnTraveler.getPassengerWithReducedMobility());
+ }
+
+ traveler.setPassportId(asnTraveler.getPassportId());
+ traveler.setSecondName(asnTraveler.getSecondName());
+
+ if (asnTraveler.getTicketHolder() != null) {
+ traveler.setTicketHolder(asnTraveler.getTicketHolder());
+ }
+
+ if (asnTraveler.getStatus()!= null && !asnTraveler.getStatus().isEmpty()) {
+
+ for (CustomerStatusType asnStatus : asnTraveler.getStatus()){
+
+ traveler.addStatusDescription( mapToStatusDescription(asnStatus) );
+
+ }
+
+ }
+
+ traveler.setTitle(asnTraveler.getTitle());
+
+ return traveler;
+ }
+
+ /**
+ * Map to status description.
+ *
+ * @param asnStatus the asn status
+ * @return the i customer status description
+ */
+ private ICustomerStatusDescription mapToStatusDescription( CustomerStatusType asnStatus) {
+
+ if (asnStatus == null) return null;
+
+ ICustomerStatusDescription status = factory.createCustomerStatusDescription();
+
+ status.setDescription(asnStatus.getCustomerStatusDescr());
+
+ if (asnStatus.getCustomerStatus()!=null) {
+ status.setStatus(asnStatus.getCustomerStatus().intValue());
+ }
+
+ status.setStatusProvider(UicEncoderUtils.mapToString(asnStatus.getStatusProviderNum(), asnStatus.getStatusProviderIA5()));
+
+ return status;
+ }
+
+
+
+
+
+
+
+ /**
+ * Populate control details.
+ *
+ * @param asnControlDetails the asn control details
+ * @param controlDetails the control details
+ */
+ protected void populateControlDetails(ControlData asnControlDetails, IControlDetail controlDetails) {
+
+ if (asnControlDetails == null || controlDetails==null ) return;
+
+ if (asnControlDetails.getAgeCheckRequired()!= null) {
+ controlDetails.setAgeCheckRequired(asnControlDetails.getAgeCheckRequired());
+ }
+
+ controlDetails.setExtension(convertExtension(asnControlDetails.getExtension()));
+
+ if (asnControlDetails.getIdentificationByIdCard()!=null){
+ controlDetails.setIdentificationByIdCard(asnControlDetails.getIdentificationByIdCard());
+ }
+
+ if (asnControlDetails.getIdentificationByPassportId()!= null){
+ controlDetails.setIdentificationByPassportId(asnControlDetails.getIdentificationByPassportId());
+ }
+
+ if(asnControlDetails.getIdentificationItem()!=null){
+ controlDetails.setIdentificationItem(asnControlDetails.getIdentificationItem().intValue());
+ }
+
+ controlDetails.setInfoText(asnControlDetails.getInfoText());
+
+ if (asnControlDetails.getOnlineValidationRequired()!=null){
+ controlDetails.setOnlineValidationRequired(asnControlDetails.getOnlineValidationRequired());
+ }
+
+ if (asnControlDetails.getRandomDetailedValidationRequired()!= null){
+ controlDetails.setRandomDetailedValidationRequired(asnControlDetails.getRandomDetailedValidationRequired().intValue());
+ }
+
+ if (asnControlDetails.getReductionCardCheckRequired() != null){
+ controlDetails.setReductionCardCheckRequired(asnControlDetails.getReductionCardCheckRequired());
+ }
+
+ if(asnControlDetails.getIdentificationByCardReference()!=null && !asnControlDetails.getIdentificationByCardReference().isEmpty()) {
+ for (CardReferenceType asnCardReference : asnControlDetails.getIdentificationByCardReference()){
+ controlDetails.addIdentificationByCardReference(convertCardReference(asnCardReference));
+ }
+ }
+
+ if (asnControlDetails.getIncludedTickets()!=null && !asnControlDetails.getIncludedTickets().isEmpty()) {
+ for (TicketLinkType asnTicketLink : asnControlDetails.getIncludedTickets()) {
+ controlDetails.addLinkedTicket(convertTicketLink(asnTicketLink));
+ }
+ }
+
+
+ }
+
+
+
+
+
+ /**
+ * Populate issuing detail.
+ *
+ * @param asnIssuingDetail the asn issuing detail
+ * @param issuingDetail the issuing detail
+ */
+ protected void populateIssuingDetail(IssuingData asnIssuingDetail,IIssuingDetail issuingDetail){
+
+ if (asnIssuingDetail== null || issuingDetail == null) return;
+
+ if (asnIssuingDetail.getActivated() != null) {
+ issuingDetail.setActivated(asnIssuingDetail.getActivated());
+ }
+
+ if (asnIssuingDetail.getSpecimen() != null) {
+ issuingDetail.setSpecimen(asnIssuingDetail.getSpecimen());
+ } else {
+ issuingDetail.setSpecimen(false);
+ }
+
+
+ if (asnIssuingDetail.getSecurePaperTicket() != null) {
+ issuingDetail.setSecurePaperTicket(asnIssuingDetail.getSecurePaperTicket());
+ } else {
+ issuingDetail.setSecurePaperTicket(false);
+ }
+
+ issuingDetail.setExtension(convertExtension(asnIssuingDetail.getExtension()));
+
+ if (asnIssuingDetail.getIssuedOnLine()!= null) {
+ issuingDetail.setIssuedOnLine(asnIssuingDetail.getIssuedOnLine().intValue());
+ }
+
+ if (asnIssuingDetail.getIssuedOnTrainIA5()!= null) {
+ issuingDetail.setIssuedOnTrain(asnIssuingDetail.getIssuedOnTrainIA5());
+ }
+ if (asnIssuingDetail.getIssuedOnTrainNum()!= null) {
+ issuingDetail.setIssuedOnTrain(asnIssuingDetail.getIssuedOnTrainNum().toString());
+ }
+
+ if (asnIssuingDetail.getIssuerNum() != null || asnIssuingDetail.getIssuerIA5() != null) {
+ issuingDetail.setIssuer(UicEncoderUtils.mapToString(asnIssuingDetail.getIssuerNum(), asnIssuingDetail.getIssuerIA5()));
+ }
+
+ issuingDetail.setIssuerName(asnIssuingDetail.getIssuerName());
+
+ issuingDetail.setIssuerPNR(asnIssuingDetail.getIssuerPNR());
+
+ issuingDetail.setSecurityProvider(UicEncoderUtils.mapToString(asnIssuingDetail.getSecurityProviderNum(),asnIssuingDetail.getSecurityProviderIA5()));
+
+
+ issuingDetail.setIssuingDate(asnIssuingDetail.getIssuingDate());
+
+
+ if (asnIssuingDetail.getPointOfSale() != null) {
+ issuingDetail.setPointOfSale(convertGeoCoordinate(asnIssuingDetail.getPointOfSale()));
+ }
+
+ }
+
+
+
+ /**
+ * Convert geo coordinate.
+ *
+ * @param asnCoordinate the asn coordinate
+ * @return the i geo coordinate
+ */
+ protected IGeoCoordinate convertGeoCoordinate(GeoCoordinateType asnCoordinate) {
+
+ if (asnCoordinate == null) return null;
+
+ IGeoCoordinate coordinate = factory.createGeoCoordinate();
+
+ if (asnCoordinate.getCoordinateSystem() != null) {
+ coordinate.setSystem(IGeoCoordinateSystemType.valueOf(asnCoordinate.getCoordinateSystem().name()));
+ }
+
+ if (asnCoordinate.getAccuracy() != null) {
+ coordinate.setAccuracy(IGeoUnitType.valueOf(asnCoordinate.getAccuracy().name()));
+ }
+
+ if (asnCoordinate.getGeoUnit() != null) {
+ coordinate.setUnit(IGeoUnitType.valueOf(asnCoordinate.getGeoUnit().name()));
+ }
+
+ if (asnCoordinate.getHemisphereLatitude() != null) {
+ coordinate.setHemisphereLatitude(IHemisphereLatitudeType.valueOf(asnCoordinate.getHemisphereLatitude().name()));
+ }
+
+ if (asnCoordinate.getHemisphereLongitude() != null) {
+ coordinate.setHemisphereLongitude(IHemisphereLongitudeType.valueOf(asnCoordinate.getHemisphereLongitude().name()));
+ }
+
+ coordinate.setLongitude (asnCoordinate.getLongitude());
+ coordinate.setLatitude (asnCoordinate.getLatitude());
+
+
+ return coordinate;
+ }
+
+
+ /**
+ * Convert extension.
+ *
+ * @param asnExtension the asn extension
+ * @return the i extension
+ */
+ protected IExtension convertExtension(ExtensionData asnExtension) {
+ if (asnExtension == null) return null;
+ IExtension extension = factory.createExtension();
+ extension.setId(asnExtension.getExtensionId());
+ extension.setBinarydata(asnExtension.getExtensionData());
+ return extension;
+ }
+
+
+ /**
+ * Convert ticket link.
+ *
+ * @param asnTicketLink the asn ticket link
+ * @return the i ticket link
+ */
+ protected ITicketLink convertTicketLink(TicketLinkType asnTicketLink) {
+
+ if (asnTicketLink == null) return null;
+
+ ITicketLink ticketLink = factory.createTicketLink();
+ ticketLink.setIssuer(asnTicketLink.getIssuerName());
+ ticketLink.setIssuerPNR(asnTicketLink.getIssuerPNR());
+ ticketLink.setProductOwner(UicEncoderUtils.mapToString(asnTicketLink.getProductOwnerNum(),asnTicketLink.getProductOwnerIA5()));
+ ticketLink.setReference(UicEncoderUtils.mapToString(asnTicketLink.getReferenceNum(),asnTicketLink.getReferenceIA5()));
+ if(asnTicketLink.getTicketType()!=null) {
+ ticketLink.setTicketType(ITicketType.valueOf(asnTicketLink.getTicketType().name()));
+ }
+ if(asnTicketLink.getLinkMode()!=null) {
+ ticketLink.setLinkMode(ILinkMode.valueOf(asnTicketLink.getLinkMode().name()));
+ }
+ return ticketLink;
+ }
+
+ /**
+ * Convert card reference.
+ *
+ * @param asnCardReference the asn card reference
+ * @return the card reference
+ */
+ protected ICardReference convertCardReference(CardReferenceType asnCardReference) {
+
+ if (asnCardReference == null) return null;
+
+ ICardReference cardReference = factory.createCardReference();
+ cardReference.setCardId(UicEncoderUtils.mapToString(asnCardReference.getCardIdNum(),asnCardReference.getCardIdIA5()));
+ cardReference.setCardIssuer(UicEncoderUtils.mapToString(asnCardReference.getCardIssuerNum(),asnCardReference.getCardIssuerIA5()));
+ cardReference.setCardName(asnCardReference.getCardName());
+
+ if(asnCardReference.getCardType()!=null) {
+ cardReference.setCardType(asnCardReference.getCardType().intValue());
+ }
+
+
+ cardReference.setLeadingCardId(UicEncoderUtils.mapToString(asnCardReference.getLeadingCardIdNum(),asnCardReference.getLeadingCardIdIA5()));
+ cardReference.setTrailingCardId(UicEncoderUtils.mapToString(asnCardReference.getTrailingCardIdNum(),asnCardReference.getTrailingCardIdIA5()));
+
+ return cardReference;
+ }
+
+}
diff --git a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
index e3918b0..4491358 100644
--- a/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
+++ b/src/main/java/org/uic/barcode/utils/AlgorithmNameResolver.java
@@ -3,11 +3,6 @@ package org.uic.barcode.utils;
import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
public class AlgorithmNameResolver {
@@ -16,10 +11,6 @@ public class AlgorithmNameResolver {
public static final String TYPE_SIGNATURE_ALG = "Signature";
- private static final Pattern KEY_TYPE_PATTERN = Pattern.compile("^(\\w+)[.].*$");
- private static final Pattern KEY_ALIAS_TYPE_PATTERN = Pattern.compile("^Alg[.]Alias[.](\\w+).*$");
- private static final Pattern KEY_OID_PATTERN = Pattern.compile(".*?(\\d+(?:[.]\\d+){3,})$");
-
public static String getSignatureAlgorithmName (String oid) throws Exception {
Provider[] provs = Security.getProviders();
@@ -32,69 +23,35 @@ public class AlgorithmNameResolver {
return null;
}
+
+ public static String getName (String type, String oid) throws Exception {
-
- public static String getName(String type, String oid) throws Exception {
-
- Provider[] provs = Security.getProviders();
-
- for (Provider prov : provs) {
-
- SortedSet<String> typeAndOID = getTypeAndOIDStrings(prov);
-
- for (String entry : typeAndOID) {
- String[] typeAndOIDArray = entry.split("-");
- String ptype = typeAndOIDArray[0];
- if (ptype.equalsIgnoreCase(type)) {
- String poid = typeAndOIDArray[1];
- Service pservice = prov.getService(ptype, poid);
- String palgo = pservice.getAlgorithm();
-
- if (poid != null && ptype.equalsIgnoreCase(type) && poid.equals(oid)) {
- return palgo;
- }
- }
- }
- }
-
-
+ Provider[] provs = Security.getProviders();
+ for (Provider prov : provs) {
+ Service service = prov.getService(type,oid);
+ if (service != null) {
+ return service.getAlgorithm();
+ }
+ }
+
if (oid.startsWith("1.2.840.10045")) {
return "ECDSA";
} else if (oid.startsWith("1.2.840.10040")) {
return "DSA";
}
-
- return null;
-
- }
-
- public static String getName(String type, String oid, String providerName) throws Exception {
-
- Provider[] provs = Security.getProviders();
-
- for (Provider prov : provs) {
-
- if (providerName == null || prov.getName().equals(providerName)) {
-
- SortedSet<String> typeAndOID = getTypeAndOIDStrings(prov);
-
- for (String entry : typeAndOID) {
- String[] typeAndOIDArray = entry.split("-");
- String ptype = typeAndOIDArray[0];
- if (ptype.equalsIgnoreCase(type)) {
- String poid = typeAndOIDArray[1];
- Service pservice = prov.getService(ptype, poid);
- String palgo = pservice.getAlgorithm();
- if (ptype.equalsIgnoreCase(type) && poid.equals(oid)) {
- return palgo;
- }
- }
- }
- }
- }
-
-
+ return null;
+
+ }
+
+
+ public static String getName(String type, String oid, Provider prov) throws Exception {
+
+ Service service = prov.getService(type,oid);
+ if (service != null) {
+ return service.getAlgorithm();
+ }
+
if (oid.startsWith("1.2.840.10045")) {
return "ECDSA";
} else if (oid.startsWith("1.2.840.10040")) {
@@ -103,71 +60,9 @@ public class AlgorithmNameResolver {
return null;
- }
-
- private static SortedSet<String> getTypeAndOIDStrings(Provider prov) {
-
- SortedSet<String> typeAndOID = new TreeSet<>();
-
- Set<Object> keys = prov.keySet();
- for (Object key : keys) {
- String keyString = key.toString();
- Matcher oidMatcher = KEY_OID_PATTERN.matcher(keyString);
- if (oidMatcher.matches()) {
- // get OID from matched keyString
- String oid = oidMatcher.group(1);
-
- // determine type
- String type;
- Matcher aliasTypeMatcher = KEY_ALIAS_TYPE_PATTERN.matcher(keyString);
- if (aliasTypeMatcher.matches()) {
- type = aliasTypeMatcher.group(1);
- } else {
- Matcher typeMatcher = KEY_TYPE_PATTERN.matcher(keyString);
- typeMatcher.matches();
- type = typeMatcher.group(1);
- }
- // algorithm parameters are not algorithms, so skip them
- if (type.equals("AlgorithmParameters")) {
- continue;
- }
-
- // auto-removes dupes
- typeAndOID.add(type + "-" + oid);
- }
- }
- return typeAndOID;
- }
+ }
+
- public static String getSecurityNames() throws Exception {
-
- Provider[] provs = Security.getProviders();
-
- StringBuilder sb = new StringBuilder();
-
- for (Provider prov : provs) {
-
- SortedSet<String> typeAndOID = getTypeAndOIDStrings(prov);
-
- for (String entry : typeAndOID) {
- String[] typeAndOIDArray = entry.split("-");
- String ptype = typeAndOIDArray[0];
- String poid = typeAndOIDArray[1];
- Service pservice = prov.getService(ptype, poid);
- String palgo = "";
- if ( pservice != null) {
- palgo = pservice.getAlgorithm();
- }
- sb.append(prov).append(";");
- sb.append(ptype).append(";");
- sb.append(poid).append(";");
- sb.append(palgo).append(";");
- sb.append("\r\n");
- }
- }
- return sb.toString();
-
- }
}
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
index aa377e8..a316cfc 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameDoubleSignatureTest.java
@@ -26,7 +26,6 @@ import org.uic.barcode.test.utils.Level2TestDataFactory;
import org.uic.barcode.test.utils.SimpleUICTestTicket;
import org.uic.barcode.ticket.EncodingFormatException;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
-import org.uic.barcode.utils.AlgorithmNameResolver;
public class DynamicFrameDoubleSignatureTest {
@@ -59,54 +58,12 @@ public class DynamicFrameDoubleSignatureTest {
assert(keyPairLevel1 != null);
+ assert(keyPairLevel2 != null);
+
}
- @Test public void testDynamicHeaderBarcodeEncoding() {
-
- IUicRailTicket ticket = testFCBticket;
- Encoder enc = null;
-
- try {
- enc = new Encoder(ticket, null, Encoder.UIC_BARCODE_TYPE_DOSIPAS, 1, 13);
- } catch (IOException | EncodingFormatException e1) {
- assert(false);
- }
-
- assert(enc != null);
-
- try {
- enc.setLevel1Algs(signatureAlgorithmOID, keyPairAlgorithmOID);
- enc.setLevel2Algs(signatureAlgorithmOID, keyPairAlgorithmOID,keyPairLevel2.getPublic());
- enc.signLevel1("1080", keyPairLevel1.getPrivate(), signatureAlgorithmOID, "1");
- } catch (Exception e) {
- assert(false);
- }
-
- assert(enc != null);
-
- try {
- enc.setLevel2Data(Level2TestDataFactory.getLevel2SimpleTestData());
- enc.signLevel2(keyPairLevel2.getPrivate());
- } catch (Exception e) {
- assert(false);
- }
-
-
- byte[] encoded = null;
- try {
- encoded = enc.encode();
- } catch (Exception e) {
- assert(false);
- }
-
- assert(encoded != null);
-
-
-
- }
-
@Test public void testDynamicHeaderBarcodeDecoding() {
IUicRailTicket ticket = testFCBticket;
@@ -164,7 +121,7 @@ public class DynamicFrameDoubleSignatureTest {
int signatureCheck = 0;
try {
- signatureCheck = dec.validateLevel1(keyPairLevel1.getPublic(),null);
+ signatureCheck = dec.validateLevel1(keyPairLevel1.getPublic(), null);
} catch (InvalidKeyException | NoSuchAlgorithmException | SignatureException | IllegalArgumentException
| UnsupportedOperationException | IOException | EncodingFormatException e) {
assert(false);
@@ -177,8 +134,7 @@ public class DynamicFrameDoubleSignatureTest {
} catch (IllegalArgumentException | UnsupportedOperationException e) {
assert(false);
}
- assert(signatureCheck == Constants.LEVEL2_VALIDATION_OK);
-
+ assert(signatureCheck == Constants.LEVEL2_VALIDATION_OK);
DataType level2DataDec = dec.getLevel2Data();
@@ -186,7 +142,6 @@ public class DynamicFrameDoubleSignatureTest {
assert(Arrays.equals(level2Data.getData().toByteArray(),level2DataDec.getData().toByteArray()));
SimpleUICTestTicket.compare(ticket, dec.getUicTicket());
-
}
@@ -199,9 +154,7 @@ public class DynamicFrameDoubleSignatureTest {
public KeyPair generateECKeys(String keyAlgorithmOid, String curve) throws Exception{
- String keyAlgorithmName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, keyAlgorithmOid, "BC");
-
- keyAlgorithmName = "ECDSA";
+ String keyAlgorithmName = "ECDSA";
ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(curve);
KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
g.initialize(ecSpec, new SecureRandom());
diff --git a/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java b/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
index a3a1b0e..190924d 100644
--- a/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
+++ b/src/test/java/org/uic/barcode/test/DynamicFrameSimpleTest.java
@@ -23,7 +23,6 @@ import org.uic.barcode.dynamicFrame.Constants;
import org.uic.barcode.test.utils.SimpleUICTestTicket;
import org.uic.barcode.ticket.EncodingFormatException;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
-import org.uic.barcode.utils.AlgorithmNameResolver;
public class DynamicFrameSimpleTest {
@@ -158,9 +157,7 @@ public class DynamicFrameSimpleTest {
public KeyPair generateECKeys(String keyAlgorithmOid, String curve) throws Exception{
- String keyAlgorithmName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, keyAlgorithmOid, "BC");
-
- keyAlgorithmName = "ECDSA";
+ String keyAlgorithmName = "ECDSA";
ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(curve);
KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
g.initialize(ecSpec, new SecureRandom());
diff --git a/src/test/java/org/uic/barcode/test/utils/TestUtils.java b/src/test/java/org/uic/barcode/test/utils/TestUtils.java
index 20a21c4..9791b02 100644
--- a/src/test/java/org/uic/barcode/test/utils/TestUtils.java
+++ b/src/test/java/org/uic/barcode/test/utils/TestUtils.java
@@ -12,7 +12,6 @@ import java.util.Date;
import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.spec.ECParameterSpec;
-import org.uic.barcode.utils.AlgorithmNameResolver;
public class TestUtils {
@@ -61,9 +60,7 @@ public class TestUtils {
public static KeyPair generateECKeys(String keyAlgorithmOid, String curve) throws Exception{
- String keyAlgorithmName = AlgorithmNameResolver.getName(AlgorithmNameResolver.TYPE_KEY_GENERATOR_ALG, keyAlgorithmOid, "BC");
-
- keyAlgorithmName = "ECDSA";
+ String keyAlgorithmName = "ECDSA";
ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(curve);
KeyPairGenerator g = KeyPairGenerator.getInstance(keyAlgorithmName, "BC");
g.initialize(ecSpec, new SecureRandom());
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/CustomerCardTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/CustomerCardTimeZoneTestV3.java
new file mode 100644
index 0000000..da0879b
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/CustomerCardTimeZoneTestV3.java
@@ -0,0 +1,314 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.ICustomerCard;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.CustomerCardTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class CustomerCardTestV1.
+ *
+ *
+ *
+ */
+public class CustomerCardTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFromDate1 = null;
+ String validFromDate2 = null;
+ String validFromDate3 = null;
+
+ String validUntilDate1 = null;
+ String validUntilDate2 = null;
+ String validUntilDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = CustomerCardTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = CustomerCardTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = CustomerCardTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2022.03.24-23:59");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Thu Mar 24 23:59:00 CET 2022" ));
+ assert(validUntilDate2.equals("Thu Mar 24 23:59:00 CET 2022" ));
+ assert(validUntilDate3.equals("Thu Mar 24 23:59:00 CET 2022" ));
+
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2021.03.24-23:59");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2022.03.24-23:59");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntilDate1.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+ assert(validUntilDate2.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+ assert(validUntilDate3.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFromDate1 = ((ICustomerCard) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate2 = ((ICustomerCard) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate3 = ((ICustomerCard) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntilDate1 = ((ICustomerCard) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate2 = ((ICustomerCard) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate3 = ((ICustomerCard) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+
+ }
+
+
+ private void setValidFromDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setValidUntilDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((ICustomerCard) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/FipTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/FipTimeZoneTestV3.java
new file mode 100644
index 0000000..a4c542e
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/FipTimeZoneTestV3.java
@@ -0,0 +1,347 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IFipTicket;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.FipTimeZoneTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class FipTimeZoneTestV1.
+ *
+ *
+ *
+ */
+public class FipTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFrom1 = null;
+ String validFrom2 = null;
+ String validFrom3 = null;
+
+ String validUntil1 = null;
+ String validUntil2 = null;
+ String validUntil3 = null;
+
+ String activationDate1 = null;
+ String activationDate2 = null;
+ String activationDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = FipTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = FipTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = FipTimeZoneTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFrom1 = ((IFipTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom2 = ((IFipTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom3 = ((IFipTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntil1 = ((IFipTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil2 = ((IFipTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil3 = ((IFipTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+ activationDate1 = ((IFipTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate2 = ((IFipTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate3 = ((IFipTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+
+ }
+
+
+ private void setActivatedDayTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IFipTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IFipTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IFipTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IFipTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IFipTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IFipTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ }
+
+ private void setValidFromTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IFipTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IFipTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IFipTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setValidUntilTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IFipTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IFipTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IFipTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketComplexTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketComplexTestV3.java
new file mode 100644
index 0000000..d39a0ba
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketComplexTestV3.java
@@ -0,0 +1,95 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.text.ParseException;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.test.testtickets.OpenTestComplexTicketV3;
+
+
+/**
+ * The Class FipTimeZoneTestV3.
+ *
+ *
+ *
+ */
+public class OpenTicketComplexTestV3 {
+
+
+
+ /** The ticket decoded 1. */
+ UicRailTicketData ticket = null;
+
+ byte[] encodedInTimeZone1 = null;
+
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void decoding() {
+
+ //get tickets
+ String hex = OpenTestComplexTicketV3.getEncodingHex();
+ byte[] content = UperEncoder.bytesFromHexString(hex);
+ ticket = UperEncoder.decode(content, UicRailTicketData.class);
+
+ assert(ticket != null);
+
+ }
+
+ @Test public void encoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ String hex = OpenTestComplexTicketV3.getEncodingHex();
+ byte[] content = UperEncoder.bytesFromHexString(hex);
+ ticket = UperEncoder.decode(content, UicRailTicketData.class);
+
+
+ //ticket = OpenTestComplexTicketV2.getUicTestTicket();
+ byte[] encoded = UperEncoder.encode(ticket);
+
+
+
+ assert(encoded != null);
+ assert(encoded.length > 20);
+
+ String encodedHex = UperEncoder.hexStringFromBytes(encoded);
+ String expectedHex = OpenTestComplexTicketV3.getEncodingHex();
+
+ assert(expectedHex.equals(encodedHex));
+
+ }
+
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketTimeZoneTestV3.java
new file mode 100644
index 0000000..236d8b0
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/OpenTicketTimeZoneTestV3.java
@@ -0,0 +1,347 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IOpenTicket;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.OpenTicketTimeZoneTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class FipTimeZoneTestV2.
+ *
+ *
+ *
+ */
+public class OpenTicketTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFrom1 = null;
+ String validFrom2 = null;
+ String validFrom3 = null;
+
+ String validUntil1 = null;
+ String validUntil2 = null;
+ String validUntil3 = null;
+
+ String activationDate1 = null;
+ String activationDate2 = null;
+ String activationDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = OpenTicketTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = OpenTicketTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = OpenTicketTimeZoneTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFrom1 = ((IOpenTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom2 = ((IOpenTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom3 = ((IOpenTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntil1 = ((IOpenTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil2 = ((IOpenTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil3 = ((IOpenTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+ activationDate1 = ((IOpenTicket) iTicketDecodedCase1.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate2 = ((IOpenTicket) iTicketDecodedCase2.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate3 = ((IOpenTicket) iTicketDecodedCase3.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+
+ }
+
+
+ private void setActivatedDayTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IOpenTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IOpenTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IOpenTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IOpenTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IOpenTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ }
+
+ private void setValidFromTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setValidUntilTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IOpenTicket) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/ParkingTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/ParkingTimeZoneTestV3.java
new file mode 100644
index 0000000..88c7a6e
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/ParkingTimeZoneTestV3.java
@@ -0,0 +1,314 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IParkingGround;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.ParkingTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class ParkingTestV3.
+ *
+ *
+ *
+ */
+public class ParkingTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String FromParkingDateDate1 = null;
+ String FromParkingDateDate2 = null;
+ String FromParkingDateDate3 = null;
+
+ String ToParkingDateDate1 = null;
+ String ToParkingDateDate2 = null;
+ String ToParkingDateDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = ParkingTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = ParkingTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = ParkingTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setFromParkingDateDateTo("2021.03.14-00:00");
+ setToParkingDateDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(FromParkingDateDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(FromParkingDateDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(FromParkingDateDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(ToParkingDateDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(ToParkingDateDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(ToParkingDateDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setFromParkingDateDateTo("2021.03.14-00:00");
+ setToParkingDateDateTo("2021.03.24-23:59");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(FromParkingDateDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(FromParkingDateDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(FromParkingDateDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(ToParkingDateDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(ToParkingDateDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(ToParkingDateDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setFromParkingDateDateTo("2021.03.14-00:00");
+ setToParkingDateDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(FromParkingDateDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(FromParkingDateDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(FromParkingDateDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(ToParkingDateDate1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(ToParkingDateDate2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(ToParkingDateDate3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ FromParkingDateDate1 = ((IParkingGround) iTicketDecodedCase1.getDocumentData().iterator().next()).getFromParkingDate().toString();
+ FromParkingDateDate2 = ((IParkingGround) iTicketDecodedCase2.getDocumentData().iterator().next()).getFromParkingDate().toString();
+ FromParkingDateDate3 = ((IParkingGround) iTicketDecodedCase3.getDocumentData().iterator().next()).getFromParkingDate().toString();
+
+ ToParkingDateDate1 = ((IParkingGround) iTicketDecodedCase1.getDocumentData().iterator().next()).getToParkingDate().toString();
+ ToParkingDateDate2 = ((IParkingGround) iTicketDecodedCase2.getDocumentData().iterator().next()).getToParkingDate().toString();
+ ToParkingDateDate3 = ((IParkingGround) iTicketDecodedCase3.getDocumentData().iterator().next()).getToParkingDate().toString();
+
+
+ }
+
+
+ private void setFromParkingDateDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IParkingGround) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setFromParkingDate(date);
+ ((IParkingGround) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setFromParkingDate(date);
+ ((IParkingGround) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setFromParkingDate(date);
+ }
+
+ private void setToParkingDateDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IParkingGround) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setToParkingDate(date);
+ ((IParkingGround) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setToParkingDate(date);
+ ((IParkingGround) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setToParkingDate(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/PassComplexTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/PassComplexTestV3.java
new file mode 100644
index 0000000..de7fe88
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/PassComplexTestV3.java
@@ -0,0 +1,92 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.text.ParseException;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.test.testtickets.PassComplexTicketV3;
+
+
+/**
+ * The Class Test asn.1 encoding of a pass.
+ *
+ *
+ *
+ */
+public class PassComplexTestV3 {
+
+
+ /** The ticket decoded 1. */
+ UicRailTicketData ticket = null;
+
+ byte[] encodedInTimeZone1 = null;
+
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void decoding() {
+
+ //get tickets
+ String hex = PassComplexTicketV3.getEncodingHex();
+ byte[] content = UperEncoder.bytesFromHexString(hex);
+ ticket = UperEncoder.decode(content, UicRailTicketData.class);
+
+ assert(ticket != null);
+
+ }
+
+ @Test public void encoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ String hex = PassComplexTicketV3.getEncodingHex();
+ byte[] content = UperEncoder.bytesFromHexString(hex);
+ ticket = UperEncoder.decode(content, UicRailTicketData.class);
+
+
+ byte[] encoded = UperEncoder.encode(ticket);
+
+
+
+ assert(encoded != null);
+ assert(encoded.length > 20);
+
+ String encodedHex = UperEncoder.hexStringFromBytes(encoded);
+ String expectedHex = PassComplexTicketV3.getEncodingHex();
+
+ assert(expectedHex.equals(encodedHex));
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/PassTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/PassTimeZoneTestV3.java
new file mode 100644
index 0000000..d8ea9f3
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/PassTimeZoneTestV3.java
@@ -0,0 +1,347 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IPass;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.PassTimeZoneTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class FipTimeZoneTestV2.
+ *
+ *
+ *
+ */
+public class PassTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFrom1 = null;
+ String validFrom2 = null;
+ String validFrom3 = null;
+
+ String validUntil1 = null;
+ String validUntil2 = null;
+ String validUntil3 = null;
+
+ String activationDate1 = null;
+ String activationDate2 = null;
+ String activationDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = PassTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = PassTimeZoneTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = PassTimeZoneTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromTo("2021.03.14-00:00");
+ setValidUntilTo("2021.03.24-23:59");
+ setActivatedDayTo("2021.03.14-00:00");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFrom1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFrom3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntil1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntil3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+ assert(activationDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(activationDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFrom1 = ((IPass) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom2 = ((IPass) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFrom3 = ((IPass) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntil1 = ((IPass) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil2 = ((IPass) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntil3 = ((IPass) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+ activationDate1 = ((IPass) iTicketDecodedCase1.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate2 = ((IPass) iTicketDecodedCase2.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+ activationDate3 = ((IPass) iTicketDecodedCase3.getDocumentData().iterator().next()).getActivatedDays().iterator().next().toString();
+
+ }
+
+
+ private void setActivatedDayTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IPass) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IPass) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IPass) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IPass) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ ((IPass) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().clear();
+ ((IPass) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).getActivatedDays().add(date);
+
+ }
+
+ private void setValidFromTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IPass) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IPass) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IPass) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setValidUntilTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IPass) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IPass) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IPass) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/ReservationTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/ReservationTimeZoneTestV3.java
new file mode 100644
index 0000000..3eb43e1
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/ReservationTimeZoneTestV3.java
@@ -0,0 +1,314 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IReservation;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.ReservationTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class FipTimeZoneTestV3.
+ *
+ *
+ *
+ */
+public class ReservationTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String departureDate1 = null;
+ String departureDate2 = null;
+ String departureDate3 = null;
+
+ String arrivalDate1 = null;
+ String arrivalDate2 = null;
+ String arrivalDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = ReservationTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = ReservationTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = ReservationTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setdepartureDateTo("2021.03.14-00:00");
+ setarrivalDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(departureDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(departureDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(departureDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(arrivalDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(arrivalDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(arrivalDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setdepartureDateTo("2021.03.14-00:00");
+ setarrivalDateTo("2021.03.24-23:59");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(departureDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(departureDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(departureDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(arrivalDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(arrivalDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(arrivalDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setdepartureDateTo("2021.03.14-00:00");
+ setarrivalDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(departureDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(departureDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(departureDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(arrivalDate1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(arrivalDate2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(arrivalDate3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ departureDate1 = ((IReservation) iTicketDecodedCase1.getDocumentData().iterator().next()).getDepartureDate().toString();
+ departureDate2 = ((IReservation) iTicketDecodedCase2.getDocumentData().iterator().next()).getDepartureDate().toString();
+ departureDate3 = ((IReservation) iTicketDecodedCase3.getDocumentData().iterator().next()).getDepartureDate().toString();
+
+ arrivalDate1 = ((IReservation) iTicketDecodedCase1.getDocumentData().iterator().next()).getArrivalDate().toString();
+ arrivalDate2 = ((IReservation) iTicketDecodedCase2.getDocumentData().iterator().next()).getArrivalDate().toString();
+ arrivalDate3 = ((IReservation) iTicketDecodedCase3.getDocumentData().iterator().next()).getArrivalDate().toString();
+
+
+ }
+
+
+ private void setdepartureDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IReservation) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setDepartureDate(date);
+ ((IReservation) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setDepartureDate(date);
+ ((IReservation) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setDepartureDate(date);
+ }
+
+ private void setarrivalDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IReservation) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setArrivalDate(date);
+ ((IReservation) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setArrivalDate(date);
+ ((IReservation) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setArrivalDate(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/StationPassageTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/StationPassageTimeZoneTestV3.java
new file mode 100644
index 0000000..c60225d
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/StationPassageTimeZoneTestV3.java
@@ -0,0 +1,314 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IStationPassage;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.StationPassageTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class FipTimeZoneTestV3.
+ *
+ *
+ *
+ */
+public class StationPassageTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFromDate1 = null;
+ String validFromDate2 = null;
+ String validFromDate3 = null;
+
+ String validUntilDate1 = null;
+ String validUntilDate2 = null;
+ String validUntilDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = StationPassageTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = StationPassageTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = StationPassageTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setUntilDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setUntilDateTo("2021.03.24-23:59");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setUntilDateTo("2021.03.24-23:59");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntilDate1.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntilDate2.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+ assert(validUntilDate3.equals("Wed Mar 24 23:59:00 GMT 2021" ));
+
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFromDate1 = ((IStationPassage) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate2 = ((IStationPassage) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate3 = ((IStationPassage) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntilDate1 = ((IStationPassage) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate2 = ((IStationPassage) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate3 = ((IStationPassage) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+
+ }
+
+
+ private void setValidFromDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IStationPassage) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IStationPassage) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IStationPassage) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setUntilDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IStationPassage) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IStationPassage) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IStationPassage) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV2.java b/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV2.java
index 53dc248..c7c2512 100644
--- a/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV2.java
@@ -12,12 +12,14 @@ import org.junit.Before;
import org.junit.Test;
import org.uic.barcode.asn1.uper.UperEncoder;
import org.uic.barcode.ticket.EncodingFormatException;
-import org.uic.barcode.ticket.api.asn.omv1.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv2.UicRailTicketData;
import org.uic.barcode.ticket.api.spec.IVoucher;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
-import org.uic.barcode.ticket.api.test.testtickets.VoucherTestTicketV1;
-import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoder;
-import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoder;
+import org.uic.barcode.ticket.api.test.testtickets.VoucherTestTicketV2;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV2;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV2;
/**
@@ -38,10 +40,10 @@ public class VoucherTimeZoneTestV2 {
private byte[] encoded3 = null;
/** The decoder. */
- OpenAsn2ApiDecoder decoder = new OpenAsn2ApiDecoder();
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV2();
/** The encoder. */
- Api2OpenAsnEncoder encoder = new Api2OpenAsnEncoder();
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV2();
/** The API ticket low level encoded for case 1. */
IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
@@ -87,9 +89,9 @@ public class VoucherTimeZoneTestV2 {
defaulttimeZone = TimeZone.getDefault();
- UicRailTicketData ticket1 = VoucherTestTicketV1.getUicTestTicket();
- UicRailTicketData ticket2 = VoucherTestTicketV1.getUicTestTicket();
- UicRailTicketData ticket3 = VoucherTestTicketV1.getUicTestTicket();
+ UicRailTicketData ticket1 = VoucherTestTicketV2.getUicTestTicket();
+ UicRailTicketData ticket2 = VoucherTestTicketV2.getUicTestTicket();
+ UicRailTicketData ticket3 = VoucherTestTicketV2.getUicTestTicket();
//encode in UTC time zone
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV3.java b/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV3.java
new file mode 100644
index 0000000..22b17c2
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/VoucherTimeZoneTestV3.java
@@ -0,0 +1,314 @@
+package org.uic.barcode.ticket.api.test;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.ticket.EncodingFormatException;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.spec.IVoucher;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+import org.uic.barcode.ticket.api.test.testtickets.VoucherTestTicketV3;
+import org.uic.barcode.ticket.api.utils.Api2AsnEncoder;
+import org.uic.barcode.ticket.api.utils.Api2OpenAsnEncoderV3;
+import org.uic.barcode.ticket.api.utils.Asn2ApiDecoder;
+import org.uic.barcode.ticket.api.utils.OpenAsn2ApiDecoderV3;
+
+
+/**
+ * The Class VoucherTestV1.
+ *
+ *
+ *
+ */
+public class VoucherTimeZoneTestV3 {
+
+ /** The low level encoded test ticket test case 1 . */
+ private byte[] encoded1 = null;
+
+ /** The low level encoded test ticket test case 2 . */
+ private byte[] encoded2 = null;
+
+ /** The low level encoded test ticket test case 3 . */
+ private byte[] encoded3 = null;
+
+ /** The decoder. */
+ Asn2ApiDecoder decoder = new OpenAsn2ApiDecoderV3();
+
+ /** The encoder. */
+ Api2AsnEncoder encoder = new Api2OpenAsnEncoderV3();
+
+ /** The API ticket low level encoded for case 1. */
+ IUicRailTicket iTicketDecodedFromAsn1Case1 = null;
+
+ /** The API ticket low level encoded for case 2. */
+ IUicRailTicket iTicketDecodedFromAsn1Case2 = null;
+
+ /** The API ticket low level encoded for case 3. */
+ IUicRailTicket iTicketDecodedFromAsn1Case3 = null;
+
+
+ /** The ticket decoded 1. */
+ IUicRailTicket iTicketDecodedCase1 = null;
+
+ /** The i ticket decoded 2. */
+ IUicRailTicket iTicketDecodedCase2 = null;
+
+ /** The i ticket decoded 3. */
+ IUicRailTicket iTicketDecodedCase3 = null;
+
+ byte[] encodedInTimeZone1 = null;
+ byte[] encodedInTimeZone2 = null;
+ byte[] encodedInTimeZone3 = null;
+
+ String issuingDate1 = null;
+ String issuingDate2 = null;
+ String issuingDate3 = null;
+
+ String validFromDate1 = null;
+ String validFromDate2 = null;
+ String validFromDate3 = null;
+
+ String validUntilDate1 = null;
+ String validUntilDate2 = null;
+ String validUntilDate3 = null;
+
+ TimeZone defaulttimeZone = null;
+
+ /**
+ * Prepare tickets.
+ */
+ @Before public void prepare() {
+
+ defaulttimeZone = TimeZone.getDefault();
+
+ UicRailTicketData ticket1 = VoucherTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket2 = VoucherTestTicketV3.getUicTestTicket();
+ UicRailTicketData ticket3 = VoucherTestTicketV3.getUicTestTicket();
+
+ //encode in UTC time zone
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+
+ encoded1 = UperEncoder.encode(ticket1);
+ encoded2 = UperEncoder.encode(ticket2);
+ encoded3 = UperEncoder.encode(ticket3);
+
+ }
+
+ /**
+ * clean up
+ */
+ @After public void resetTimeZone() {
+ TimeZone.setDefault(defaulttimeZone);
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone CET
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2022.03.24-23:59");
+
+ encode("CET");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Thu Mar 24 23:59:00 CET 2022" ));
+ assert(validUntilDate2.equals("Thu Mar 24 23:59:00 CET 2022" ));
+ assert(validUntilDate3.equals("Thu Mar 24 23:59:00 CET 2022" ));
+
+
+ }
+
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testGMTCETencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2021.03.24-23:59");
+
+ encode("GMT");
+ decode("CET");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 13:30:00 CET 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 01:30:00 CET 2021" ));
+ assert(issuingDate3.equals("Thu Mar 04 00:30:00 CET 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 CET 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 CET 2021" ));
+
+ assert(validUntilDate1.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate2.equals("Wed Mar 24 23:59:00 CET 2021" ));
+ assert(validUntilDate3.equals("Wed Mar 24 23:59:00 CET 2021" ));
+
+
+ }
+
+ /**
+ * Test encode test tickets in UTC and decode in CET.
+ *
+ * @throws IllegalArgumentException the illegal argument exception
+ * @throws IllegalAccessException the illegal access exception
+ * @throws ParseException
+ */
+ @Test public void testCETGMTencoding() throws IllegalArgumentException, IllegalAccessException, ParseException {
+
+ //get tickets
+ decodeTestTicketUTC();
+
+ //set the dates in the time zone GMT
+ TimeZone.setDefault(TimeZone.getTimeZone("CET"));
+ iTicketDecodedFromAsn1Case1.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-12:30" ));
+ iTicketDecodedFromAsn1Case2.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.04-00:30" ));
+ iTicketDecodedFromAsn1Case3.getIssuerDetails().setIssuingDate(new SimpleDateFormat( "yyyy.MM.dd-HH:mm" ).parse( "2021.03.03-23:30" ));
+
+ setValidFromDateTo("2021.03.14-00:00");
+ setValidUntilDateTo("2022.03.24-23:59");
+
+ encode("CET");
+ decode("GMT");
+ decodedDateToStrings();
+
+ assert(issuingDate1.equals("Thu Mar 04 12:30:00 GMT 2021" ));
+ assert(issuingDate2.equals("Thu Mar 04 00:30:00 GMT 2021" ));
+ assert(issuingDate3.equals("Wed Mar 03 23:30:00 GMT 2021" ));
+
+ assert(validFromDate1.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate2.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+ assert(validFromDate3.equals("Sun Mar 14 00:00:00 GMT 2021" ));
+
+ assert(validUntilDate1.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+ assert(validUntilDate2.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+ assert(validUntilDate3.equals("Thu Mar 24 23:59:00 GMT 2022" ));
+
+
+ }
+
+ private void decodedDateToStrings() {
+
+ issuingDate1 = iTicketDecodedCase1.getIssuerDetails().getIssuingDate().toString();
+ issuingDate2 = iTicketDecodedCase2.getIssuerDetails().getIssuingDate().toString();
+ issuingDate3 = iTicketDecodedCase3.getIssuerDetails().getIssuingDate().toString();
+
+ validFromDate1 = ((IVoucher) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate2 = ((IVoucher) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidFrom().toString();
+ validFromDate3 = ((IVoucher) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidFrom().toString();
+
+ validUntilDate1 = ((IVoucher) iTicketDecodedCase1.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate2 = ((IVoucher) iTicketDecodedCase2.getDocumentData().iterator().next()).getValidUntil().toString();
+ validUntilDate3 = ((IVoucher) iTicketDecodedCase3.getDocumentData().iterator().next()).getValidUntil().toString();
+
+
+ }
+
+
+ private void setValidFromDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IVoucher) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IVoucher) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidFrom(date);
+ ((IVoucher) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidFrom(date);
+ }
+
+ private void setValidUntilDateTo(String dateString) throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy.MM.dd-HH:mm" );
+ Date date = dateFormat.parse(dateString);
+ ((IVoucher) iTicketDecodedFromAsn1Case1.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IVoucher) iTicketDecodedFromAsn1Case2.getDocumentData().iterator().next()).setValidUntil(date);
+ ((IVoucher) iTicketDecodedFromAsn1Case3.getDocumentData().iterator().next()).setValidUntil(date);
+ }
+
+
+ /**
+ * Encode in Time Zone
+ */
+ private void encode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ try {
+ encodedInTimeZone1 = encoder.encode(iTicketDecodedFromAsn1Case1);
+ encodedInTimeZone2 = encoder.encode(iTicketDecodedFromAsn1Case2);
+ encodedInTimeZone3 = encoder.encode(iTicketDecodedFromAsn1Case3);
+ } catch (EncodingFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Decode in Time Zone
+ */
+ private void decode(String timeZone) {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+
+ try {
+ iTicketDecodedCase1 = decoder.decodeFromAsn(encodedInTimeZone1);
+ iTicketDecodedCase2 = decoder.decodeFromAsn(encodedInTimeZone2);
+ iTicketDecodedCase3 = decoder.decodeFromAsn(encodedInTimeZone3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Encode decode.
+ */
+ private void decodeTestTicketUTC() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ try {
+ iTicketDecodedFromAsn1Case1 = decoder.decodeFromAsn(encoded1);
+ iTicketDecodedFromAsn1Case2 = decoder.decodeFromAsn(encoded2);
+ iTicketDecodedFromAsn1Case3 = decoder.decodeFromAsn(encoded3);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV3.java
new file mode 100644
index 0000000..e41a3cd
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV3.java
@@ -0,0 +1,170 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerCardData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.GenderType;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LinkMode;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+ public class CustomerCardTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addCustomerCard(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+ //issue date: 04-03-2021 12:30 UTC
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2021L);
+ issuingDetail.setIssuingTime(750L);
+ issuingDetail.setIssuingDay(63L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void addCustomerCard(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ CustomerCardData card = new CustomerCardData();
+ card.setCustomer(getTraveler());
+ card.setClassCode(TravelClassType.first);
+ card.setValidFromYear(2021L);
+ card.setValidFromDay(10L);
+ card.setValidUntilYear(1L);
+ card.setValidUntilDay(10L);
+ card.setCardTypeDescr("RAILPLUS");
+ tdd.setCustomerCard(card);
+ dd.setTicket(tdd);
+ }
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+ private static TravelerType getTraveler() {
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setYearOfBirth(1990L);
+ tr.setMonthOfBirth(1L);
+ tr.setDayOfBirth(21L);
+ tr.setGender(GenderType.male);
+ tr.setIdCard("IEDZ235FT");
+ return tr;
+ }
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
+ populateLinkedTickets(sit);
+ controlDetail.setIncludedTickets(sit);
+ }
+
+ private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
+ TicketLinkType tlt = new TicketLinkType();
+ tlt.productOwnerIA5="test";
+ tlt.setTicketType(TicketType.pass);
+ tlt.setIssuerPNR("PNR");
+ tlt.setReferenceIA5("UED12435867");
+ tlt.setLinkMode(LinkMode.onlyValidInCombination);
+ tlt.setIssuerName("OEBB");
+ sequenceOfTicketLinkType.add(tlt);
+ }
+
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV3.java
new file mode 100644
index 0000000..34b2386
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV3.java
@@ -0,0 +1,155 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.FIPTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCarrierNum;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+ public class FipTimeZoneTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //FipTicket
+ DocumentData do1 = new DocumentData();
+ addFip(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+ //issue date: 04-03-2021 12:30 UTC
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2021L);
+ issuingDetail.setIssuingTime(750L);
+ issuingDetail.setIssuingDay(63L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void addFip(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ FIPTicketData otd = new FIPTicketData();
+ otd.setClassCode(TravelClassType.first);
+ otd.setNumberOfTravelDays(8L);
+ otd.setValidFromDay(10L);
+ otd.setValidUntilDay(10L);
+ SequenceOfCarrierNum carriers = new SequenceOfCarrierNum();
+ carriers.add(1080L);
+ carriers.add(1181L);
+ otd.setCarrierNum(carriers);
+ otd.setIncludesSupplements(true);
+ otd.setReferenceNum(Asn1BigInteger.toAsn1(123445));
+ SequenceOfActivatedDays s = new SequenceOfActivatedDays();
+ s.add(0L);
+ otd.setActivatedDay(s);
+
+ tdd.setFipTicket(otd);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("employee");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+
+
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ }
+
+
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestComplexTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestComplexTicketV3.java
new file mode 100644
index 0000000..c812dad
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestComplexTicketV3.java
@@ -0,0 +1,413 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringUTF8;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IncludedOpenTicketType;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LinkMode;
+import org.uic.barcode.ticket.api.asn.omv3.OpenTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.PassengerType;
+import org.uic.barcode.ticket.api.asn.omv3.RegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.RouteSectionType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfIncludedOpenTicketType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfRegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTariffType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfVatDetail;
+import org.uic.barcode.ticket.api.asn.omv3.StationPassageData;
+import org.uic.barcode.ticket.api.asn.omv3.TariffType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketType;
+import org.uic.barcode.ticket.api.asn.omv3.TokenType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.VatDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ZoneType;
+
+
+ public class OpenTestComplexTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+ /*
+ value UicRailTicketData ::= {
+ issuingDetail {
+ issuingYear 2018
+ issuingDay 1
+ issuingTime 600
+ specimen TRUE,
+ securePaperTicket FALSE,
+ activated TRUE,
+ issuerPNR "issuerTestPNR",
+ issuedOnLine 12
+ }
+ ,travelerDetail{
+ traveler {
+ {
+ firstName "John"
+ ,secondName "Dow"
+ ,idCard "12345"
+ ,ticketHolder TRUE
+ ,status {{customerStatusDescr "senior" }}
+ }
+ }
+ ,groupName "myGroup"
+ }
+ ,transportDocument {
+ {
+ token {tokenProviderIA5 "VDV", token '82DA'H }
+ ,ticket openTicket : {
+ returnIncluded FALSE
+ ,classCode first
+ ,vatDetail {
+ { country 80
+ ,percentage 70
+ ,amount 10
+ ,vatId "IUDGTE"
+ }
+ }
+ ,infoText "openTicketInfo"
+ ,includedAddOns {
+ { productOwnerNum 1080
+ ,validRegion { zones : { zoneId { 100 } } }
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,classCode second
+ ,tariffs {
+ { numberOfPassengers 2
+ ,passengerType adult
+ ,restrictedToCountryOfResidence FALSE
+ ,restrictedToRouteSection { fromStationNum 8000001 , toStationNum 8010000 }
+ }
+ }
+ ,infoText "included ticket"
+ }
+ }
+ }
+ }
+ ,{
+ ticket stationPassage : {
+ productName "passage"
+ ,stationNameUTF8 { "Amsterdam" }
+ ,validFromDay 0
+ ,numberOfDaysValid 123
+ }
+ }
+ }
+ ,controlDetail {
+ identificationByCardReference {
+ { trailingCardIdNum 100 }
+ }
+ ,identificationByIdCard FALSE
+ ,identificationByPassportId FALSE
+ ,passportValidationRequired FALSE
+ ,onlineValidationRequired FALSE
+ ,ageCheckRequired FALSE
+ ,reductionCardCheckRequired FALSE
+ ,infoText "cd"
+ ,includedTickets {
+ { referenceIA5 "UED12435867"
+ ,issuerName "OEBB"
+ ,issuerPNR "PNR"
+ ,productOwnerIA5 "test"
+ ,ticketType pass
+ ,linkMode onlyValidInCombination
+
+ }
+ }
+ }
+ ,extension {
+ { extensionId "1", extensionData '82DA'H }
+ ,{ extensionId "2", extensionData '83DA'H }
+ }
+ }
+ */
+
+
+
+ public static String getEncodingHex() {
+ return
+ "7804404004B14374F3E7D72F2A9979F4A13A90086280B4001044A6F686E03446" +
+ "F770562C99B46B01106E797769DFC81DB5E51DC9BDD5C0094075A2560282DA10" +
+ "00000101C0101C4F11804281A4D5891EA450E6F70656E5469636B6574496E666" +
+ "F0140AD06021B8090020080B23E8013E8100B10008143D09003D1C8787B4B731" +
+ "B63AB232B2103A34B1B5B2BA090110081DC185CDCD859D94042505B5CDD195C9" +
+ "9185B4B780BDA60100402C800131B200ADC2EAC588C593466D5C366E089E8A84" +
+ "84074275204E9979F428100B10282DA01640507B40";
+
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addOpenTicketData(do1);
+ ds.add(do1);
+
+ //StationPassage
+ DocumentData do2 = new DocumentData();
+ addStationPassage(do2);
+ ds.add(do2);
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+ private static void addStationPassage(DocumentData dd) {
+ TicketDetailData tdd = new TicketDetailData();
+ StationPassageData sp = new StationPassageData();
+ sp.setProductName("passage");
+ sp.setValidFromDay(0L);
+ sp.setNumberOfDaysValid(123L);
+ SequenceOfStringUTF8 ss = new SequenceOfStringUTF8();
+ ss.add("Amsterdam");
+ sp.setStationNameUTF8(ss);
+ tdd.setStationPassage(sp);
+ dd.setTicket(tdd);
+ }
+
+ /*
+ *
+ * returnIncluded FALSE
+ ,classCode first
+ ,vatDetail {
+ { country 80
+ ,percentage 70
+ ,amount 10
+ ,vatId "IUDGTE"
+ }
+ }
+ ,infoText "openTicketInfo"
+ */
+ private static void addOpenTicketData(DocumentData dd) {
+ TokenType to = new TokenType();
+ to.setTokenProviderIA5("VDV");
+ byte[] ba = { (byte) 0x82, (byte) 0xDA };
+ to.setToken(ba);
+ dd.setToken(to);
+
+ TicketDetailData tdd = new TicketDetailData();
+ OpenTicketData otd = new OpenTicketData();
+ otd.setInfoText("openTicketInfo");
+ otd.setClassCode(TravelClassType.first);
+ otd.setReturnIncluded(false);
+
+ otd.setIncludedAddOns(new SequenceOfIncludedOpenTicketType());
+ otd.getIncludedAddOns().add(getIncludedOpenTicket());
+
+ otd.setVatDetails(new SequenceOfVatDetail());
+ otd.getVatDetails().add(getVatDetail());
+
+ tdd.setOpenTicket(otd);
+ dd.setTicket(tdd);
+
+ }
+
+ private static VatDetailType getVatDetail() {
+ VatDetailType v = new VatDetailType();
+ v.setAmount(10L);
+ v.setCountry(80L);
+ v.setPercentage(70L);
+ v.setVatId("IUDGTE");
+ return v;
+ }
+
+ /*
+ { productOwnerNum 1080
+ ,validRegion { zones : { zoneId { 100 } } }
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,classCode second
+ ,tariffs {
+ { numberOfPassengers 2
+ ,passengerType adult
+ ,restrictedToCountryOfResidence FALSE
+ ,restrictedToRouteSection { fromStationNum 8000001 , toStationNum 8010000 }
+ }
+ }
+ ,infoText "included ticket"
+ }
+ */
+
+ private static IncludedOpenTicketType getIncludedOpenTicket() {
+ IncludedOpenTicketType t = new IncludedOpenTicketType();
+ t.setClassCode(TravelClassType.second);
+ t.setInfoText("included ticket");
+ t.setProductOwnerNum(1080L);
+ t.setValidRegion(new SequenceOfRegionalValidityType());
+ t.getValidRegion().add(getZone());
+ t.setValidFromDay(0L);
+ t.setValidFromTime(1000L);
+ t.setValidUntilDay(1L);
+ t.setValidUntilTime(1000L);
+ t.setTariffs(new SequenceOfTariffType());
+ t.getTariffs().add(getTariff());
+ return t;
+ }
+
+
+
+
+ private static RegionalValidityType getZone() {
+
+ RegionalValidityType r = new RegionalValidityType();
+ ZoneType z = new ZoneType();
+ z.setZoneId(new SequenceOfUnrestrictedLong());
+ z.getZoneId().add(100L);
+ r.setZones(z);
+ return r;
+ }
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+/*
+ * issuingDetail {
+ issuingYear 2018
+ issuingDay 1
+ specimen TRUE,
+ securePaperTicket FALSE,
+ activated TRUE,
+ issuerPNR "issuerTestPNR",
+ issuedOnLine 12
+ }
+ */
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2018L);
+ issuingDetail.setIssuingDay(1L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
+ populateLinkedTickets(sit);
+ controlDetail.setIncludedTickets(sit);
+ }
+
+
+ /*
+ *
+ */
+ private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
+ TicketLinkType tlt = new TicketLinkType();
+ tlt.productOwnerIA5="test";
+ tlt.setTicketType(TicketType.pass);
+ tlt.setIssuerPNR("PNR");
+ tlt.setReferenceIA5("UED12435867");
+ tlt.setLinkMode(LinkMode.onlyValidInCombination);
+ tlt.setIssuerName("OEBB");
+ sequenceOfTicketLinkType.add(tlt);
+ }
+
+ /*
+ {
+ trailingCardIdNum 100
+ }
+ */
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+ private static TariffType getTariff() {
+ TariffType t = new TariffType();
+ t.setNumberOfPassengers(2L);
+ t.setPassengerType(PassengerType.adult);
+ t.setRestrictedToRouteSection(getRouteSection());
+ t.setRestrictedToCountryOfResidence(false);
+ return t;
+ }
+
+ private static RouteSectionType getRouteSection() {
+ RouteSectionType r = new RouteSectionType();
+ r.setFromStationNum(8000001L);
+ r.setToStationNum(8010000L);
+
+ return r;
+ }
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV3.java
new file mode 100644
index 0000000..e80296b
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV3.java
@@ -0,0 +1,158 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.OpenTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TokenType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+
+ public class OpenTicketTimeZoneTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addOpenTicketData(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+
+ private static void addOpenTicketData(DocumentData dd) {
+ TokenType to = new TokenType();
+ to.setTokenProviderIA5("VDV");
+ byte[] ba = { (byte) 0x82, (byte) 0xDA };
+ to.setToken(ba);
+ dd.setToken(to);
+
+ TicketDetailData tdd = new TicketDetailData();
+ OpenTicketData otd = new OpenTicketData();
+ otd.setInfoText("openTicketInfo");
+ otd.setClassCode(TravelClassType.first);
+ otd.setReturnIncluded(false);
+ otd.setValidFromDay(10L);
+ otd.setValidFromTime(0L);
+ otd.setValidUntilDay(10L);
+ otd.setValidUntilTime(1439L);
+ SequenceOfActivatedDays s = new SequenceOfActivatedDays();
+ otd.setActivatedDay(s);
+ s.add(0L);
+ tdd.setOpenTicket(otd);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2018L);
+ issuingDetail.setIssuingDay(1L);
+ issuingDetail.setIssuingTime(600L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ }
+
+
+ /*
+ {
+ trailingCardIdNum 100
+ }
+ */
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV3.java
new file mode 100644
index 0000000..bacdb41
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV3.java
@@ -0,0 +1,147 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.ParkingGroundData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+ public class ParkingTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //FipTicket
+ DocumentData do1 = new DocumentData();
+ addTicket(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+ //issue date: 04-03-2021 12:30 UTC
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2021L);
+ issuingDetail.setIssuingTime(750L);
+ issuingDetail.setIssuingDay(63L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void addTicket(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ ParkingGroundData ticket = new ParkingGroundData();
+ ticket.setFromParkingDate(01L);
+ ticket.setToParkingDate(01L);
+ ticket.setReferenceIA5("ACHE12345");
+ ticket.setLocation("Parking Frankfurt Main West");
+ ticket.setNumberPlate("AA-DE-12345");
+ ticket.setStationNum(8000001L);
+ ticket.setPrice(500L);
+ ticket.setParkingGroundId("P47623");
+ ticket.setSpecialInformation("outdoor parking");
+
+ tdd.setParkingGround(ticket);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("employee");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+
+
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ }
+
+
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassComplexTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassComplexTicketV3.java
new file mode 100644
index 0000000..03df203
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassComplexTicketV3.java
@@ -0,0 +1,431 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringUTF8;
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfUnrestrictedLong;
+import org.uic.barcode.ticket.api.asn.omv3.BoardingOrArrivalType;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LinkMode;
+import org.uic.barcode.ticket.api.asn.omv3.PassData;
+import org.uic.barcode.ticket.api.asn.omv3.PassengerType;
+import org.uic.barcode.ticket.api.asn.omv3.RegionalValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.RouteSectionType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCarrierNum;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCountries;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfVatDetail;
+import org.uic.barcode.ticket.api.asn.omv3.StationPassageData;
+import org.uic.barcode.ticket.api.asn.omv3.TariffType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketType;
+import org.uic.barcode.ticket.api.asn.omv3.TokenType;
+import org.uic.barcode.ticket.api.asn.omv3.TrainValidityType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.VatDetailType;
+import org.uic.barcode.ticket.api.asn.omv3.ZoneType;
+
+
+ public class PassComplexTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+ /*
+ value UicRailTicketData ::= {
+ issuingDetail {
+ issuingYear 2018
+ issuingDay 1
+ issuingTime 600
+ specimen TRUE,
+ securePaperTicket FALSE,
+ activated TRUE,
+ issuerPNR "issuerTestPNR",
+ issuedOnLine 12
+ }
+ ,travelerDetail{
+ traveler {
+ {
+ firstName "John"
+ ,secondName "Dow"
+ ,idCard "12345"
+ ,ticketHolder TRUE
+ ,status {{customerStatusDescr "senior" }}
+ }
+ }
+ ,groupName "myGroup"
+ }
+ ,transportDocument {
+ {
+ token {tokenProviderIA5 "XYZ", token '82DA'H }
+ ,ticket pass : {
+ referenceNum 123456789
+ ,productOwnerNum 4567
+ ,passType 2
+ ,passDescription "Eurail FlexPass"
+ ,classCode first
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,trainValidity {
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,includedCarrierNum {1234, 5678}
+ ,boardingOrArrival boarding
+ }
+ ,numberOfDaysOfTravel 10
+ ,activatedDay {200, 201}
+ ,countries {10, 20}
+ ,price 10000
+ ,vatDetail {
+ { country 80
+ ,percentage 70
+ ,amount 10
+ ,vatId "IUDGTE"
+ }
+ }
+ ,infoText "pass info"
+ }
+ }
+ ,{
+ ticket stationPassage : {
+ productName "passage"
+ ,stationNameUTF8 { "Amsterdam" }
+ ,validFromDay 0
+ ,numberOfDaysValid 123
+ }
+ }
+ }
+ ,controlDetail {
+ identificationByCardReference {
+ { trailingCardIdNum 100 }
+ }
+ ,identificationByIdCard FALSE
+ ,identificationByPassportId FALSE
+ ,passportValidationRequired FALSE
+ ,onlineValidationRequired FALSE
+ ,ageCheckRequired FALSE
+ ,reductionCardCheckRequired FALSE
+ ,infoText "cd"
+ ,includedTickets {
+ { referenceIA5 "UED12435867"
+ ,issuerName "OEBB"
+ ,issuerPNR "PNR"
+ ,productOwnerIA5 "test"
+ ,ticketType pass
+ ,linkMode onlyValidInCombination
+
+ }
+ }
+ }
+ ,extension {
+ { extensionId "1", extensionData '82DA'H }
+ ,{ extensionId "2", extensionData '83DA'H }
+ }
+ }
+ */
+
+
+
+ public static String getEncodingHex() {
+ return
+ "7804404004B14374F3E7D72F2A9979F4A13A90086280B4001044A6F686E03446" +
+ "F770562C99B46B01106E797769DFC81DB5E51DC9BDD5C00940762CDA0282DA1A" +
+ "8EB1700E04075BCD1523AC021E8AEAE4C2D2D8408CD8CAF0A0C2E6E617D0027D" +
+ "05A03E8013E80209A258B4240990C902091302271001C4F11804281A4D5891EA" +
+ "45097061737320696E666F120220103B830B9B9B0B3B28084A0B6B9BA32B9323" +
+ "0B696F017B4C0200805900026364015B85D58B118B268CDAB86CDC113D150908" +
+ "0E84EA409D32F3E850201620505B402C80A0F680";
+
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addPassData(do1);
+ ds.add(do1);
+
+ //StationPassage
+ DocumentData do2 = new DocumentData();
+ addStationPassage(do2);
+ ds.add(do2);
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+ private static void addStationPassage(DocumentData dd) {
+ TicketDetailData tdd = new TicketDetailData();
+ StationPassageData sp = new StationPassageData();
+ sp.setProductName("passage");
+ sp.setValidFromDay(0L);
+ sp.setNumberOfDaysValid(123L);
+ SequenceOfStringUTF8 ss = new SequenceOfStringUTF8();
+ ss.add("Amsterdam");
+ sp.setStationNameUTF8(ss);
+ tdd.setStationPassage(sp);
+ dd.setTicket(tdd);
+ }
+
+ /*
+ *
+ token {tokenProviderIA5 "XYZ", token '82DA'H }
+ ,ticket pass : {
+ referenceNum 123456789
+ ,productOwnerNum 4567
+ ,passType 2
+ ,passDescription "Eurail FlexPass"
+ ,classCode first
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,trainValidity {
+ ,validFromDay 0
+ ,validFromTime 1000
+ ,validUntilDay 1
+ ,validUntilTime 1000
+ ,includedCarrierNum {1234, 5678}
+ ,boardingOrArrival boarding
+ }
+ ,numberOfDaysOfTravel 10
+ ,activatedDay {200, 201}
+ ,countries {10, 20}
+ ,price 10000
+ ,vatDetail {
+ { country 80
+ ,percentage 70
+ ,amount 10
+ ,vatId "IUDGTE"
+ }
+ }
+ ,infoText "pass info"
+ *
+ */
+ private static void addPassData(DocumentData dd) {
+ TokenType to = new TokenType();
+ to.setTokenProviderIA5("XYZ");
+ byte[] ba = { (byte) 0x82, (byte) 0xDA };
+ to.setToken(ba);
+ dd.setToken(to);
+
+ TicketDetailData tdd = new TicketDetailData();
+ PassData otd = new PassData();
+
+ otd.setReferenceNum(Asn1BigInteger.toAsn1(123456789L));
+ otd.setProductOwnerNum(4567L);
+ otd.setPassDescription("Eurail FlexPass");
+
+ otd.setInfoText("pass info");
+ otd.setClassCode(TravelClassType.first);
+
+ otd.setValidFromDay(0L);
+ otd.setValidFromTime(1000L);
+ otd.setValidUntilDay(1L);
+ otd.setValidUntilTime(1000L);
+
+ SequenceOfCountries countries = new SequenceOfCountries();
+ countries.add(10L);
+ countries.add(20L);
+ otd.setCountries(countries);
+
+ otd.setTrainValidity(getTrainValidity());
+ SequenceOfActivatedDays activatedDays = new SequenceOfActivatedDays();
+ activatedDays.add(200L);
+ activatedDays.add(201L);
+ otd.setActivatedDay(activatedDays);
+
+ otd.setNumberOfDaysOfTravel(10L);
+
+ otd.setPrice(10000L);
+ otd.setVatDetails(new SequenceOfVatDetail());
+ otd.getVatDetails().add(getVatDetail());
+
+ tdd.setPass(otd);
+ dd.setTicket(tdd);
+
+ }
+
+ private static TrainValidityType getTrainValidity() {
+ TrainValidityType t = new TrainValidityType();
+ t.setValidFromDay(0L);
+ t.setValidFromTime(1000L);
+ t.setValidUntilDay(1L);
+ t.setValidUntilTime(1000L);
+ SequenceOfCarrierNum carriers = new SequenceOfCarrierNum();
+ carriers.add(1234L);
+ carriers.add(5678L);
+ t.setIncludedCarriersNum(carriers);
+
+ t.setBordingOrArrival(BoardingOrArrivalType.boarding);
+
+ return t;
+ }
+
+
+
+ private static VatDetailType getVatDetail() {
+ VatDetailType v = new VatDetailType();
+ v.setAmount(10L);
+ v.setCountry(80L);
+ v.setPercentage(70L);
+ v.setVatId("IUDGTE");
+ return v;
+ }
+
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+/*
+ * issuingDetail {
+ issuingYear 2018
+ issuingDay 1
+ specimen TRUE,
+ securePaperTicket FALSE,
+ activated TRUE,
+ issuerPNR "issuerTestPNR",
+ issuedOnLine 12
+ }
+ */
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2018L);
+ issuingDetail.setIssuingDay(1L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
+ populateLinkedTickets(sit);
+ controlDetail.setIncludedTickets(sit);
+ }
+
+
+ /*
+ *
+ */
+ private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
+ TicketLinkType tlt = new TicketLinkType();
+ tlt.productOwnerIA5="test";
+ tlt.setTicketType(TicketType.pass);
+ tlt.setIssuerPNR("PNR");
+ tlt.setReferenceIA5("UED12435867");
+ tlt.setLinkMode(LinkMode.onlyValidInCombination);
+ tlt.setIssuerName("OEBB");
+ sequenceOfTicketLinkType.add(tlt);
+ }
+
+ /*
+ {
+ trailingCardIdNum 100
+ }
+ */
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+ private static TariffType getTariff() {
+ TariffType t = new TariffType();
+ t.setNumberOfPassengers(2L);
+ t.setPassengerType(PassengerType.adult);
+ t.setRestrictedToRouteSection(getRouteSection());
+ t.setRestrictedToCountryOfResidence(false);
+ return t;
+ }
+
+ private static RouteSectionType getRouteSection() {
+ RouteSectionType r = new RouteSectionType();
+ r.setFromStationNum(8000001L);
+ r.setToStationNum(8010000L);
+
+ return r;
+ }
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV3.java
new file mode 100644
index 0000000..b45fd01
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV3.java
@@ -0,0 +1,168 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.LinkMode;
+import org.uic.barcode.ticket.api.asn.omv3.PassData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+ public class PassTimeZoneTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addPass1(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+ //issue date: 04-03-2021 12:30 UTC
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2021L);
+ issuingDetail.setIssuingTime(750L);
+ issuingDetail.setIssuingDay(63L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void addPass1(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ PassData otd = new PassData();
+ otd.setInfoText("pass");
+ otd.setClassCode(TravelClassType.first);
+ otd.setPassDescription("ONE COUNTRY");
+ otd.setValidFromDay(10L);
+ otd.setValidFromTime(0L);
+ otd.setValidUntilDay(10L);
+ otd.setValidUntilTime(1439L);
+ SequenceOfActivatedDays s = new SequenceOfActivatedDays();
+ otd.setActivatedDay(s);
+ s.add(0L);
+
+ tdd.setPass(otd);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+
+
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
+ populateLinkedTickets(sit);
+ controlDetail.setIncludedTickets(sit);
+ }
+
+ private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
+ TicketLinkType tlt = new TicketLinkType();
+ tlt.productOwnerIA5="test";
+ tlt.setTicketType(TicketType.pass);
+ tlt.setIssuerPNR("PNR");
+ tlt.setReferenceIA5("UED12435867");
+ tlt.setLinkMode(LinkMode.onlyValidInCombination);
+ tlt.setIssuerName("OEBB");
+ sequenceOfTicketLinkType.add(tlt);
+ }
+
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV3.java
new file mode 100644
index 0000000..9f2d89f
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV3.java
@@ -0,0 +1,202 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.PassengerType;
+import org.uic.barcode.ticket.api.asn.omv3.PlacesType;
+import org.uic.barcode.ticket.api.asn.omv3.PriceTypeType;
+import org.uic.barcode.ticket.api.asn.omv3.ReservationData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCarrierNum;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTariffType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.ServiceType;
+import org.uic.barcode.ticket.api.asn.omv3.TariffType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelClassType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+
+ public class ReservationTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //OpenTicket
+ DocumentData do1 = new DocumentData();
+ addReservation(do1);
+ ds.add(do1);
+
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+
+ private static void addReservation(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ ReservationData ticket = new ReservationData();
+ ticket.setTrainNum(123L);
+ ticket.setService(ServiceType.seat);
+ ticket.setReferenceNum(810123456789L);
+ ticket.setServiceBrandAbrUTF8("XYZ");
+ ticket.setServiceBrandNameUTF8("special train");
+ SequenceOfCarrierNum carriers = new SequenceOfCarrierNum();
+ carriers.add(1080L);
+ carriers.add(1181L);
+ ticket.setCarrierNum(carriers);
+ ticket.setFromStationNum(8100001L);
+ ticket.setToStationNum(800001L);
+ ticket.setNumberOfSupplements(1L);
+ ticket.setServiceBrand(100L);
+ ticket.setPrice(12345L);
+ ticket.setPriceType(PriceTypeType.supplement);
+
+ ticket.setPlaces(getPlaces());
+ ticket.setTariff(getTariffs());
+
+ ticket.setInfoText("reservation");
+ ticket.setClassCode(TravelClassType.first);
+ ticket.setDepartureDate(10L);
+ ticket.setDepartureTime(0L);
+ ticket.setArrivalDate(10L);
+ ticket.setArrivalTime(1439L);
+ tdd.setReservation(ticket);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static SequenceOfTariffType getTariffs() {
+ SequenceOfTariffType tariffs = new SequenceOfTariffType();
+
+ TariffType tariff = new TariffType();
+ tariff.setNumberOfPassengers(1L);
+ tariff.setRestrictedToCountryOfResidence(false);
+ tariff.setPassengerType(PassengerType.adult);
+ tariff.setTariffIdNum(72L);
+ tariff.setTariffDesc("Full Fare Adult");
+ tariffs.add(tariff);
+ TariffType tariff2 = new TariffType();
+ tariff2.setRestrictedToCountryOfResidence(false);
+ tariff2.setNumberOfPassengers(2L);
+ tariff2.setPassengerType(PassengerType.child);
+ tariff2.setTariffIdNum(73L);
+ tariff2.setTariffDesc("Full Fare Child");
+ tariffs.add(tariff2);
+ return tariffs;
+ }
+
+
+ private static PlacesType getPlaces() {
+ PlacesType places = new PlacesType();
+ places.setPlaceDescription("11-13");
+ places.setCoach("12");
+ return places;
+ }
+
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2018L);
+ issuingDetail.setIssuingDay(1L);
+ issuingDetail.setIssuingTime(600L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ }
+
+
+ /*
+ {
+ trailingCardIdNum 100
+ }
+ */
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV3.java
new file mode 100644
index 0000000..b2f1816
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV3.java
@@ -0,0 +1,184 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringUTF8;
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.StationPassageData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TicketLinkType;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+
+public class StationPassageTestTicketV3 {
+
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+
+ //StationPassage
+ DocumentData do2 = new DocumentData();
+ addStationPassage(do2);
+ ds.add(do2);
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+ /*
+ ticket stationPassage : {
+ productName "passage"
+ ,stationNameUTF8 { "Amsterdam" }
+ ,validFromDay 0
+ ,numberOfDaysValid 123
+ }
+ */
+ private static void addStationPassage(DocumentData dd) {
+ TicketDetailData tdd = new TicketDetailData();
+ StationPassageData sp = new StationPassageData();
+ sp.setProductName("passage");
+ sp.setValidFromDay(5L);
+ sp.setValidFromTime(0L);
+ sp.setValidUntilDay(5L);
+ sp.setValidUntilTime(1000L);
+ sp.setNumberOfDaysValid(5L);
+ SequenceOfStringUTF8 ss = new SequenceOfStringUTF8();
+ ss.add("Amsterdam");
+ sp.setStationNameUTF8(ss);
+ tdd.setStationPassage(sp);
+ dd.setTicket(tdd);
+ }
+
+
+ private static void populateTravelerData(TravelerData td) {
+ td.setGroupName("myGroup");
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("senior");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2018L);
+ issuingDetail.setIssuingDay(1L);
+ issuingDetail.setIssuingTime(600L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ /*
+ ,controlDetail {
+ identificationByCardReference {
+ { trailingCardIdNum 100 }
+ }
+ ,identificationByIdCard FALSE
+ ,identificationByPassportId FALSE
+ ,passportValidationRequired FALSE
+ ,onlineValidationRequired FALSE
+ ,ageCheckRequired FALSE
+ ,reductionCardCheckRequired FALSE
+ ,infoText "cd"
+ ,includedTickets {
+ { productOwnerIA5 "test" }
+ }
+ }
+ */
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
+ populateLinkedTickets(sit);
+ controlDetail.setIncludedTickets(sit);
+ }
+
+
+ /*
+ *
+ */
+ private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
+ TicketLinkType tlt = new TicketLinkType();
+ tlt.productOwnerIA5="test";
+ sequenceOfTicketLinkType.add(tlt);
+ }
+
+ /*
+ {
+ trailingCardIdNum 100
+ }
+ */
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+}
diff --git a/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV3.java
new file mode 100644
index 0000000..20bfdaa
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV3.java
@@ -0,0 +1,141 @@
+package org.uic.barcode.ticket.api.test.testtickets;
+
+import org.uic.barcode.ticket.api.asn.omv3.CardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.ControlData;
+import org.uic.barcode.ticket.api.asn.omv3.CustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.DocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.ExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.IssuingData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCardReferenceType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfCustomerStatusType;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfDocumentData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfExtensionData;
+import org.uic.barcode.ticket.api.asn.omv3.SequenceOfTravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.TicketDetailData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerData;
+import org.uic.barcode.ticket.api.asn.omv3.TravelerType;
+import org.uic.barcode.ticket.api.asn.omv3.UicRailTicketData;
+import org.uic.barcode.ticket.api.asn.omv3.VoucherData;
+
+ public class VoucherTestTicketV3 {
+
+ public static UicRailTicketData getUicTestTicket() {
+ UicRailTicketData ticket = new UicRailTicketData();
+ populateTicket(ticket);
+ return ticket;
+ }
+
+ private static void populateTicket(UicRailTicketData ticket) {
+
+ ticket.setControlDetail(new ControlData());
+ populate(ticket.getControlDetail());
+
+
+ ticket.setIssuingDetail(new IssuingData());
+ populateIssuingData(ticket.getIssuingDetail());
+
+ TravelerData td = new TravelerData();
+ populateTravelerData(td);
+ ticket.setTravelerDetail(td);
+
+ SequenceOfDocumentData ds = new SequenceOfDocumentData();
+
+ DocumentData do1 = new DocumentData();
+ addTicket(do1);
+ ds.add(do1);
+
+ ticket.setTransportDocument(ds);
+
+ SequenceOfExtensionData ed = new SequenceOfExtensionData();
+ populateExtensionSequence(ed);
+ ticket.setExtension(ed);
+
+ }
+
+
+ //issue date: 04-03-2021 12:30 UTC
+ private static void populateIssuingData(IssuingData issuingDetail) {
+ issuingDetail.setIssuingYear(2021L);
+ issuingDetail.setIssuingTime(750L);
+ issuingDetail.setIssuingDay(63L);
+ issuingDetail.setIssuingTime(600L);
+ issuingDetail.setIssuerPNR("issuerTestPNR");
+ issuingDetail.setSpecimen(true);
+ issuingDetail.setSecurePaperTicket(false);
+ issuingDetail.setActivated(true);
+ issuingDetail.setIssuedOnLine(12L);
+ }
+
+ private static void addTicket(DocumentData dd) {
+
+ TicketDetailData tdd = new TicketDetailData();
+ VoucherData ticket = new VoucherData();
+ ticket.setInfoText("coffee voucher");
+ ticket.setValidFromYear(2022L);
+ ticket.setValidFromDay(01L);
+ ticket.setValidUntilYear(2022L);
+ ticket.setValidUntilDay(01L);
+ ticket.setReferenceIA5("ACHE12345");
+ ticket.setProductOwnerIA5("COFFEEMACHINE");
+ ticket.setValue(500L);
+ tdd.setVoucher(ticket);
+ dd.setTicket(tdd);
+ }
+
+
+
+ private static void populateTravelerData(TravelerData td) {
+ SequenceOfTravelerType trs = new SequenceOfTravelerType();
+ TravelerType tr = new TravelerType();
+ tr.setIdCard("12345");
+ tr.setFirstName("John");
+ tr.setSecondName("Dow");
+ tr.setTicketHolder(true);
+ SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
+ CustomerStatusType cst = new CustomerStatusType();
+ cst.setCustomerStatusDescr("employee");
+ ts.add(cst);
+ tr.setStatus(ts);
+ trs.add(tr);
+ td.setTraveler(trs);
+ }
+
+
+
+
+
+ private static void populateExtensionSequence(SequenceOfExtensionData ed) {
+ ExtensionData ed1 = new ExtensionData();
+ ed1.setExtensionId("1");
+ byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
+ ed1.setExtensionData(ba1);
+ ExtensionData ed2 = new ExtensionData();
+ ed2.setExtensionId("2");
+ byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
+ ed2.setExtensionData(ba2);
+ ed.add(ed1);
+ ed.add(ed2);
+ }
+
+ private static void populate(ControlData controlDetail) {
+ controlDetail.infoText = "cd";
+ controlDetail.setAgeCheckRequired(false);
+ controlDetail.setIdentificationByIdCard(false);
+ controlDetail.setIdentificationByPassportId(false);
+ controlDetail.setOnlineValidationRequired(false);
+ controlDetail.setPassportValidationRequired(false);
+ controlDetail.setReductionCardCheckRequired(false);
+ controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
+ controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
+ }
+
+
+ private static CardReferenceType populateCardRefrence() {
+ CardReferenceType cr = new CardReferenceType();
+ cr.setTrailingCardIdNum(100L);
+ return cr;
+ }
+
+
+
+ }