61 lines
921 B
Python
61 lines
921 B
Python
from schemas.attr_option import AttrOptionSchema
|
|
from schemas.base import BaseSchema, BaseResponse
|
|
|
|
|
|
# region Entity
|
|
|
|
|
|
class AttrSelectSchema(BaseSchema):
|
|
id: int
|
|
name: str
|
|
is_built_in: bool
|
|
|
|
|
|
class CreateAttrSelectSchema(BaseSchema):
|
|
name: str
|
|
|
|
|
|
class UpdateAttrSelectSchema(BaseSchema):
|
|
name: str
|
|
|
|
|
|
class AttrSelectWithOptionsSchema(AttrSelectSchema):
|
|
options: list[AttrOptionSchema]
|
|
|
|
|
|
# endregion
|
|
|
|
# region Request
|
|
|
|
|
|
class CreateAttrSelectRequest(BaseSchema):
|
|
entity: CreateAttrSelectSchema
|
|
|
|
|
|
class UpdateAttrSelectRequest(BaseSchema):
|
|
entity: UpdateAttrSelectSchema
|
|
|
|
|
|
# endregion
|
|
|
|
# region Response
|
|
|
|
|
|
class GetAllAttrSelectsResponse(BaseSchema):
|
|
items: list[AttrSelectSchema]
|
|
|
|
|
|
class CreateAttrSelectResponse(BaseResponse):
|
|
entity: AttrSelectSchema
|
|
|
|
|
|
class UpdateAttrSelectResponse(BaseResponse):
|
|
pass
|
|
|
|
|
|
class DeleteAttrSelectResponse(BaseResponse):
|
|
pass
|
|
|
|
|
|
# endregion
|