GPQBot
20 строк · 546.0 Байт
1from schemas.shemas import FidbackCreate, Fidback
2from app.db.sqlalchemy import AsyncSession
3from app.db.repo import FidbackRepo
4
5
6class CreateFidbackInteractor:
7def __init__(self, db_session: AsyncSession) -> None:
8self._db_session = db_session
9
10async def execute(
11self,
12fidback_in_creation: FidbackCreate,
13) -> Fidback:
14fidback_repo = FidbackRepo(self._db_session)
15
16fidback = await fidback_repo.create_task(fidback_in_creation)
17
18await self._db_session.commit()
19
20return fidback