feat: deal attributes with select and options
This commit is contained in:
@ -39,12 +39,19 @@ class AttributeService(
|
||||
|
||||
attributes = []
|
||||
for attr, attr_value, attr_label in deal_attributes:
|
||||
select_schema = (
|
||||
AttributeSelectSchema.model_validate(attr.select)
|
||||
if attr.select
|
||||
else None
|
||||
)
|
||||
|
||||
attribute = DealModuleAttributeSchema(
|
||||
attribute_id=attr.id,
|
||||
label=attr_label.label if attr_label else attr.label,
|
||||
original_label=attr.label,
|
||||
value=attr_value.value if attr_value else None,
|
||||
type=AttributeTypeSchema.model_validate(attr.type),
|
||||
select=select_schema,
|
||||
default_value=attr.default_value,
|
||||
description=attr.description,
|
||||
is_applicable_to_group=attr.is_applicable_to_group,
|
||||
|
||||
Reference in New Issue
Block a user