feat: service categories endpoints and service creation endpoint
This commit is contained in:
@ -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
|
||||
|
||||
28
modules/fulfillment_base/services/service_category.py
Normal file
28
modules/fulfillment_base/services/service_category.py
Normal 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
|
||||
Reference in New Issue
Block a user