-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Et første utkast til ny datatype for hentelapper (Sender, Recipient, …
…PickupPoint og noen andre felter) Noen designtanker: Mottager, avsender og hente-sted har alle adresser i en eller annen form. Jeg tenker at vi like gjerne kan generalisere dette selv om f.eks hente-sted (pickup-place) ikke har gateadresse slik det ser ut av xml-eksempler jeg har sett fra posten.
- Loading branch information
Showing
8 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|[Category](#category)|Category is a way to specify which category the data of a document is related to.| | ||
|[ExternalLink](#externallink)|An external URL, along with an optional description and deadline for resources such as a survey.| | ||
|[Payslip](#payslip)|For treating documents as Payslips.| | ||
|[PickupNotice](#pickupnotice)|Details about a signed document| | ||
|[Receipt](#receipt)|Receipt represents a document containing details about a purchase| | ||
|[Residence](#residence)|Residence is a way of linking separate data for the same residence| | ||
|[SignedDocument](#signeddocument)|Details about a signed document| | ||
|
@@ -213,6 +214,89 @@ For treating documents as Payslips. | |
<payslip xmlns="http://api.digipost.no/schema/datatypes"/> | ||
``` | ||
|
||
## PickupNotice | ||
|
||
Details about a signed document | ||
|
||
### Fields | ||
|
||
|Name|Type|Required|Description| | ||
|----|----|--------|-----------| | ||
|parcelId|String|yes|The id of the parcel in posten| | ||
|parcelUUID|String|yes|The uuid of the parcel| | ||
|barcode|Barcode|yes|Bar code| | ||
|recipient|[Recipient](#recipient)|yes|The recipient of the parcel| | ||
|sender|[Sender](#sender)|yes|The sender of the parcel| | ||
|pickupPlace|[PickupPlace](#pickupplace)|yes|where the parcel can be fetched| | ||
|
||
### Recipient | ||
|
||
|Name|Type|Required|Description| | ||
|----|----|--------|-----------| | ||
|digipostAddress|String|yes|The digipost address for the recipient| | ||
|address|Address|no|| | ||
|emailAdress|String|no|| | ||
|
||
### Sender | ||
|
||
|Name|Type|Required|Description| | ||
|----|----|--------|-----------| | ||
|reference|String|yes|The senders reference| | ||
|address|Address|no|| | ||
|
||
### PickupPlace | ||
|
||
|Name|Type|Required|Description| | ||
|----|----|--------|-----------| | ||
|name|String|yes|The pickup place name| | ||
|id|String|yes|The pickup place id| | ||
|instruction|String|yes|instructions for fetching the parcel| | ||
|address|Address|no|| | ||
|
||
### XML | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<pickupNotice xmlns="http://api.digipost.no/schema/datatypes"> | ||
<parcel-id>KB432788293NO</parcel-id> | ||
<parcel-uuid>70300492517312675</parcel-uuid> | ||
<bar-code> | ||
<barcode-value>1234567890</barcode-value> | ||
<barcode-type>EAN-128</barcode-type> | ||
</bar-code> | ||
<recipient> | ||
<digipost-address>test.testesen#0000</digipost-address> | ||
<address> | ||
<street-address>Storgata 23</street-address> | ||
<postal-code>0011</postal-code> | ||
<city>Oslo</city> | ||
<country>Norge</country> | ||
</address> | ||
<email-address>[email protected]</email-address> | ||
</recipient> | ||
<sender> | ||
<reference>13372500</reference> | ||
<address> | ||
<street-address>Storgata 23</street-address> | ||
<postal-code>0011</postal-code> | ||
<city>Oslo</city> | ||
<country>Norge</country> | ||
</address> | ||
</sender> | ||
<pickup-place> | ||
<name>0132</name> | ||
<id>Coop Mega</id> | ||
<instruction>Må hentes innen 010180</instruction> | ||
<address> | ||
<street-address>Storgata 23</street-address> | ||
<postal-code>0011</postal-code> | ||
<city>Oslo</city> | ||
<country>Norge</country> | ||
</address> | ||
</pickup-place> | ||
</pickupNotice> | ||
``` | ||
|
||
## Receipt | ||
|
||
Receipt represents a document containing details about a purchase | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/main/java/no/digipost/api/datatypes/types/pickup/PickupNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package no.digipost.api.datatypes.types.pickup; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
import lombok.experimental.Wither; | ||
import no.digipost.api.datatypes.DataType; | ||
import no.digipost.api.datatypes.documentation.Description; | ||
import no.digipost.api.datatypes.types.Address; | ||
import no.digipost.api.datatypes.types.Info; | ||
import no.digipost.api.datatypes.types.receipt.Barcode; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@XmlRootElement | ||
@Value | ||
@AllArgsConstructor | ||
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
@Wither | ||
@Description("Details about a signed document") | ||
public class PickupNotice implements DataType { | ||
|
||
@XmlElement(name = "parcel-id", required = true) | ||
@Description("The id of the parcel in posten") | ||
String parcelId; | ||
|
||
@XmlElement(name = "parcel-uuid", required = true) | ||
@Description("The uuid of the parcel") | ||
String parcelUUID; | ||
|
||
@XmlElement(name = "bar-code", required = true) | ||
@Description("Bar code") | ||
Barcode barcode; | ||
|
||
@XmlElement(name = "recipient", required = true) | ||
@Description("The recipient of the parcel") | ||
Recipient recipient; | ||
|
||
@XmlElement(name = "sender", required = true) | ||
@Description("The sender of the parcel") | ||
Sender sender; | ||
|
||
@XmlElement(name = "pickup-place", required = true) | ||
@Description("where the parcel can be fetched") | ||
PickupPlace pickupPlace; | ||
|
||
public static PickupNotice EXAMPLE = new PickupNotice( | ||
"KB432788293NO" | ||
, "70300492517312675" | ||
, Barcode.EXAMPLE.withBarcodeType("EAN-128") | ||
, Recipient.EXAMPLE | ||
, Sender.EXAMPLE | ||
, PickupPlace.EXAMPLE | ||
); | ||
} | ||
|
||
|
39 changes: 39 additions & 0 deletions
39
src/main/java/no/digipost/api/datatypes/types/pickup/PickupPlace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package no.digipost.api.datatypes.types.pickup; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
import lombok.experimental.Wither; | ||
import no.digipost.api.datatypes.documentation.Description; | ||
import no.digipost.api.datatypes.types.Address; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlType | ||
@Value | ||
@AllArgsConstructor | ||
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
@Wither | ||
public class PickupPlace { | ||
|
||
@XmlElement(name = "name", required = true) | ||
@Description("The pickup place name") | ||
String name; | ||
|
||
@XmlElement(name = "id", required = true) | ||
@Description("The pickup place id") | ||
String id; | ||
|
||
@XmlElement(name = "instruction", required = true) | ||
@Description("instructions for fetching the parcel") | ||
String instruction; | ||
|
||
@XmlElement | ||
Address address; | ||
|
||
public static final PickupPlace EXAMPLE = new PickupPlace("0132", "Coop Mega", "Må hentes innen 010180", Address.EXAMPLE); | ||
|
||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/no/digipost/api/datatypes/types/pickup/Recipient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package no.digipost.api.datatypes.types.pickup; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
import lombok.experimental.Wither; | ||
import no.digipost.api.datatypes.documentation.Description; | ||
import no.digipost.api.datatypes.types.Address; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlType | ||
@Value | ||
@AllArgsConstructor | ||
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
@Wither | ||
public class Recipient { | ||
|
||
@XmlElement(name = "digipost-address", required = true) | ||
@Description("The digipost address for the recipient") | ||
String digipostAddress; | ||
|
||
@XmlElement | ||
Address address; | ||
|
||
@XmlElement(name = "email-address") | ||
String emailAdress; | ||
|
||
public static final Recipient EXAMPLE = new Recipient("test.testesen#0000", Address.EXAMPLE, "[email protected]"); | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/no/digipost/api/datatypes/types/pickup/Sender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package no.digipost.api.datatypes.types.pickup; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
import lombok.experimental.Wither; | ||
import no.digipost.api.datatypes.documentation.Description; | ||
import no.digipost.api.datatypes.types.Address; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlType | ||
@Value | ||
@AllArgsConstructor | ||
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) | ||
@Wither | ||
public class Sender { | ||
|
||
@XmlElement(name = "reference", required = true) | ||
@Description("The senders reference") | ||
String reference; | ||
|
||
@XmlElement | ||
Address address; | ||
|
||
public static final Sender EXAMPLE = new Sender("13372500", Address.EXAMPLE); | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/no/digipost/api/datatypes/types/pickup/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@XmlSchema(namespace = DIGIPOST_DATATYPES_NAMESPACE, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlJavaTypeAdapter(ZonedDateTimeXmlAdapter.class) | ||
package no.digipost.api.datatypes.types.pickup; | ||
|
||
import no.digipost.api.datatypes.marshalling.ZonedDateTimeXmlAdapter; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlSchema; | ||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | ||
|
||
import static no.digipost.api.datatypes.marshalling.DataTypesJAXBContext.DIGIPOST_DATATYPES_NAMESPACE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ Boligdetaljer | |
receipt.Receipt | ||
Payslip | ||
SignedDocument | ||
pickup.PickupNotice |