1
from typing import Any, Optional
3
from sqlalchemy.ext.asyncio import AsyncSession
5
from app.inventory.quant.models.quants_models import Lot
6
from app.inventory.quant.schemas import LotCreateScheme, LotUpdateScheme, LotFilter
7
from core.permissions import permit
8
from core.service.base import BaseService, UpdateSchemaType, ModelType, FilterSchemaType, CreateSchemaType
10
from starlette.requests import Request
11
class LotService(BaseService[Lot, LotCreateScheme, LotUpdateScheme, LotFilter]):
12
def __init__(self, request:Request):
13
super(LotService, self).__init__(request, Lot,LotCreateScheme, LotUpdateScheme)
16
async def update(self, id: Any, obj: UpdateSchemaType) -> Optional[ModelType]:
17
return await super(LotService, self).update(id, obj)
20
async def list(self, _filter: FilterSchemaType, size: int):
21
return await super(LotService, self).list(_filter, size)
24
async def create(self, obj: CreateSchemaType) -> ModelType:
25
return await super(LotService, self).create(obj)
28
async def delete(self, id: Any) -> None:
29
return await super(LotService, self).delete(id)