feat: deal attributes with select and options

This commit is contained in:
2025-10-29 19:37:27 +04:00
parent 0e8c9077c9
commit 82fcd6e8cb
14 changed files with 206 additions and 23 deletions

View File

@ -12,6 +12,11 @@ class AttributeTypeSchema(BaseSchema):
name: str
class AttributeSelectSchema(BaseSchema):
id: int
label: str
class CreateAttributeSchema(BaseSchema):
label: str
is_applicable_to_group: bool
@ -19,12 +24,14 @@ class CreateAttributeSchema(BaseSchema):
default_value: Optional[Any]
description: str
type_id: int
select_id: Optional[int]
class AttributeSchema(CreateAttributeSchema):
id: int
is_built_in: bool
type: AttributeTypeSchema
select: Optional[AttributeSelectSchema]
class UpdateAttributeSchema(BaseSchema):
@ -33,7 +40,6 @@ class UpdateAttributeSchema(BaseSchema):
is_nullable: Optional[bool] = None
default_value: Optional[Any] = None
description: Optional[str] = None
type: Optional[AttributeTypeSchema] = None
class ModuleAttributeSchema(AttributeSchema):
@ -46,6 +52,7 @@ class DealModuleAttributeSchema(BaseSchema):
original_label: str
value: Optional[Any]
type: AttributeTypeSchema
select: Optional[AttributeSelectSchema]
default_value: Any
description: str
is_applicable_to_group: bool