feat: nested department sections, attaching department sections in the user editor
This commit is contained in:
@@ -16,12 +16,17 @@ class PassportImageSchema(BaseSchema):
|
||||
image_url: str
|
||||
|
||||
|
||||
class UserDepartmentSectionsSchema(BaseSchema):
|
||||
section_id: int
|
||||
is_chief: bool
|
||||
|
||||
|
||||
class BasicUser(BaseSchema):
|
||||
telegram_id: int
|
||||
phone_number: str | None = None
|
||||
first_name: str
|
||||
second_name: str
|
||||
patronymic: str
|
||||
patronymic: str = ""
|
||||
comment: str
|
||||
passport_data: str | None = None
|
||||
|
||||
@@ -51,6 +56,7 @@ class BaseUser(BasicUser):
|
||||
class UserSchema(BaseUser):
|
||||
role: RoleSchema
|
||||
position: Optional[PositionSchema] = None
|
||||
department_sections: list[UserDepartmentSectionsSchema] | None = []
|
||||
|
||||
|
||||
class UserUpdate(BaseUser):
|
||||
@@ -68,6 +74,10 @@ class UpdateUserRequest(BaseSchema):
|
||||
data: UserUpdate
|
||||
|
||||
|
||||
class UpdateUserDepartmentSectionsRequest(BaseSchema):
|
||||
department_sections: list[UserDepartmentSectionsSchema]
|
||||
|
||||
|
||||
class CreateUserRequest(BaseSchema):
|
||||
data: UserCreate
|
||||
|
||||
@@ -83,6 +93,10 @@ class UpdateUserResponse(OkMessageSchema):
|
||||
pass
|
||||
|
||||
|
||||
class UpdateUserDepartmentSectionsResponse(OkMessageSchema):
|
||||
pass
|
||||
|
||||
|
||||
class CreateUserResponse(OkMessageSchema):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user