Skip to content

Commit

Permalink
New document event: SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN
Browse files Browse the repository at this point in the history
This event is generated whenever an active ShareDocumentsRequest
is stopped or the sharing is withdrawn. The same event is generated
in either case. This event is always generated for the Broker, not
the Sender, so that Brokers may poll events for a number of different
Senders using the same endpoint and parameters.
  • Loading branch information
hermanwh committed Apr 29, 2024
1 parent 5531d21 commit 4564492
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public enum DocumentEventType {
PEPPOL_FAILED,
PEPPOL_DELIVERED,
SHREDDED,
SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED
SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED,
SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN

}
2 changes: 2 additions & 0 deletions src/main/resources/xsd/api_v8.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,8 @@
<xsd:enumeration value="SHREDDED" />
<xsd:enumeration value="PEPPOL_DELIVERED" />
<xsd:enumeration value="PEPPOL_FAILED" />
<xsd:enumeration value="SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED" />
<xsd:enumeration value="SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN" />
</xsd:restriction>
</xsd:simpleType>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import static no.digipost.api.client.representations.DocumentEventType.OPENED;
import static no.digipost.api.client.representations.DocumentEventType.POSTMARKED;
import static no.digipost.api.client.representations.DocumentEventType.PRINT_FAILED;
import static no.digipost.api.client.representations.DocumentEventType.SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED;
import static no.digipost.api.client.representations.DocumentEventType.SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN;
import static no.digipost.api.client.representations.DocumentEventType.SHREDDED;
import static no.digipost.api.client.representations.DocumentEventType.SMS_NOTIFICATION_FAILED;
import static no.digipost.api.client.representations.ErrorType.CLIENT_DATA;
Expand Down Expand Up @@ -214,9 +216,23 @@ public void validateDocumentEvents() {

DocumentEvent shreddedEvent = new DocumentEvent(randomUUID(), SHREDDED, now, now);

DocumentEvent newSharedDocuments = new DocumentEvent(
randomUUID(),
SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED,
now,
now
);

DocumentEvent sharingWithdrawn = new DocumentEvent(
randomUUID(),
SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN,
now,
now
);

DocumentEvents documentEvents = new DocumentEvents(asList(openedEvent, emailDeliveredEvent,
emailDeliveredEventWithMetadata, failedEmailNotificationEvent, failedSmsNotificationEvent,
printFailedEvent, movedFilesEvent, postmarkedEvent, shreddedEvent));
printFailedEvent, movedFilesEvent, postmarkedEvent, shreddedEvent, newSharedDocuments, sharingWithdrawn));
marshallValidateAndUnmarshall(documentEvents);
}

Expand Down

0 comments on commit 4564492

Please sign in to comment.