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

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