first commit
This commit is contained in:
41
app/schemas/admin.py
Normal file
41
app/schemas/admin.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""Admin request/response schemas."""
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class UserManagement(BaseModel):
|
||||
"""Schema for user access management."""
|
||||
has_access: bool
|
||||
|
||||
|
||||
class PasswordReset(BaseModel):
|
||||
"""Schema for resetting a user's password."""
|
||||
new_password: str = Field(..., min_length=6)
|
||||
|
||||
|
||||
class CreateUserRequest(BaseModel):
|
||||
"""Schema for admin-created user accounts."""
|
||||
username: str = Field(..., min_length=1)
|
||||
password: str = Field(..., min_length=6)
|
||||
role: str = Field(default="user", pattern=r"^(user|admin)$")
|
||||
has_access: bool = False
|
||||
|
||||
|
||||
class RegistrationToggle(BaseModel):
|
||||
"""Schema for toggling registration on/off."""
|
||||
enabled: bool
|
||||
|
||||
|
||||
class SystemSettingUpdate(BaseModel):
|
||||
"""Schema for updating a system setting."""
|
||||
value: str = Field(..., min_length=1)
|
||||
|
||||
|
||||
class DataCleanupRequest(BaseModel):
|
||||
"""Schema for data cleanup — delete records older than N days."""
|
||||
older_than_days: int = Field(..., gt=0)
|
||||
|
||||
|
||||
class JobToggle(BaseModel):
|
||||
"""Schema for enabling/disabling a scheduled job."""
|
||||
enabled: bool
|
||||
Reference in New Issue
Block a user