AuthUser Entity
The AuthUser entity represents an authenticated user in the system, storing credentials and authentication-related information.AuthUser Fields
Unique identifier for the authenticated user. Automatically generated using
@PrePersist if not provided.The full name of the user.
The date of birth of the user in ISO 8601 format (YYYY-MM-DD).
The username for authentication. Must be unique across the system.
The hashed password for the user account.
The email address of the user. Must be unique and is a required field.
Timestamp of when the account was created. Automatically set using
@PrePersist and cannot be updated.Indicates whether the user account is enabled and can authenticate.
Indicates whether the user account has not expired.
Indicates whether the user account is not locked.
Indicates whether the user’s credentials (password) have not expired.
UUID and Timestamp Generation
The AuthUser entity uses the@PrePersist callback to automatically generate a UUID and set the creation timestamp:
Constraints
- Unique Username: The
usernamefield has a unique constraint - Unique Email: The
emailfield is both required and unique - Non-updatable createdAt: The
createdAttimestamp cannot be modified after creation
AuthRegisterRequest
Data Transfer Object used for registering a new user account.Request Fields
The full name of the user. Cannot be blank.Validation:
@NotBlank(message = "The username is obligatory")The date of birth of the user. Must be a past or present date.Validation:
@NotNull(message = "The username is obligatory")@PastOrPresent(message = "The date of birth must be a past or present date")
The username for the new account. Cannot be blank.Validation:
@NotBlank(message = "The username is obligatory")The password for the new account. Cannot be blank.Validation:
@NotBlank(message = "The password is obligatory")The email address of the user. Must be a valid email format.Validation:
@Email(message = "Must be a valid email address")@NotBlank(message = "Email is required")
Example Request
AuthRegisterResponse
Data Transfer Object returned after successful user registration.Response Fields
The username of the newly registered user.
The email address of the newly registered user.
A confirmation message about the registration status.
Indicates the success of the registration operation.
Example Response
AuthLoginRequest
Data Transfer Object used for user authentication.Request Fields
The username of the user. Cannot be blank.Validation:
@NotBlank(message = "The username is obligatory")The password of the user. Cannot be blank.Validation:
@NotBlank(message = "The password is obligatory")Example Request
AuthLoginResponse
Data Transfer Object returned after successful user login.Response Fields
The username of the authenticated user.
A confirmation message about the login status.
Indicates the success of the login operation.
The JWT (JSON Web Token) access token for subsequent authenticated requests. Include this token in the
Authorization header as Bearer {jwt}.