feat: attr options and selects editing
This commit is contained in:
55
schemas/attr_option.py
Normal file
55
schemas/attr_option.py
Normal file
@ -0,0 +1,55 @@
|
||||
from schemas.base import BaseSchema, BaseResponse
|
||||
|
||||
|
||||
# region Entity
|
||||
|
||||
|
||||
class AttrOptionSchema(BaseSchema):
|
||||
id: int
|
||||
name: str
|
||||
|
||||
|
||||
class CreateAttrOptionSchema(BaseSchema):
|
||||
name: str
|
||||
select_id: int
|
||||
|
||||
|
||||
class UpdateAttrOptionSchema(BaseSchema):
|
||||
name: str
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Request
|
||||
|
||||
|
||||
class CreateAttrOptionRequest(BaseSchema):
|
||||
entity: CreateAttrOptionSchema
|
||||
|
||||
|
||||
class UpdateAttrOptionRequest(BaseSchema):
|
||||
entity: UpdateAttrOptionSchema
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Response
|
||||
|
||||
|
||||
class GetAllAttrSelectOptionsResponse(BaseSchema):
|
||||
items: list[AttrOptionSchema]
|
||||
|
||||
|
||||
class CreateAttrOptionResponse(BaseSchema):
|
||||
entity: AttrOptionSchema
|
||||
|
||||
|
||||
class UpdateAttrOptionResponse(BaseResponse):
|
||||
pass
|
||||
|
||||
|
||||
class DeleteAttrOptionResponse(BaseSchema):
|
||||
pass
|
||||
|
||||
|
||||
# endregion
|
||||
Reference in New Issue
Block a user