User Domain Schemas¶
Pydantic & Struct Data Transfer Objects (DTOs) for the Users sub-domain.
Utility Definitions¶
- class RoleSlug(*values)[source]¶
Bases:
StrEnumAvailable user role slugs.
- SUPERUSER = 'superuser'¶
- FITNESS_TRAINER = 'fitness-trainer'¶
- class PasswordValidator[source]¶
Bases:
RegexValidatorValidator for user passwords.
—
User Information Models¶
- class User(id: UUID, name: str | None, email: str, is_active: bool, is_superuser: bool, role_name: str, role_slug: str, created_at: datetime, updated_at: datetime)[source]¶
Bases:
CamelizedBaseStructUser properties to use for a response.
- class UserAuth(id: UUID, name: str | None, email: str, is_active: bool, is_superuser: bool, role_slug: str)[source]¶
Bases:
CamelizedBaseStructUser model used for authentication context.
—
User CRUD Models¶
- class UserCreate[source]¶
Bases:
CamelizedBaseSchemaProperties required to create a new user.
- Fields:
- class UserUpdate[source]¶
Bases:
CamelizedBaseSchemaData transfer object for optional user account updates.
- Fields:
—
User Authentication Models¶
- class AccountRegister[source]¶
Bases:
CamelizedBaseSchemaInformation provided by a user during public registration.
- field password: Annotated[str, PasswordValidator] [Required]¶
- AccountRegister.check_passwords_match() Self[source]¶
Ensure the ‘password’ and ‘confirm_password’ fields match.
- class PasswordUpdate[source]¶
Bases:
CamelizedBaseSchemaInput data for password rotation.
- field new_password: Annotated[str, PasswordValidator] [Required] (alias 'newPassword')¶
—
Role Management Models¶
- class UserRoleAdd[source]¶
Bases:
CamelizedBaseSchemaPayload for granting a specific role to a user.
- class UserRoleRevoke[source]¶
Bases:
UserRoleAddPayload for revoking a specific role from a user.