feat: deal attributes with select and options
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user