Chore: moving changes - migrating Desktop from nobara 42 to windows(WSL)
This commit is contained in:
@@ -29,12 +29,14 @@ class User(SQLModel, table=True):
|
||||
username (str): Unique user name (max 100 chars).
|
||||
role (UserRole): User role (default READ_ONLY).
|
||||
password_hash (str): Hashed password.
|
||||
is_approved (bool): Whether user is approved by admin (default False).
|
||||
"""
|
||||
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
username: str = Field(nullable=False,unique=True, max_length=100)
|
||||
role: UserRole = Field(nullable=False, max_length= 10, default=UserRole.READ_ONLY)
|
||||
password_hash: str = Field(nullable=False)
|
||||
is_approved: bool = Field(nullable=False, default=False)
|
||||
|
||||
|
||||
class Partner(SQLModel, table=True):
|
||||
@@ -267,3 +269,6 @@ class Inventory(SQLModel, table=True):
|
||||
|
||||
product_id: int = Field(nullable=False, unique=True, foreign_key="product.id")
|
||||
total_qty: int = Field(nullable=False, default=0)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class UserResponse(SQLModel):
|
||||
id: Optional[int] = None
|
||||
username: str
|
||||
role: UserRole
|
||||
is_approved: bool
|
||||
|
||||
|
||||
class Token(SQLModel):
|
||||
@@ -46,6 +47,23 @@ class TokenData(SQLModel):
|
||||
role: Optional[UserRole] = None
|
||||
|
||||
|
||||
class UserApprovalUpdate(SQLModel):
|
||||
"""Schema for admin to approve/reject user accounts."""
|
||||
is_approved: bool
|
||||
|
||||
|
||||
class PasswordChangeRequest(SQLModel):
|
||||
"""Schema for changing password (user knows current password)."""
|
||||
current_password: str
|
||||
new_password: str
|
||||
|
||||
|
||||
class EmailVerificationRequest(SQLModel):
|
||||
"""Schema for requesting email verification for password reset."""
|
||||
username: str
|
||||
email: str # User provides their email for verification
|
||||
|
||||
|
||||
##################################################
|
||||
# Transactions
|
||||
class TransactionBase(SQLModel):
|
||||
|
||||
Reference in New Issue
Block a user