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

27
services/attr_option.py Normal file
View File

@ -0,0 +1,27 @@
from sqlalchemy.ext.asyncio import AsyncSession
from models import AttributeOption
from repositories import AttrOptionRepository
from schemas.attr_option import (
AttrOptionSchema,
CreateAttrOptionRequest,
UpdateAttrOptionRequest,
)
from services.mixins import ServiceCrudMixin
class AttrOptionService(
ServiceCrudMixin[
AttributeOption,
AttrOptionSchema,
CreateAttrOptionRequest,
UpdateAttrOptionRequest,
]
):
schema_class = AttrOptionSchema
entity_deleted_msg = "Опция успешно удалена"
entity_updated_msg = "Опция успешно обновлена"
entity_created_msg = "Опция успешно создана"
def __init__(self, session: AsyncSession):
self.repository = AttrOptionRepository(session)