UserDocument

@MappedEntity
data class UserDocument(val id: String, val username: String, val email: String, val isVerified: Boolean, val role: String)

Represents the MongoDB document for storing user information.

This class is annotated with @MappedEntity to indicate that it maps to a MongoDB collection. Each instance of this class corresponds to a document in the collection.

Constructors

Link copied to clipboard
constructor(id: String, username: String, email: String, isVerified: Boolean, role: String)

Properties

Link copied to clipboard

The email address of the user. Used for communication and account recovery.

Link copied to clipboard
@Id
val id: String

The unique identifier for the user document. This is the primary key.

Link copied to clipboard
Link copied to clipboard

The role of the user in the system, represented as a string (e.g., "CUSTOMER", "MANAGER").

Link copied to clipboard

The username of the user. This is a unique identifier within the application.

Functions

Link copied to clipboard

Converts a UserDocument to a User domain model.

Link copied to clipboard