From 12a426cfbd345a098f0dca7786e488988fb454fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Stranden=C3=A6s?= Date: Tue, 6 Nov 2018 13:47:01 +0100 Subject: [PATCH] =?UTF-8?q?gj=C3=B8r=20sender=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 10 +++++----- .../api/datatypes/types/pickup/PickupNotice.java | 9 ++++----- .../no/digipost/api/datatypes/types/pickup/Sender.java | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index 91241f51..ddfccc0e 100644 --- a/readme.md +++ b/readme.md @@ -224,15 +224,15 @@ Details about a pickup notice |Name|Type|Required|Description| |----|----|--------|-----------| |parcelId|String|yes|The id of the parcel in posten| -|parcelUUID|String|yes|The uuid of the parcel| +|parcelUUID|String|no|The uuid of the parcel| |barcode|[Barcode](#pickupnoticebarcode)|yes|Barcode| -|productName|String|yes|Mail Service product name| +|productName|String|no|Mail Service product name| |arrivalDateTime|ZonedDateTime|yes|ISO8601 full DateTime for arrival at pickup place| |returnDateTime|ZonedDateTime|yes|ISO8601 full DateTime for return back to sender| |recipient|[Recipient](#pickupnoticerecipient)|yes|The recipient of the parcel| -|sender|[Sender](#pickupnoticesender)|yes|The sender of the parcel| +|sender|[Sender](#pickupnoticesender)|no|The sender of the parcel| |pickupPlace|[PickupPlace](#pickupnoticepickupplace)|yes|where the parcel can be fetched| -|thePackage|[Package](#pickupnoticepackage)|yes|package information| +|thePackage|[Package](#pickupnoticepackage)|no|package information| |cost|[Cost](#pickupnoticecost)|no|Information about value, mva, customs processing and more| ### PickupNotice.Barcode @@ -265,7 +265,7 @@ Details about a pickup notice |Name|Type|Required|Description| |----|----|--------|-----------| -|name|String|yes|The senders name| +|name|String|no|The senders name| |reference|String|no|The senders reference| |address|[Address](#pickupnoticeaddress)|no|| 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 33d5729f..7883267d 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 @@ -30,7 +30,7 @@ public class PickupNotice implements DataType { @Valid String parcelId; - @XmlElement(name = "parcel-uuid", required = true) + @XmlElement(name = "parcel-uuid") @Description("The uuid of the parcel") String parcelUUID; @@ -38,7 +38,7 @@ public class PickupNotice implements DataType { @Description("Barcode") Barcode barcode; - @XmlElement(name = "product-name", required = true) + @XmlElement(name = "product-name") @Description("Mail Service product name") String productName; @@ -58,9 +58,8 @@ public class PickupNotice implements DataType { @Valid Recipient recipient; - @XmlElement(name = "sender", required = true) + @XmlElement(name = "sender") @Description("The sender of the parcel") - @NotNull @Valid Sender sender; @@ -70,7 +69,7 @@ public class PickupNotice implements DataType { @Valid PickupPlace pickupPlace; - @XmlElement(name = "package", required = true) + @XmlElement(name = "package") @Description("package information") Package thePackage; 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 817587f0..1b95ded4 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 @@ -18,11 +18,11 @@ @Wither public class Sender { - @XmlElement(name = "name", required = true) + @XmlElement(name = "name") @Description("The senders name") String name; - @XmlElement(name = "reference", required = false) + @XmlElement(name = "reference") @Description("The senders reference") String reference;