From efc5d28415068e573c87f70fa8bbbe81ec8f2a60 Mon Sep 17 00:00:00 2001 From: Herman Wika Horn Date: Mon, 11 Mar 2024 17:44:53 +0100 Subject: [PATCH] Specify allowed organisation numbers for document sharing --- datatypes-examples.xml | 1 + datatypes.xsd | 1 + readme.md | 2 ++ .../api/datatypes/types/share/ShareDocumentsRequest.java | 9 ++++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/datatypes-examples.xml b/datatypes-examples.xml index 60dae2b..183534d 100644 --- a/datatypes-examples.xml +++ b/datatypes-examples.xml @@ -394,6 +394,7 @@ 1209600 We require to see your latest pay slip in order to grant you a loan. + 984661185 diff --git a/datatypes.xsd b/datatypes.xsd index 024df0f..c51df8d 100644 --- a/datatypes.xsd +++ b/datatypes.xsd @@ -430,6 +430,7 @@ + diff --git a/readme.md b/readme.md index df70766..347ecd8 100644 --- a/readme.md +++ b/readme.md @@ -1096,6 +1096,7 @@ A request for a user to share one or more documents |----|----|--------|-----------| |maxShareDurationSeconds|Long|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.| +|allowedOriginOrganisationNumbers|Set|no|Only documents received from any of the specified organisations will be possible for the user to share.| ### XML @@ -1103,6 +1104,7 @@ A request for a user to share one or more documents 1209600 We require to see your latest pay slip in order to grant you a loan. + 984661185 ``` 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 8cdad03..db29c18 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 @@ -12,6 +12,8 @@ import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; +import java.util.Set; + @XmlRootElement(name = "share-documents-request") @Value @AllArgsConstructor @@ -31,9 +33,14 @@ public class ShareDocumentsRequest implements DataType { @Description("This text should explain why you need to process the recipient's documents in a short and understandable way.") String purpose; + @XmlElement(name="allowed-origin-organisation-numbers", required = false) + @Description("Only documents received from any of the specified organisations will be possible for the user to share.") + Set allowedOriginOrganisationNumbers; + public static final ShareDocumentsRequest EXAMPLE = new ShareDocumentsRequest( 14 * 24 * 60 * 60L, - "We require to see your latest pay slip in order to grant you a loan." + "We require to see your latest pay slip in order to grant you a loan.", + Set.of("984661185") ); }