add users
This commit is contained in:
parent
c01914736b
commit
ee23b71f0f
12 changed files with 506 additions and 182 deletions
|
|
@ -35,6 +35,7 @@ class AccountRead(BaseModel):
|
|||
phone_number: str
|
||||
company_domain: str | None
|
||||
is_domain_owner: bool = False
|
||||
must_change_password: bool = False
|
||||
created_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
|
@ -55,18 +56,22 @@ class OrgMemberCreate(BaseModel):
|
|||
first_name: str = Field(min_length=1, max_length=80)
|
||||
last_name: str = Field(min_length=1, max_length=80)
|
||||
email: EmailStr
|
||||
invitation_email: EmailStr | None = None
|
||||
org_role: Literal["user", "admin"] = "user"
|
||||
send_invitation: bool = True
|
||||
password: str | None = Field(default=None, min_length=8, max_length=128)
|
||||
force_password_change: bool = False
|
||||
password: str = Field(min_length=8, max_length=128)
|
||||
|
||||
|
||||
class OrgMemberRead(BaseModel):
|
||||
id: UUID
|
||||
email: EmailStr
|
||||
invitation_email: EmailStr | None = None
|
||||
first_name: str
|
||||
last_name: str
|
||||
org_role: str
|
||||
member_status: str
|
||||
must_change_password: bool = False
|
||||
is_domain_owner: bool = False
|
||||
groups: list[str] = Field(default_factory=list)
|
||||
created_at: datetime
|
||||
|
|
@ -74,6 +79,11 @@ class OrgMemberRead(BaseModel):
|
|||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class PasswordChangeRequest(BaseModel):
|
||||
current_password: str = Field(min_length=1, max_length=128)
|
||||
new_password: str = Field(min_length=8, max_length=128)
|
||||
|
||||
|
||||
class OrgMemberListResponse(BaseModel):
|
||||
items: list[OrgMemberRead]
|
||||
counts: dict[str, int]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue