View Javadoc
1   package fr.tiogars.inception.domains.domaintemplate.models;
2   
3   import java.time.Instant;
4   
5   import io.swagger.v3.oas.annotations.media.Schema;
6   import jakarta.validation.constraints.NotBlank;
7   import jakarta.validation.constraints.NotNull;
8   
9   /**
10   * Represents an business object managed by the template API.
11   *
12   * @param id               generated persistent identifier
13   * @param code             unique business code
14   * @param label            display label
15   * @param description      optional description
16   * @param createdDate      creation timestamp
17   * @param lastModifiedDate last modification timestamp
18   * @param createdBy        username at creation
19   * @param lastModifiedBy   username at the last modification
20   * @since 0.1.0
21   */
22  @Schema(description = "An business object persisted by the template API.")
23  public record DomainTemplate(
24          @Schema(description = "Generated persistent identifier.", example = "42", accessMode = Schema.AccessMode.READ_ONLY) @NotNull Long id,
25          @Schema(description = "Unique immutable business code.", example = "CUSTOMER", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank String code,
26          @Schema(description = "Display label.", example = "Customer", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank String label,
27          @Schema(description = "Optional business description.", example = "Customer DomainTemplate") String description,
28          @Schema(description = "UTC creation instant.", format = "date-time", accessMode = Schema.AccessMode.READ_ONLY) @NotNull Instant createdDate,
29          @Schema(description = "UTC instant of the last modification.", format = "date-time", accessMode = Schema.AccessMode.READ_ONLY) @NotNull Instant lastModifiedDate,
30          @Schema(description = "Username at creation.", accessMode = Schema.AccessMode.READ_ONLY) @NotNull String createdBy,
31          @Schema(description = "Username at the last modification.", accessMode = Schema.AccessMode.READ_ONLY) @NotNull String lastModifiedBy) {
32  }