feat(org): user and PM management - list/define users, roles, project assignment (API + organization panel)

This commit is contained in:
ali_mohaghegh
2026-08-27 15:04:24 +03:30
parent 034c05c713
commit f48f3752af
4 changed files with 403 additions and 22 deletions
+24 -1
View File
@@ -188,8 +188,31 @@ class PMReceiptCreate(APIModel):
quality_note: str | None = None
class UserCreate(APIModel):
"""Define a new user from the Organization panel (admin / procurement manager).
casdoor_id is optional: real Casdoor users auto-provision on their first
login; a manual entry gets a synthetic casdoor_id so the row can exist
before the person ever signs in.
"""
first_name: str = Field(min_length=1)
last_name: str = ""
phone: str | None = None
casdoor_id: str | None = None
role: Literal["pm", "procurement_manager", "admin"] | None = None
class UserRoleUpdate(APIModel):
role: Literal["pm", "procurement_manager", "admin"]
"""role=None revokes the role (and any project assignment)."""
role: Literal["pm", "procurement_manager", "admin"] | None = None
class UserProjectUpdate(APIModel):
"""Assign/unassign the user's single project (project_id=None unassigns)."""
project_id: UUID | None = None
class RejectQuoteIn(APIModel):