From 3193f9602933e325709de7e67dc18911b6595ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20Bergst=C3=B8l?= Date: Thu, 6 Feb 2020 10:24:38 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Erstatter=20@Wither=20med=20@With=20siden?= =?UTF-8?q?=20det=20n=C3=A5=20ikke=20lenger=20er=20experimental=20(lombok)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/no/digipost/api/datatypes/types/Address.java | 3 ++- .../java/no/digipost/api/datatypes/types/Appointment.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Barcode.java | 3 ++- .../java/no/digipost/api/datatypes/types/Boligdetaljer.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Event.java | 3 ++- .../java/no/digipost/api/datatypes/types/ExternalLink.java | 3 ++- .../digipost/api/datatypes/types/ForeignCurrencyPayment.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Heftelse.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Inkasso.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Link.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Matrikkel.java | 3 ++- .../no/digipost/api/datatypes/types/Omsetningshistorikk.java | 3 ++- src/main/java/no/digipost/api/datatypes/types/Residence.java | 3 ++- .../no/digipost/api/datatypes/types/ResidenceAddress.java | 3 ++- .../java/no/digipost/api/datatypes/types/SignedDocument.java | 3 ++- .../java/no/digipost/api/datatypes/types/TimeInterval.java | 4 ++-- .../java/no/digipost/api/datatypes/types/pickup/Cost.java | 3 ++- .../java/no/digipost/api/datatypes/types/pickup/Package.java | 3 ++- .../no/digipost/api/datatypes/types/pickup/PickupNotice.java | 3 ++- .../api/datatypes/types/pickup/PickupNoticeStatus.java | 3 ++- .../no/digipost/api/datatypes/types/pickup/PickupPlace.java | 3 ++- .../no/digipost/api/datatypes/types/pickup/Recipient.java | 3 ++- .../java/no/digipost/api/datatypes/types/pickup/Sender.java | 3 ++- .../no/digipost/api/datatypes/types/proof/CalendarDate.java | 3 ++- .../java/no/digipost/api/datatypes/types/proof/Period.java | 3 ++- .../java/no/digipost/api/datatypes/types/proof/Proof.java | 3 ++- .../no/digipost/api/datatypes/types/proof/ProofHolder.java | 3 ++- .../no/digipost/api/datatypes/types/proof/ValidPeriod.java | 3 ++- .../api/datatypes/types/proof/YearlyRepeatingPeriod.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/Customer.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/Delivery.java | 3 ++- .../java/no/digipost/api/datatypes/types/receipt/Payment.java | 3 ++- .../java/no/digipost/api/datatypes/types/receipt/Receipt.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/ReceiptLine.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/TaxiDetails.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/VatDetails.java | 3 ++- .../no/digipost/api/datatypes/types/receipt/VatLevel.java | 4 ++-- 37 files changed, 74 insertions(+), 39 deletions(-) diff --git a/src/main/java/no/digipost/api/datatypes/types/Address.java b/src/main/java/no/digipost/api/datatypes/types/Address.java index fef43cdc..c41ed6e3 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Address.java +++ b/src/main/java/no/digipost/api/datatypes/types/Address.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Address { @XmlElement(name = "street-address") diff --git a/src/main/java/no/digipost/api/datatypes/types/Appointment.java b/src/main/java/no/digipost/api/datatypes/types/Appointment.java index 9e101ece..5d056672 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Appointment.java +++ b/src/main/java/no/digipost/api/datatypes/types/Appointment.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -23,7 +24,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Appointment represents a meeting set for a specific place and time") public class Appointment implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/Barcode.java b/src/main/java/no/digipost/api/datatypes/types/Barcode.java index 8dd61dd7..b6908a9f 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Barcode.java +++ b/src/main/java/no/digipost/api/datatypes/types/Barcode.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Barcode { public static final String CODE_128 = "code-128"; diff --git a/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java b/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java index 27fb5934..5b9fc213 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java +++ b/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; @@ -25,7 +26,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Details about a Residence, and may be joined with Residence to retrieve the core fields of a Residence.") @ComplementedBy({Boligdetaljer.class}) public class Boligdetaljer implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/Event.java b/src/main/java/no/digipost/api/datatypes/types/Event.java index f8a37050..9553739c 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Event.java +++ b/src/main/java/no/digipost/api/datatypes/types/Event.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -21,7 +22,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Event represents an event that occurs over a time period or several days. Eg. a conference or an election") public class Event implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/ExternalLink.java b/src/main/java/no/digipost/api/datatypes/types/ExternalLink.java index c01a8490..1ed95eb8 100644 --- a/src/main/java/no/digipost/api/datatypes/types/ExternalLink.java +++ b/src/main/java/no/digipost/api/datatypes/types/ExternalLink.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -20,7 +21,7 @@ @XmlRootElement @Value -@Wither +@With @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @Description("An external URL, along with an optional description and deadline for resources such as a survey.") diff --git a/src/main/java/no/digipost/api/datatypes/types/ForeignCurrencyPayment.java b/src/main/java/no/digipost/api/datatypes/types/ForeignCurrencyPayment.java index 95fdb49a..72298b4e 100644 --- a/src/main/java/no/digipost/api/datatypes/types/ForeignCurrencyPayment.java +++ b/src/main/java/no/digipost/api/datatypes/types/ForeignCurrencyPayment.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -16,7 +17,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Payment in foreign currency with conversion") public class ForeignCurrencyPayment { diff --git a/src/main/java/no/digipost/api/datatypes/types/Heftelse.java b/src/main/java/no/digipost/api/datatypes/types/Heftelse.java index 84647e33..6a80e3f8 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Heftelse.java +++ b/src/main/java/no/digipost/api/datatypes/types/Heftelse.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import javax.validation.constraints.NotNull; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Heftelse { @XmlElement diff --git a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java index 8449ce33..6a68ee97 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java +++ b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -19,7 +20,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("A debt collection payment") public class Inkasso implements DataType { @XmlElement diff --git a/src/main/java/no/digipost/api/datatypes/types/Link.java b/src/main/java/no/digipost/api/datatypes/types/Link.java index d2798a70..f274d6f6 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Link.java +++ b/src/main/java/no/digipost/api/datatypes/types/Link.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.validation.WebUrl; @@ -19,7 +20,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("A link is a represention of an element in html with href-url and a text. description") public class Link { diff --git a/src/main/java/no/digipost/api/datatypes/types/Matrikkel.java b/src/main/java/no/digipost/api/datatypes/types/Matrikkel.java index c90e9c2f..00a59676 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Matrikkel.java +++ b/src/main/java/no/digipost/api/datatypes/types/Matrikkel.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import javax.validation.Valid; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Matrikkel { /** diff --git a/src/main/java/no/digipost/api/datatypes/types/Omsetningshistorikk.java b/src/main/java/no/digipost/api/datatypes/types/Omsetningshistorikk.java index 2ba0ac0d..1bcca9a9 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Omsetningshistorikk.java +++ b/src/main/java/no/digipost/api/datatypes/types/Omsetningshistorikk.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("A previous transaction or sale") public class Omsetningshistorikk { diff --git a/src/main/java/no/digipost/api/datatypes/types/Residence.java b/src/main/java/no/digipost/api/datatypes/types/Residence.java index aadedb77..de669669 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Residence.java +++ b/src/main/java/no/digipost/api/datatypes/types/Residence.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Residence is a way of linking separate data for the same residence") public class Residence implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/ResidenceAddress.java b/src/main/java/no/digipost/api/datatypes/types/ResidenceAddress.java index b722e5bb..a687ab60 100644 --- a/src/main/java/no/digipost/api/datatypes/types/ResidenceAddress.java +++ b/src/main/java/no/digipost/api/datatypes/types/ResidenceAddress.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class ResidenceAddress { public ResidenceAddress(String houseNumber, String streetName, String postalCode, String city) { diff --git a/src/main/java/no/digipost/api/datatypes/types/SignedDocument.java b/src/main/java/no/digipost/api/datatypes/types/SignedDocument.java index 6f067a54..2847005a 100644 --- a/src/main/java/no/digipost/api/datatypes/types/SignedDocument.java +++ b/src/main/java/no/digipost/api/datatypes/types/SignedDocument.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Details about a signed document") public class SignedDocument implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/TimeInterval.java b/src/main/java/no/digipost/api/datatypes/types/TimeInterval.java index 5006d58c..127e4558 100644 --- a/src/main/java/no/digipost/api/datatypes/types/TimeInterval.java +++ b/src/main/java/no/digipost/api/datatypes/types/TimeInterval.java @@ -4,7 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; -import lombok.experimental.Wither; +import lombok.With; import no.digipost.api.datatypes.documentation.Description; import javax.validation.constraints.NotNull; @@ -17,7 +17,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class TimeInterval { @XmlElement(name = "start-time", required = true) diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/Cost.java b/src/main/java/no/digipost/api/datatypes/types/pickup/Cost.java index dfcd77fb..47aac708 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/Cost.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/Cost.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Cost { @XmlElement(name = "value-to-be-payed", required = true) diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/Package.java b/src/main/java/no/digipost/api/datatypes/types/pickup/Package.java index c0d68406..5c98ffff 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/Package.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/Package.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -14,7 +15,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Package { @XmlElement(name = "length") diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java index 987b111b..ca236b1d 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; @@ -24,7 +25,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Details about a pickup notice") @ComplementedBy({PickupNotice.class, PickupNoticeStatus.class}) public class PickupNotice implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNoticeStatus.java b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNoticeStatus.java index fa5be3c5..1b661cf9 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNoticeStatus.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNoticeStatus.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -20,7 +21,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Updates to status for PickupNotice") public class PickupNoticeStatus implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupPlace.java b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupPlace.java index 53fb90e3..7cffc3ad 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupPlace.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupPlace.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Address; @@ -16,7 +17,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class PickupPlace { @XmlElement(name = "name", required = true) diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/Recipient.java b/src/main/java/no/digipost/api/datatypes/types/pickup/Recipient.java index 9824a4a1..cde6d999 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/Recipient.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/Recipient.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Address; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Recipient { @XmlElement(name = "name", required = true) diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/Sender.java b/src/main/java/no/digipost/api/datatypes/types/pickup/Sender.java index 1b95ded4..1046b996 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/Sender.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/Sender.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Address; @@ -15,7 +16,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Sender { @XmlElement(name = "name") diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/CalendarDate.java b/src/main/java/no/digipost/api/datatypes/types/proof/CalendarDate.java index d5674fe8..b378a27d 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/CalendarDate.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/CalendarDate.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class CalendarDate { @XmlElement(name = "month", required = true) @Size(min = 1, max = 12) diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/Period.java b/src/main/java/no/digipost/api/datatypes/types/proof/Period.java index f90f3e10..17a69508 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/Period.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/Period.java @@ -5,6 +5,7 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.validation.ValidPeriode; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @EqualsAndHashCode(callSuper = false) @ValidPeriode public class Period { diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java b/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java index 0ed11f8d..49b58d37 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -24,7 +25,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Represents a legal document (Certificate, Licence, Permit, etc.) issued to a single person, valid for one or more time periods.") public class Proof implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/ProofHolder.java b/src/main/java/no/digipost/api/datatypes/types/proof/ProofHolder.java index afe88b7b..e6b9ddce 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/ProofHolder.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/ProofHolder.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Address; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class ProofHolder { @XmlElement(name = "firstname", required = true) @NotNull diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/ValidPeriod.java b/src/main/java/no/digipost/api/datatypes/types/proof/ValidPeriod.java index 103aa31b..a0115ac5 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/ValidPeriod.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/ValidPeriod.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -17,7 +18,7 @@ @Value @XmlAccessorType(XmlAccessType.FIELD) @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class ValidPeriod { @XmlElement(name = "period") diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/YearlyRepeatingPeriod.java b/src/main/java/no/digipost/api/datatypes/types/proof/YearlyRepeatingPeriod.java index 821364b7..1fab94c4 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/YearlyRepeatingPeriod.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/YearlyRepeatingPeriod.java @@ -5,6 +5,7 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -19,7 +20,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @EqualsAndHashCode(callSuper = false) public class YearlyRepeatingPeriod { @XmlElement(name = "start-year") diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/Customer.java b/src/main/java/no/digipost/api/datatypes/types/receipt/Customer.java index a2c79d9b..6684ae97 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/Customer.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/Customer.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.types.Address; @@ -14,7 +15,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Customer { @XmlElement String name; diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/Delivery.java b/src/main/java/no/digipost/api/datatypes/types/receipt/Delivery.java index a739fd06..8b7c9aff 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/Delivery.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/Delivery.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.types.Address; @@ -14,7 +15,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class Delivery { @XmlElement String name; diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/Payment.java b/src/main/java/no/digipost/api/datatypes/types/receipt/Payment.java index 328066a7..d4d30b6d 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/Payment.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/Payment.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.ForeignCurrencyPayment; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Contains details about a payment carried out as part of this purchase") public class Payment { diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java b/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java index c0fd1397..22ce5d11 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -26,7 +27,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Receipt represents a document containing details about a purchase") public class Receipt implements DataType { diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/ReceiptLine.java b/src/main/java/no/digipost/api/datatypes/types/receipt/ReceiptLine.java index a39d2608..1e2639b8 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/ReceiptLine.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/ReceiptLine.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Contains details about a single item (line) on the receipt") public class ReceiptLine { diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/TaxiDetails.java b/src/main/java/no/digipost/api/datatypes/types/receipt/TaxiDetails.java index 61b24dda..b4786ce2 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/TaxiDetails.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/TaxiDetails.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import no.digipost.api.datatypes.documentation.Description; @@ -18,7 +19,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With @Description("Details for taxi receipts") public class TaxiDetails { @XmlElement diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/VatDetails.java b/src/main/java/no/digipost/api/datatypes/types/receipt/VatDetails.java index 57660dee..d10144e2 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/VatDetails.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/VatDetails.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; +import lombok.With; import lombok.experimental.Wither; import javax.validation.Valid; @@ -17,7 +18,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class VatDetails { @XmlElement @Valid diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/VatLevel.java b/src/main/java/no/digipost/api/datatypes/types/receipt/VatLevel.java index 134823af..18887f7f 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/VatLevel.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/VatLevel.java @@ -4,7 +4,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; -import lombok.experimental.Wither; +import lombok.With; import no.digipost.api.datatypes.documentation.Description; import javax.xml.bind.annotation.XmlElement; @@ -15,7 +15,7 @@ @Value @AllArgsConstructor @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) -@Wither +@With public class VatLevel { @XmlElement BigDecimal grossAmount; From 3dcbbf0667b4a1a170c7d6df58ecead89f437f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20Bergst=C3=B8l?= Date: Thu, 6 Feb 2020 12:14:35 +0100 Subject: [PATCH 2/3] Add Language to all the datatypes that have fields that contain prose like information which can be written in different languages. This should then be used to correct language in de displayed document. --- datatypes-examples.xml | 6 ++ datatypes.xsd | 14 +++++ readme.md | 60 +++++++++++++++++++ .../api/datatypes/types/Appointment.java | 6 +- .../api/datatypes/types/Boligdetaljer.java | 39 +++++++----- .../digipost/api/datatypes/types/Event.java | 5 ++ .../api/datatypes/types/Hjemmelshaver.java | 1 - .../digipost/api/datatypes/types/Inkasso.java | 9 +-- .../api/datatypes/types/Language.java | 5 ++ .../datatypes/types/pickup/PickupNotice.java | 10 +++- .../api/datatypes/types/proof/Proof.java | 7 ++- .../api/datatypes/types/receipt/Receipt.java | 37 +++++++++--- 12 files changed, 166 insertions(+), 33 deletions(-) create mode 100644 src/main/java/no/digipost/api/datatypes/types/Language.java diff --git a/datatypes-examples.xml b/datatypes-examples.xml index d688cffa..fdc01c6a 100644 --- a/datatypes-examples.xml +++ b/datatypes-examples.xml @@ -16,6 +16,7 @@ Informasjon om Oslo City Røntgen Oslo City Røntgen er et spesialistsenter for avansert bildediagnostikk. + NB @@ -63,6 +64,7 @@ Gå til avsenders side for å gjøre en handling Ta meg til handling! + NB @@ -96,6 +98,7 @@ https://valg.no Les mer om valget på valg.no + NB @@ -181,6 +184,7 @@ READY_FOR_PICKUP POSTEN + NB @@ -230,6 +234,7 @@ Regler Det er ikke lov å rive ut sider i bøkene, eller søle med ketchup. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet urna condimentum, pulvinar neque ac, tempor tellus. Vestibulum ante ipsum primis in faucibus orci luctus et + NB @@ -330,6 +335,7 @@ 123456 HG1234HH8778 Hip Coffee to the good citizens of Løkka + NB diff --git a/datatypes.xsd b/datatypes.xsd index 29d0c208..9915a509 100644 --- a/datatypes.xsd +++ b/datatypes.xsd @@ -44,6 +44,7 @@ + @@ -76,6 +77,7 @@ + @@ -155,6 +157,7 @@ + @@ -240,6 +243,7 @@ + @@ -305,6 +309,7 @@ + @@ -384,6 +389,7 @@ + @@ -439,6 +445,14 @@ + + + + + + + + diff --git a/readme.md b/readme.md index 91f76162..e08569d0 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,7 @@ Appointment represents a meeting set for a specific place and time |address|[Address](#appointmentaddress)|no|| |subTitle|String|no|Example: MR-undersøkelse av høyre kne| |info|List|no|Additional sections of information (max 2) with a title and text| +|language|[Language](#appointmentlanguage)|no|Languange for the document| ### Appointment.Address @@ -41,6 +42,14 @@ Appointment represents a meeting set for a specific place and time |city|String|no|| |country|String|no|| +### Appointment.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -60,6 +69,7 @@ Appointment represents a meeting set for a specific place and time Informasjon om Oslo City Røntgen Oslo City Røntgen er et spesialistsenter for avansert bildediagnostikk. + NB ``` @@ -85,6 +95,7 @@ Details about a Residence, and may be joined with Residence to retrieve the core |andelsnummer|String|no|| |heftelser|List|no|| |callToAction|[ExternalLink](#boligdetaljerexternallink)|no|An optional ExternalLink prompting the user to perform an action on an external site| +|language|[Language](#boligdetaljerlanguage)|no|Languange for the document| ### Boligdetaljer.Residence @@ -124,6 +135,14 @@ Details about a Residence, and may be joined with Residence to retrieve the core |description|String|no|A short, optional text-field, describing the external link.| |buttonText|String|no|Optional text which will be displayed on the button.| +### Boligdetaljer.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -172,6 +191,7 @@ Details about a Residence, and may be joined with Residence to retrieve the core Gå til avsenders side for å gjøre en handling Ta meg til handling! + NB ``` @@ -194,6 +214,7 @@ Event represents an event that occurs over a time period or several days. Eg. a |barcodeLabel|String|no|Optional label for barcode. null yield default in gui, eg. ''| |barcode|[Barcode](#eventbarcode)|no|Barcode| |links|List|no|Links for releated information to the appointment| +|language|[Language](#eventlanguage)|no|Languange for the document| ### Event.Address @@ -214,6 +235,14 @@ Event represents an event that occurs over a time period or several days. Eg. a |barcodeText|String|no|Barcode text can be used to describe the barcode| |showValueInBarcode|Boolean|no|If true, the barcode will render its value as part of the image| +### Event.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -248,6 +277,7 @@ Event represents an event that occurs over a time period or several days. Eg. a https://valg.no Les mer om valget på valg.no + NB ``` @@ -354,6 +384,7 @@ Details about a pickup notice |cost|[Cost](#pickupnoticecost)|no|Information about value, mva, customs processing and more| |status|[Status](#pickupnoticestatus)|no|The state the package is at present time| |tags|Set|no|Tags to describe the document| +|language|[Language](#pickupnoticelanguage)|no|Languange for the document| ### PickupNotice.Barcode @@ -432,6 +463,14 @@ Valid values: * UNKNOWN * DEVIATION +### PickupNotice.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -497,6 +536,7 @@ Valid values: READY_FOR_PICKUP POSTEN + NB ``` @@ -548,6 +588,7 @@ Represents a legal document (Certificate, Licence, Permit, etc.) issued to a sin |proofIdValue|String|no|A field for extra information identifying this proof, such as a membership number| |attribute|List|no|Extra information for the proof, a set of key-value pairs| |info|List|no|Extra instructions for the holder of the proof, such as special terms| +|language|[Language](#prooflanguage)|no|Languange for the document| ### Proof.ValidPeriod @@ -601,6 +642,14 @@ Represents a legal document (Certificate, Licence, Permit, etc.) issued to a sin |city|String|no|| |country|String|no|| +### Proof.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -646,6 +695,7 @@ Represents a legal document (Certificate, Licence, Permit, etc.) issued to a sin Regler Det er ikke lov å rive ut sider i bøkene, eller søle med ketchup. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet urna condimentum, pulvinar neque ac, tempor tellus. Vestibulum ante ipsum primis in faucibus orci luctus et + NB ``` @@ -679,6 +729,7 @@ Receipt represents a document containing details about a purchase |orderNumber|String|no|| |membershipNumber|String|no|| |comment|String|no|| +|language|[Language](#receiptlanguage)|no|Languange for the document| ### Receipt.Address @@ -741,6 +792,14 @@ Receipt represents a document containing details about a purchase |address|[Address](#receiptaddress)|no|| |terms|String|no|| +### Receipt.Language + +Valid values: + +* NB +* NN +* EN + ### XML ```xml @@ -842,6 +901,7 @@ Receipt represents a document containing details about a purchase 123456 HG1234HH8778 Hip Coffee to the good citizens of Løkka + NB ``` diff --git a/src/main/java/no/digipost/api/datatypes/types/Appointment.java b/src/main/java/no/digipost/api/datatypes/types/Appointment.java index 5d056672..f6d3126e 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Appointment.java +++ b/src/main/java/no/digipost/api/datatypes/types/Appointment.java @@ -5,7 +5,6 @@ import lombok.NoArgsConstructor; import lombok.Value; import lombok.With; -import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -63,6 +62,10 @@ public class Appointment implements DataType { @Description("Additional sections of information (max 2) with a title and text") List info; + @XmlElement(defaultValue = "NB") + @Description("Languange for the document") + Language language; + @Override public Appointment withDefaultsForMissingOptionalValues() { return endTime == null ? this.withEndTime(startTime.plusMinutes(30)) : this; @@ -76,5 +79,6 @@ public Appointment withDefaultsForMissingOptionalValues() { , Address.EXAMPLE , "Undersøke smerter i ryggen" , singletonList(new Info("Informasjon om Oslo City Røntgen", "Oslo City Røntgen er et spesialistsenter for avansert bildediagnostikk.")) + , Language.NB ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java b/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java index 5b9fc213..e2fbdb00 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java +++ b/src/main/java/no/digipost/api/datatypes/types/Boligdetaljer.java @@ -5,7 +5,6 @@ import lombok.NoArgsConstructor; import lombok.Value; import lombok.With; -import lombok.experimental.Wither; import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -16,7 +15,6 @@ import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; - import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Collections; @@ -61,18 +59,15 @@ public class Boligdetaljer implements DataType { @Valid List omsetningshistorikk; - // Validering? @XmlElement @Size(max = 20) String organisasjonsnummer; @XmlElement @Size(max = 10) - // Validering: "H0101" String bruksenhet; @XmlElement - // validering? String andelsnummer; @XmlElement @@ -84,19 +79,31 @@ public class Boligdetaljer implements DataType { @Description("An optional ExternalLink prompting the user to perform an action on an external site") ExternalLink callToAction; + @XmlElement(defaultValue = "NB") + @Description("Languange for the document") + Language language; + public Boligdetaljer(Residence residence, List hjemmelshavere, Integer bruksareal, Integer antallOppholdsrom, - Integer antallBaderom, List omsetningshistorikk, String organisasjonsnummer, String bruksenhet, - String andelsnummer, List heftelser) { + Integer antallBaderom, List omsetningshistorikk, String organisasjonsnummer, String bruksenhet, + String andelsnummer, List heftelser) { this(residence, hjemmelshavere, bruksareal, antallOppholdsrom, antallBaderom, omsetningshistorikk, organisasjonsnummer, - bruksenhet, andelsnummer, heftelser, null); + bruksenhet, andelsnummer, heftelser, null, Language.NB); } - public static Boligdetaljer EXAMPLE = new Boligdetaljer(Residence.EXAMPLE, - Collections.singletonList(new Hjemmelshaver("Gunnar Gunnersen", "gunnargunnar@gunn.ar")), - 59, 3, 4, - Collections.singletonList(new Omsetningshistorikk(ZonedDateTime.of(2017, 7, 27, 10, 0, 0, 0, ZoneId.systemDefault()), - "Privat salg av sekundærbolig", "Bill Isalg", "Cooper Coopersen", 12345678L)), - "123456789", "H1337", "42", - Collections.singletonList(new Heftelse("TNT ASA", "Pantedokument", "3000000000")), - ExternalLink.EXAMPLE_NO_DEADLINE); + public static Boligdetaljer EXAMPLE = new Boligdetaljer( + Residence.EXAMPLE + , Collections.singletonList(new Hjemmelshaver("Gunnar Gunnersen", "gunnargunnar@gunn.ar")) + , 59, 3, 4 + , Collections.singletonList(new Omsetningshistorikk(ZonedDateTime.of(2017, 7, 27, 10, 0, 0, 0, ZoneId.systemDefault()) + , "Privat salg av sekundærbolig" + , "Bill Isalg" + , "Cooper Coopersen" + , 12345678L)) + , "123456789" + , "H1337" + , "42" + , Collections.singletonList(new Heftelse("TNT ASA", "Pantedokument", "3000000000")) + , ExternalLink.EXAMPLE_NO_DEADLINE + , Language.NB + ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/Event.java b/src/main/java/no/digipost/api/datatypes/types/Event.java index 9553739c..6ba753cd 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Event.java +++ b/src/main/java/no/digipost/api/datatypes/types/Event.java @@ -78,6 +78,10 @@ public class Event implements DataType { @Description("Links for releated information to the appointment") List links; + @XmlElement + @Description("Languange for the document") + Language language; + public static Event EXAMPLE = new Event( "Kommunestyre- og fylkestingvalg" , singletonList(TimeInterval.EXAMPLE) @@ -90,5 +94,6 @@ public class Event implements DataType { , "Barcode for use on election day:" , Barcode.EXAMPLE , singletonList(Link.EXAMPLE) + , Language.NB ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/Hjemmelshaver.java b/src/main/java/no/digipost/api/datatypes/types/Hjemmelshaver.java index 86b4d657..4ca47b9a 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Hjemmelshaver.java +++ b/src/main/java/no/digipost/api/datatypes/types/Hjemmelshaver.java @@ -23,6 +23,5 @@ public class Hjemmelshaver { @XmlElement @Size(max = 50) - // TODO: Add email-validator String email; } diff --git a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java index 6a68ee97..47207c08 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java +++ b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java @@ -5,7 +5,6 @@ import lombok.NoArgsConstructor; import lombok.Value; import lombok.With; -import lombok.experimental.Wither; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; @@ -41,8 +40,10 @@ public class Inkasso implements DataType { @Size(max = 25) String kid; - public static Inkasso EXAMPLE = new Inkasso(ExternalLink.EXAMPLE_NO_DEADLINE, - ZonedDateTime.of(2019, 12, 10, 0, 0, 0, 0, ZoneId.systemDefault()), - BigDecimal.valueOf(42), "01235424320", "1435025439583420243982723"); + public static Inkasso EXAMPLE = new Inkasso( + ExternalLink.EXAMPLE_NO_DEADLINE + , ZonedDateTime.of(2019, 12, 10, 0, 0, 0, 0, ZoneId.systemDefault()) + , BigDecimal.valueOf(42), "01235424320", "1435025439583420243982723" + ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/Language.java b/src/main/java/no/digipost/api/datatypes/types/Language.java new file mode 100644 index 00000000..5035e3a0 --- /dev/null +++ b/src/main/java/no/digipost/api/datatypes/types/Language.java @@ -0,0 +1,5 @@ +package no.digipost.api.datatypes.types; + +public enum Language { + NB, NN, EN; +} diff --git a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java index ca236b1d..b763c701 100644 --- a/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java +++ b/src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java @@ -9,6 +9,7 @@ import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; +import no.digipost.api.datatypes.types.Language; import no.digipost.api.datatypes.types.Tag; import no.digipost.api.datatypes.types.Barcode; @@ -91,6 +92,10 @@ public class PickupNotice implements DataType { @Description("Tags to describe the document") Set tags; + @XmlElement(defaultValue = "NB") + @Description("Languange for the document") + Language language; + @Override public PickupNotice withDefaultsForMissingOptionalValues() { if (status == null) { @@ -113,8 +118,9 @@ public PickupNotice withDefaultsForMissingOptionalValues() { , PickupPlace.EXAMPLE , Package.EXAMPLE , Cost.EXAMPLE - , Status.READY_FOR_PICKUP, - Collections.singleton(Tag.POSTEN) + , Status.READY_FOR_PICKUP + , Collections.singleton(Tag.POSTEN) + , Language.NB ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java b/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java index 49b58d37..0ddf4fea 100644 --- a/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java +++ b/src/main/java/no/digipost/api/datatypes/types/proof/Proof.java @@ -9,6 +9,7 @@ import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Info; +import no.digipost.api.datatypes.types.Language; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; @@ -79,6 +80,9 @@ public class Proof implements DataType { @Description("Extra instructions for the holder of the proof, such as special terms") List info; + @XmlElement(defaultValue = "NB") + @Description("Languange for the document") + Language language; public static Proof EXAMPLE = new Proof( @@ -91,6 +95,7 @@ public class Proof implements DataType { "Lånekortnummer", "a-132415124-xyzzy-21341", singletonList(new Info("Kaffeklubb", "Premium deluxe medlem")), - singletonList(new Info("Regler", "Det er ikke lov å rive ut sider i bøkene, eller søle med ketchup. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet urna condimentum, pulvinar neque ac, tempor tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ")) + singletonList(new Info("Regler", "Det er ikke lov å rive ut sider i bøkene, eller søle med ketchup. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet urna condimentum, pulvinar neque ac, tempor tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ")), + Language.NB ); } diff --git a/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java b/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java index 22ce5d11..c9f237c6 100644 --- a/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java +++ b/src/main/java/no/digipost/api/datatypes/types/receipt/Receipt.java @@ -10,6 +10,7 @@ import no.digipost.api.datatypes.documentation.Description; import no.digipost.api.datatypes.types.Address; import no.digipost.api.datatypes.types.Barcode; +import no.digipost.api.datatypes.types.Language; import javax.validation.Valid; import javax.validation.constraints.NotNull; @@ -127,13 +128,33 @@ public class Receipt implements DataType { @XmlElement String comment; - public static Receipt EXAMPLE = new Receipt("F96B6805-2453-478A-B58B-CCDFA07E21ED", "364567", - ZonedDateTime.of(2018, 5, 27, 10, 0, 0, 0, ZoneId.systemDefault()), - ReceiptLine.EXAMPLE.getTotalPrice(), ReceiptLine.EXAMPLE.getTotalVat(), - "NOK", "Benny", "15", - "7F5A1EFF-ECAE-48A7-A07F-38D87576F815", - "Grünerløkka Hip Coffee", "12345678", Address.EXAMPLE, "123456789", Barcode.EXAMPLE, - singletonList(Payment.EXAMPLE), singletonList(ReceiptLine.EXAMPLE), TaxiDetails.EXAMPLE, - Customer.EXAMPLE, Delivery.EXAMPLE, "123456", "HG1234HH8778", "Hip Coffee to the good citizens of Løkka"); + @XmlElement(defaultValue = "NB") + @Description("Languange for the document") + Language language; + + public static Receipt EXAMPLE = new Receipt( + "F96B6805-2453-478A-B58B-CCDFA07E21ED" + , "364567" + , ZonedDateTime.of(2018, 5, 27, 10, 0, 0, 0, ZoneId.systemDefault()) + , ReceiptLine.EXAMPLE.getTotalPrice() + , ReceiptLine.EXAMPLE.getTotalVat() + , "NOK" + , "Benny" + , "15" + , "7F5A1EFF-ECAE-48A7-A07F-38D87576F815" + , "Grünerløkka Hip Coffee", "12345678" + , Address.EXAMPLE + , "123456789" + , Barcode.EXAMPLE + , singletonList(Payment.EXAMPLE) + , singletonList(ReceiptLine.EXAMPLE) + , TaxiDetails.EXAMPLE + , Customer.EXAMPLE + , Delivery.EXAMPLE + , "123456" + , "HG1234HH8778" + , "Hip Coffee to the good citizens of Løkka" + , Language.NB + ); } From a47835f76eae9589ad9d14befdd9f97e8092b3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20Bergst=C3=B8l?= Date: Thu, 6 Feb 2020 12:26:07 +0100 Subject: [PATCH 3/3] Release with github-actions by bumping the parent pom to activate the correct plugins --- .mvn/maven.config | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mvn/maven.config b/.mvn/maven.config index 0db77b80..75848f4a 100644 --- a/.mvn/maven.config +++ b/.mvn/maven.config @@ -1 +1 @@ --P build-sources-and-javadoc +-Pbuild-sources-and-javadoc diff --git a/pom.xml b/pom.xml index cabda500..cf056a5c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ no.digipost digipost-open-super-pom - 4 + 6 digipost-data-types