From 846939ae255e073fd9c8a3114d93bb9642384a27 Mon Sep 17 00:00:00 2001
From: Jan Zickermann <jan.zickermann@dataport.de>
Date: Tue, 22 Oct 2024 16:27:20 +0200
Subject: [PATCH] OZG-6891 xta-model: Add java-doc

---
 .../de/ozgcloud/xta/client/model/XtaFile.java  |  8 ++++----
 .../xta/client/model/XtaIdentifier.java        |  6 +++---
 .../ozgcloud/xta/client/model/XtaMessage.java  |  7 +++++++
 .../model/XtaMessageAndTransportReport.java    | 13 -------------
 .../xta/client/model/XtaMessageMetaData.java   | 18 ++++++++++++++++++
 .../xta/client/model/XtaTransportReport.java   |  7 +++++++
 6 files changed, 39 insertions(+), 20 deletions(-)
 delete mode 100644 src/main/java/de/ozgcloud/xta/client/model/XtaMessageAndTransportReport.java

diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaFile.java b/src/main/java/de/ozgcloud/xta/client/model/XtaFile.java
index eefd836..1617c74 100644
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaFile.java
+++ b/src/main/java/de/ozgcloud/xta/client/model/XtaFile.java
@@ -21,15 +21,15 @@ import lombok.Builder;
  * @param contentType        This attribute specifies the MIME type of the contained content, so it includes entries like {@code text/xml},
  *                           {@code text/plain}, {@code application/gzip}, or {@code application/pdf}. <p>This field is required as it is particularly
  *                           important information (handled analogously in email).</p>
- * @param contentDescription The description of the content, e.g., 'Offer' or 'Invoice'. <p>This field is optional.</p>
- * @param encoding           The character set that was used for encoding the content. <p>This field is optional.</p>
- * @param name               The filename of the data source, if the content was taken from a file. E.g.: For the transmission of xdomea messages,
+ * @param contentDescription Description of the content, e.g., 'Offer' or 'Invoice'. <p>This field is optional.</p>
+ * @param encoding           Character set that was used for encoding the content. <p>This field is optional.</p>
+ * @param name               Filename of the data source, if the content was taken from a file. E.g.: For the transmission of xdomea messages,
  *                           this attribute is mandatory. <p>This field is recommended as it is required for xdomea.</p>
  * @param id                 Provides the ability to reference the content via, for example, a running number. <p>This field is optional and will be
  *                           automatically set by the XTA server.</p>
  * @param language           Language of the file content, for instance, {@code en-US} or {@code de-DE}, see <a
  *                           href="http://www.ietf.org/rfc/rfc3066.txt">RFC 3066</a>. <p>This field is optional.</p>
- * @param size               The size of the file content in bytes.
+ * @param size               Size of the file content in bytes.
  *
  *                           <p>
  *                           This field is optional and will be automatically set by the XTA server.
diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaIdentifier.java b/src/main/java/de/ozgcloud/xta/client/model/XtaIdentifier.java
index 0156f13..30c50fd 100644
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaIdentifier.java
+++ b/src/main/java/de/ozgcloud/xta/client/model/XtaIdentifier.java
@@ -22,9 +22,9 @@ import lombok.Builder;
  *  .build();
  * </pre>
  *
- * @param name     The name of the identifier. <p>This field is optional.</p>
- * @param category The category of the identifier. <p>This field is optional.</p>
- * @param value    The value of the identifier. <p>This field is required.</p>
+ * @param name     Name of the identifier. <p>This field is optional.</p>
+ * @param category Category of the identifier. <p>This field is optional.</p>
+ * @param value    Value of the identifier. <p>This field is required.</p>
  */
 @Builder
 public record XtaIdentifier(
diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaMessage.java b/src/main/java/de/ozgcloud/xta/client/model/XtaMessage.java
index 10cf16e..ae2d184 100644
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaMessage.java
+++ b/src/main/java/de/ozgcloud/xta/client/model/XtaMessage.java
@@ -7,6 +7,13 @@ import jakarta.validation.constraints.NotNull;
 
 import lombok.Builder;
 
+/**
+ * A xta message consisting of meta data, a message file and optional attachment files.
+ *
+ * @param metaData Metadata of the message <p>This field is required.</p>
+ * @param messageFile Main message of the message <p>This field is required.</p>
+ * @param attachmentFiles Attachment files of the message <p>Note that this list should always be empty for xdomea messages.</p>
+ */
 @Builder(toBuilder = true)
 public record XtaMessage(
 		@NotNull @Valid XtaMessageMetaData metaData,
diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaMessageAndTransportReport.java b/src/main/java/de/ozgcloud/xta/client/model/XtaMessageAndTransportReport.java
deleted file mode 100644
index 6fed361..0000000
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaMessageAndTransportReport.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package de.ozgcloud.xta.client.model;
-
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotNull;
-
-import lombok.Builder;
-
-@Builder
-public record XtaMessageAndTransportReport(
-		@NotNull @Valid XtaMessage message,
-		@NotNull @Valid XtaTransportReport transportReport
-) {
-}
diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaMessageMetaData.java b/src/main/java/de/ozgcloud/xta/client/model/XtaMessageMetaData.java
index 4ff59de..a9b8332 100644
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaMessageMetaData.java
+++ b/src/main/java/de/ozgcloud/xta/client/model/XtaMessageMetaData.java
@@ -10,6 +10,24 @@ import jakarta.validation.constraints.PositiveOrZero;
 
 import lombok.Builder;
 
+/**
+ * Represents the metadata of an XTA message.
+ *
+ * <p>
+ * <small>Parameter documentation strings partially from <i>OSCI_MessageMetaData_V2.02.xsd</i>.</small>
+ * </p>
+ *
+ * @param service Distinct service in a certain business scenario context; in the XÖV context this is the "Dienste URI" (service URI). <p>This field is required.</p>
+ * @param businessScenarioCode Domain qualifier, e.g. Meldewesen, XVergabe... <p>This field is required.</p>
+ * @param businessScenarioListUri Code list URI of the business scenario. <p>If {@code null}, {@link XtaMessageMetaData#businessScenarioCode} refers to an undefined business scenario. Otherwise, it is a defined scenario which additionally requires {@link XtaMessageMetaData#businessScenarioListVersionId}.</p>
+ * @param businessScenarioListVersionId code list version ID of the business scenario. <p>Required if {@link XtaMessageMetaData#businessScenarioListUri} is not {@code null}.</p>
+ * @param messageTypeCode Code of the message type. <p>For instance, <i>Geschaeftsgang.Geschaeftsgang.0201</i> with business scenario <i>XDOMEAGAD_DATA</i>.</p> <p>This field is required.</p>
+ * @param messageTypePayloadSchema Payload schema of the message type. <p>For instance, <i>urn:xoev-de:xdomea:schema:2.4.0</i> with code <i>Geschaeftsgang.Geschaeftsgang.0201</i> and business scenario <i>XDOMEAGAD_DATA</i>.</p> <p>This field is required.</p>
+ * @param messageId Unique identifier of the message. <p>The ID is generated by the server and thus not required when sending.</p>
+ * @param authorIdentifier Identifier of the author of the message. <p>This field is required.</p>
+ * @param readerIdentifier Identifier of the reader of the message. <p>This field is required.</p>
+ * @param messageSize Size of the message in bytes. <p>The size is determined by the server an thus not required when sending.</p>
+ */
 @Builder(toBuilder = true)
 public record XtaMessageMetaData(
 		@NotBlank String service,
diff --git a/src/main/java/de/ozgcloud/xta/client/model/XtaTransportReport.java b/src/main/java/de/ozgcloud/xta/client/model/XtaTransportReport.java
index c768d2a..13dca75 100644
--- a/src/main/java/de/ozgcloud/xta/client/model/XtaTransportReport.java
+++ b/src/main/java/de/ozgcloud/xta/client/model/XtaTransportReport.java
@@ -7,6 +7,13 @@ import jakarta.validation.constraints.NotNull;
 
 import lombok.Builder;
 
+/**
+ * A transport report of a XTA message.
+ *
+ * @param metaData Metadata of the message.
+ * @param reportTime Time of the report.
+ * @param status Status of the message at the time of {@link XtaTransportReport#reportTime}.
+ */
 @Builder
 public record XtaTransportReport(
 		@NotNull @Valid XtaMessageMetaData metaData,
-- 
GitLab