feat(org): user and PM management - list/define users, roles, project assignment (API + organization panel)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user