View Javadoc
1   package fr.tiogars.domaintemplate.domains.auth.user.entities;
2   
3   import java.time.Instant;
4   import java.util.List;
5   
6   import fr.tiogars.domaintemplate.domains.auth.role.entities.Role;
7   import io.swagger.v3.oas.annotations.media.Schema;
8   import jakarta.validation.constraints.NotNull;
9   
10  /** Public user account representation. */
11  public record User(
12          @Schema(description = "Generated persistent identifier.", example = "1")
13          @NotNull
14          Long id,
15          @Schema(description = "Unique login name.", example = "admin")
16          @NotNull
17          String username,
18          @Schema(
19                  description = "Whether this account can authenticate.",
20                  example = "true",
21                  requiredMode = Schema.RequiredMode.REQUIRED)
22          boolean enabled,
23          @Schema(description = "Roles assigned to this account.")
24          @NotNull
25          List<Role> roles,
26          @Schema(description = "Creation timestamp.")
27          @NotNull
28          Instant createdDate,
29          @Schema(description = "Last modification timestamp.")
30          @NotNull
31          Instant lastModifiedDate) {
32  }