feat: service categories endpoints and service creation endpoint

This commit is contained in:
2025-09-27 18:21:20 +04:00
parent 8cf589c54e
commit fbadddeada
10 changed files with 194 additions and 20 deletions

View File

@ -4,3 +4,4 @@ from .product import ProductService as ProductService
from .product_service import ProductServiceService as ProductServiceService
from .service import ServiceModelService as ServiceModelService
from .services_kit import ServicesKitService as ServicesKitService
from .service_category import ServiceCategoryService as ServiceCategoryService

View File

@ -0,0 +1,28 @@
from modules.fulfillment_base.models import ServiceCategory
from modules.fulfillment_base.repositories import ServiceCategoryRepository
from modules.fulfillment_base.schemas.service_category import (
ServiceCategorySchema,
CreateServiceCategoryRequest,
UpdateServiceCategoryRequest,
)
from services.mixins import *
class ServiceCategoryService(
ServiceGetAllMixin[ServiceCategory, ServiceCategorySchema],
ServiceCreateMixin[
ServiceCategory, CreateServiceCategoryRequest, ServiceCategorySchema
],
ServiceUpdateMixin[ServiceCategory, UpdateServiceCategoryRequest],
ServiceDeleteMixin[ServiceCategory],
):
schema_class = ServiceCategorySchema
entity_deleted_msg = "Категория услуг успешно удалена"
entity_updated_msg = "Категория услуг успешно обновлена"
entity_created_msg = "Категория услуг успешно создана"
def __init__(self, session: AsyncSession):
self.repository = ServiceCategoryRepository(session)
async def is_soft_delete(self, service: ServiceCategorySchema) -> bool:
return True