diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-04-12 19:25:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 19:25:09 +0200 |
commit | c3d1c3ec323c1321b1e81bfbfed38f022c66a207 (patch) | |
tree | f163bda9d7fad6fe354c2e8b9fa53980c86d2eab /src/main/java/org/uic/barcode/ticket/api/asn/omv2 | |
parent | Merge pull request #20 from UnionInternationalCheminsdeFer/fix_train_link (diff) | |
parent | included open ticket test (diff) | |
download | UIC-barcode-1.2.4.tar UIC-barcode-1.2.4.tar.gz UIC-barcode-1.2.4.tar.bz2 UIC-barcode-1.2.4.tar.lz UIC-barcode-1.2.4.tar.xz UIC-barcode-1.2.4.tar.zst UIC-barcode-1.2.4.zip |
Diffstat (limited to '')
11 files changed, 43 insertions, 25 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/CountermarkData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/CountermarkData.java index 435c6ef..aefdc3b 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/CountermarkData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/CountermarkData.java @@ -136,7 +136,7 @@ public class CountermarkData extends Object { @Asn1Optional public Long validFromUTCOffset;
@FieldOrder(order = 25)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 26)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/FIPTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/FIPTicketData.java index c6a98e4..447c994 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/FIPTicketData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/FIPTicketData.java @@ -70,7 +70,7 @@ public class FIPTicketData extends Object { @Asn1Optional public Long validFromDay;
@FieldOrder(order = 7)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 8)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/IncludedOpenTicketType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/IncludedOpenTicketType.java index cef0b02..35a9c73 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/IncludedOpenTicketType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/IncludedOpenTicketType.java @@ -27,12 +27,16 @@ 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() {
}
@@ -68,6 +72,7 @@ public class IncludedOpenTicketType extends Object { @FieldOrder(order = 8)
@IntRange(minValue=-1,maxValue=700)
+ @Asn1Default(value = "0")
@Asn1Optional public Long validFromDay;
@FieldOrder(order = 9)
@@ -79,7 +84,8 @@ public class IncludedOpenTicketType extends Object { @Asn1Optional public Long validFromUTCOffset;
@FieldOrder(order = 11)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
+ @Asn1Default(value = "0")
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 12)
@@ -91,7 +97,6 @@ public class IncludedOpenTicketType extends Object { @Asn1Optional public Long validUntilUTCOffset;
@FieldOrder(order = 14)
- @Asn1Default(value="second")
@Asn1Optional public TravelClassType classCode;
@FieldOrder(order = 15)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/OpenTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/OpenTicketData.java index 9900640..44a7188 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/OpenTicketData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/OpenTicketData.java @@ -129,7 +129,7 @@ public class OpenTicketData extends Object { @FieldOrder(order = 22)
@Asn1Default(value = "0")
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 23)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/PassData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/PassData.java index dbc81c3..dad76dc 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/PassData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/PassData.java @@ -91,7 +91,7 @@ public class PassData extends Object { @Asn1Optional public Long validFromUTCOffset;
@FieldOrder(order = 12)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 13)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/RouteSectionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/RouteSectionType.java index e0f9c46..4d94ee8 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/RouteSectionType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/RouteSectionType.java @@ -25,7 +25,9 @@ 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() {
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/StationPassageData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/StationPassageData.java index a378bb7..1e6c720 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/StationPassageData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/StationPassageData.java @@ -105,7 +105,7 @@ public class StationPassageData extends Object { @FieldOrder(order = 17)
@Asn1Default(value="0")
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Optional public Long validUntilDay;
@FieldOrder(order = 18)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TrainLinkType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TrainLinkType.java index 16a101e..4724db6 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TrainLinkType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TrainLinkType.java @@ -43,7 +43,7 @@ public class TrainLinkType extends Object { @Asn1Optional public String trainIA5;
@FieldOrder(order = 2)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
public Long travelDate;
@FieldOrder(order = 3)
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TravelerType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TravelerType.java index b0efae0..30a7dfc 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TravelerType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/TravelerType.java @@ -78,31 +78,35 @@ public class TravelerType extends Object { @Asn1Optional public Long yearOfBirth;
@FieldOrder(order = 10)
- @IntRange(minValue=0,maxValue=366)
- @Asn1Optional public Long dayOfBirth;
-
+ @IntRange(minValue=1,maxValue=12)
+ @Asn1Optional public Long monthOfBirth;
+
@FieldOrder(order = 11)
- public Boolean ticketHolder = true;
+ @IntRange(minValue=1,maxValue=31)
+ @Asn1Optional public Long dayOfBirth;
@FieldOrder(order = 12)
- @Asn1Optional public PassengerType passengerType;
+ public Boolean ticketHolder = true;
@FieldOrder(order = 13)
- @Asn1Optional public Boolean passengerWithReducedMobility;
+ @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 = 15)
+ @FieldOrder(order = 16)
@IntRange(minValue=1,maxValue=999)
@Asn1Optional public Long countryOfPassport;
- @FieldOrder(order = 16)
+ @FieldOrder(order = 17)
@IntRange(minValue=1,maxValue=999)
@Asn1Optional public Long countryOfIdCard;
- @FieldOrder(order = 17)
+ @FieldOrder(order = 18)
@Asn1Optional public SequenceOfCustomerStatusType status;
@@ -286,8 +290,14 @@ public class TravelerType extends Object { 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;
@@ -296,9 +306,9 @@ public class TravelerType extends Object { cal.setTime(date);
this.yearOfBirth = new Long( cal.get(Calendar.YEAR));
- this.dayOfBirth = new Long (cal.get(Calendar.DAY_OF_YEAR));
+ this.monthOfBirth = new Long(cal.get(Calendar.MONTH) + 1);
+ this.dayOfBirth = new Long (cal.get(Calendar.DAY_OF_MONTH));
-
}
public Date getDateOfBirth() {
@@ -310,13 +320,15 @@ public class TravelerType extends Object { cal.clear();
cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.yearOfBirth.intValue());
- cal.set(Calendar.DAY_OF_YEAR, this.dayOfBirth.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/omv2/ValidityPeriodType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ValidityPeriodType.java index 7b08f73..e3b9aa6 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ValidityPeriodType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/ValidityPeriodType.java @@ -34,7 +34,7 @@ public class ValidityPeriodType extends Object { }
@FieldOrder(order = 0)
- @IntRange(minValue=0,maxValue=700)
+ @IntRange(minValue=-1,maxValue=700)
@Asn1Default(value="0")
@Asn1Optional public Long validFromDay;
@@ -47,7 +47,7 @@ public class ValidityPeriodType extends Object { @Asn1Optional public Long validFromUTCOffset;
@FieldOrder(order = 3)
- @IntRange(minValue=0,maxValue=370)
+ @IntRange(minValue=-1,maxValue=370)
@Asn1Default(value="0")
@Asn1Optional public Long validUntilDay;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/VatDetailType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/VatDetailType.java index adfb4e8..e39c22e 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv2/VatDetailType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv2/VatDetailType.java @@ -27,7 +27,6 @@ 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() {
|