28 lines
814 B
Python
28 lines
814 B
Python
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)
|