Skip to content

Commit

Permalink
Merge pull request #76 from digipost/share-docs-spesific-org
Browse files Browse the repository at this point in the history
Specify allowed organisation numbers for document sharing
  • Loading branch information
hermanwh authored Mar 12, 2024
2 parents 9fed854 + efc5d28 commit b253b01
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions datatypes-examples.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
<share-documents-request xmlns="http://api.digipost.no/schema/datatypes">
<max-share-duration-seconds>1209600</max-share-duration-seconds>
<purpose>We require to see your latest pay slip in order to grant you a loan.</purpose>
<allowed-origin-organisation-numbers>984661185</allowed-origin-organisation-numbers>
</share-documents-request>

<share-documents-request-documents-shared xmlns="http://api.digipost.no/schema/datatypes">
Expand Down
1 change: 1 addition & 0 deletions datatypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@
<xs:sequence>
<xs:element name="max-share-duration-seconds" type="xs:long"/>
<xs:element name="purpose" type="xs:string"/>
<xs:element maxOccurs="10" minOccurs="0" name="allowed-origin-organisation-numbers" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="shareDocumentsRequestDocumentsShared">
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1096,13 +1096,15 @@ 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

```xml
<share-documents-request xmlns="http://api.digipost.no/schema/datatypes">
<max-share-duration-seconds>1209600</max-share-duration-seconds>
<purpose>We require to see your latest pay slip in order to grant you a loan.</purpose>
<allowed-origin-organisation-numbers>984661185</allowed-origin-organisation-numbers>
</share-documents-request>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<String> 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")
);

}

0 comments on commit b253b01

Please sign in to comment.