Skip to content

Commit

Permalink
Lagt til ny datatype: Signert dokument
Browse files Browse the repository at this point in the history
Først og fremst tiltenkt brukt fra Postens signeringstjeneste, som
sender inn kopier av PAdES etter at dokumenter har blitt signert.
  • Loading branch information
sindrebn committed Jul 11, 2018
1 parent df5222b commit 0883914
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
|[Payslip](#payslip)|For treating documents as Payslips.|
|[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|

## Appointment

Expand Down Expand Up @@ -450,3 +451,26 @@ Residence is a way of linking separate data for the same residence
<external-id>externalId</external-id>
</residence>
```

## SignedDocument

Details about a signed document

### Fields

|Name|Type|Required|Description|
|----|----|--------|-----------|
|documentIssuer|String|yes|The original issuer of the document to be signed.|
|documentSubject|String|yes|The original subject of the document to be signed.|
|signingTime|ZonedDateTime|yes|When the recipient signed the document. ISO8601 full DateTime.|

### XML

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<signedDocument xmlns="http://api.digipost.no/schema/datatypes">
<document-issuer>Bedrift AS</document-issuer>
<document-subject>Ansettelseskontrakt</document-subject>
<signing-time>2018-07-11T10:00:00+02:00</signing-time>
</signedDocument>
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public enum DataTypeIdentifier {
EXTERNAL_LINK(ExternalLink.class, "EXTL", ExternalLink.EXAMPLE),
BOLIGDETALJER(Boligdetaljer.class, "RDTL", Boligdetaljer.EXAMPLE),
RECEIPT(Receipt.class, "RCPT", Receipt.EXAMPLE),
PAYSLIP(Payslip.class, "PAY", Payslip.EXAMPLE);
PAYSLIP(Payslip.class, "PAY", Payslip.EXAMPLE),
SIGNED_DOCUMENT(SignedDocument.class, "SIGN", SignedDocument.EXAMPLE),
;

private final Class<? extends DataType> dataType;
private final String shortName;
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/no/digipost/api/datatypes/types/SignedDocument.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package no.digipost.api.datatypes.types;

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 javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.time.ZoneId;
import java.time.ZonedDateTime;

@XmlRootElement
@Value
@AllArgsConstructor
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Wither
@Description("Details about a signed document")
public class SignedDocument implements DataType {

@XmlElement(name = "document-issuer", required = true)
@Description("The original issuer of the document to be signed.")
String documentIssuer;

@XmlElement(name = "document-subject", required = true)
@Description("The original subject of the document to be signed.")
String documentSubject;

@XmlElement(name = "signing-time", required = true)
@Description("When the recipient signed the document. ISO8601 full DateTime.")
@NotNull
ZonedDateTime signingTime;

public static SignedDocument EXAMPLE = new SignedDocument(
"Bedrift AS",
"Ansettelseskontrakt",
ZonedDateTime.of(2018, 7, 11, 10, 0, 0, 0, ZoneId.systemDefault())
);
}


Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ExternalLink
Boligdetaljer
receipt.Receipt
Payslip
SignedDocument

0 comments on commit 0883914

Please sign in to comment.