DomainTemplate.java
package fr.tiogars.domaintemplate.domains.domaintemplate.entities;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.Instant;
/**
* Represents an business object managed by the template API.
*
* @param id generated persistent identifier
* @param code unique business code
* @param label display label
* @param description optional description
* @param createdDate creation timestamp
* @param lastModifiedDate last modification timestamp
* @since 0.1.0
*/
@Schema(description = "An business object persisted by the template API.")
public record DomainTemplate(
@Schema(description = "Generated persistent identifier.", example = "42", accessMode = Schema.AccessMode.READ_ONLY)
@NotNull Long id,
@Schema(description = "Unique immutable business code.", example = "CUSTOMER", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank String code,
@Schema(description = "Display label.", example = "Customer", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank String label,
@Schema(description = "Optional business description.", example = "Customer DomainTemplate")
String description,
@Schema(description = "UTC creation instant.", format = "date-time", accessMode = Schema.AccessMode.READ_ONLY)
@NotNull Instant createdDate,
@Schema(description = "UTC instant of the last modification.", format = "date-time", accessMode = Schema.AccessMode.READ_ONLY)
@NotNull Instant lastModifiedDate
) {
}