feat: attr options and selects editing

This commit is contained in:
2025-11-04 12:18:53 +04:00
parent a7bda3d9f6
commit c266814c96
11 changed files with 239 additions and 40 deletions

View File

@ -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