From 641584fa10972e9ad6d8c27f20f8d01dd3187153 Mon Sep 17 00:00:00 2001 From: Mats Byrkjeland Date: Wed, 25 Oct 2023 13:12:38 +0200 Subject: [PATCH] Add required "purpose" field for ShareDocumentsRequest --- datatypes-examples.xml | 1 + datatypes.xsd | 2 ++ readme.md | 3 +++ .../datatypes/types/share/ShareDocumentsRequest.java | 10 +++++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/datatypes-examples.xml b/datatypes-examples.xml index 938c8cb..9887d43 100644 --- a/datatypes-examples.xml +++ b/datatypes-examples.xml @@ -393,6 +393,7 @@ PT2160H + We require to see your latest pay slip in order to grant you a loan. diff --git a/datatypes.xsd b/datatypes.xsd index bf2b5e6..b18e3de 100644 --- a/datatypes.xsd +++ b/datatypes.xsd @@ -487,6 +487,7 @@ + @@ -526,6 +527,7 @@ + diff --git a/readme.md b/readme.md index 8915825..98f8a8c 100644 --- a/readme.md +++ b/readme.md @@ -1091,12 +1091,14 @@ A request for a user to share one or more documents |Name|Type|Required|Description| |----|----|--------|-----------| |maxShareDuration|Duration|yes|This is the maximum duration in which you are allowed to access the user's documents from they are shared with you| +|purpose|String|yes|This text should explain why you need to process the recipient's documents in a short and understandable way.| ### XML ```xml PT2160H + We require to see your latest pay slip in order to grant you a loan. ``` @@ -1117,6 +1119,7 @@ An update or event related to a ShareDocumentsRequest Valid values: * FILES_SHARED +* SHARING_STOPPED ### XML diff --git a/src/main/java/no/digipost/api/datatypes/types/share/ShareDocumentsRequest.java b/src/main/java/no/digipost/api/datatypes/types/share/ShareDocumentsRequest.java index df3fc2a..640aa74 100644 --- a/src/main/java/no/digipost/api/datatypes/types/share/ShareDocumentsRequest.java +++ b/src/main/java/no/digipost/api/datatypes/types/share/ShareDocumentsRequest.java @@ -26,6 +26,14 @@ public class ShareDocumentsRequest implements DataType { @Description("This is the maximum duration in which you are allowed to access the user's documents from they are shared with you") Duration maxShareDuration; - public static final ShareDocumentsRequest EXAMPLE = new ShareDocumentsRequest(Duration.ofDays(90)); + @XmlElement(name="purpose", required = true) + @NotNull + @Description("This text should explain why you need to process the recipient's documents in a short and understandable way.") + String purpose; + + public static final ShareDocumentsRequest EXAMPLE = new ShareDocumentsRequest( + Duration.ofDays(90), + "We require to see your latest pay slip in order to grant you a loan." + ); }