Skip to content

Add SignedDocumentReference datatype - #96

Open
AndreasHaaversen wants to merge 1 commit into
mainfrom
signed-document-reference
Open

Add SignedDocumentReference datatype#96
AndreasHaaversen wants to merge 1 commit into
mainfrom
signed-document-reference

Conversation

@AndreasHaaversen

Copy link
Copy Markdown
Contributor

Summary

  • Adds SignedDocumentReference to the no.digipost.api.datatypes.types.signing package
  • Registers DataTypeIdentifier.SIGNED_DOCUMENT_REFERENCE (short name SGDR)
  • Wires it into DataType (@JsonSubTypes) and jaxb.index so JSON/XML serialization works out of the box

Background

When a signing request is completed, the resulting signed document is delivered as a separate document. This type is attached as Metadata on the original signing-request document and holds the documentUuid of the delivered signed document, giving consumers a stable link between the two.

This is a reference/pointer type (not an event), in deliberate contrast to the event-oriented SigningCompletedBy/SigningRejectedBy types in the same package.

Test plan

  • mvn test passes (all 45 tests green with Java 21)
  • DataTypeIdentifier round-trip lookup works (covered by DataTypeIdentifierTest)
  • JAXB index test passes (JAXBIndexTest)
  • JSON polymorphic deserialization covered by MarshallingTest (exercises all registered subtypes via DataType.EXAMPLE)

@AndreasHaaversen
AndreasHaaversen requested review from a team, amund-hh and hannabergljot August 7, 2026 15:17
References the UUID of the signed document delivered after a signing
request completes. Intended to be attached as Metadata on the original
signing-request document so consumers can link the request to the
resulting signed document.

Adds SignedDocumentReference to the @ComplementedBy annotation on
SigningRequest, so it can only be attached to documents that already
have a SigningRequest metadata type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AndreasHaaversen
AndreasHaaversen force-pushed the signed-document-reference branch from 2cdd4b6 to fa6d391 Compare August 7, 2026 15:18
Comment on lines +22 to +29
public class SignedDocumentReference implements DataType {

@XmlElement(name = "document-uuid", required = true)
@Description("UUID of the delivered signed document.")
@NotNull
UUID documentUuid;

public static final SignedDocumentReference EXAMPLE = new SignedDocumentReference(UUID.fromString("b9d67195-6ac3-4a5e-a4d8-f5b7c2e3d1a0"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tenker at datatypen egt. kan gjøres helt generisk, siden vi bare lenker til et dokument brukeren har mottatt i Digipost.

Så typ bare rename til DocumentReference og oppdatere annotasjonene.

@amund-hh amund-hh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Enig med Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants