22 lines
680 B
Python
22 lines
680 B
Python
from modules.fulfillment_base.models import Service
|
|
from modules.fulfillment_base.schemas.service import (
|
|
CreateServiceSchema,
|
|
UpdateServiceSchema,
|
|
)
|
|
from repositories.mixins import *
|
|
|
|
|
|
class ServiceRepository(
|
|
BaseRepository,
|
|
RepGetAllMixin[Service],
|
|
RepDeleteMixin[Service],
|
|
RepCreateMixin[Service, CreateServiceSchema],
|
|
RepUpdateMixin[Service, UpdateServiceSchema],
|
|
RepGetByIdMixin[Service],
|
|
):
|
|
entity_class = Service
|
|
entity_not_found_msg = "Услуга не найдена"
|
|
|
|
async def update(self, service: Service, data: UpdateServiceSchema) -> Service:
|
|
return await self._apply_update_data_to_model(service, data, True)
|