feat: attr options and selects editing
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from schemas.base import BaseSchema
|
||||
from schemas.attr_option import AttrOptionSchema
|
||||
from schemas.base import BaseSchema, BaseResponse
|
||||
|
||||
|
||||
# region Entity
|
||||
@ -6,13 +7,16 @@ from schemas.base import BaseSchema
|
||||
|
||||
class AttrSelectSchema(BaseSchema):
|
||||
id: int
|
||||
label: str
|
||||
name: str
|
||||
is_built_in: bool
|
||||
|
||||
|
||||
class AttrOptionSchema(BaseSchema):
|
||||
id: int
|
||||
label: str
|
||||
class CreateAttrSelectSchema(BaseSchema):
|
||||
name: str
|
||||
|
||||
|
||||
class UpdateAttrSelectSchema(BaseSchema):
|
||||
name: str
|
||||
|
||||
|
||||
class AttrSelectWithOptionsSchema(AttrSelectSchema):
|
||||
@ -24,6 +28,14 @@ class AttrSelectWithOptionsSchema(AttrSelectSchema):
|
||||
# region Request
|
||||
|
||||
|
||||
class CreateAttrSelectRequest(BaseSchema):
|
||||
entity: CreateAttrSelectSchema
|
||||
|
||||
|
||||
class UpdateAttrSelectRequest(BaseSchema):
|
||||
entity: UpdateAttrSelectSchema
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Response
|
||||
@ -33,8 +45,16 @@ class GetAllAttrSelectsResponse(BaseSchema):
|
||||
items: list[AttrSelectSchema]
|
||||
|
||||
|
||||
class GetAllAttrSelectOptionsResponse(BaseSchema):
|
||||
items: list[AttrOptionSchema]
|
||||
class CreateAttrSelectResponse(BaseResponse):
|
||||
entity: AttrSelectSchema
|
||||
|
||||
|
||||
class UpdateAttrSelectResponse(BaseResponse):
|
||||
pass
|
||||
|
||||
|
||||
class DeleteAttrSelectResponse(BaseResponse):
|
||||
pass
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
Reference in New Issue
Block a user