invoice payment! prerelease
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import delete, select
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy.orm import selectinload
|
||||
@@ -46,3 +46,15 @@ class OrderRepository:
|
||||
await session.commit()
|
||||
|
||||
return order
|
||||
|
||||
async def remove_order_by_id(self, session: AsyncSession, order_id: int):
|
||||
stmt = delete(Order.__table__).where(Order.id == order_id)
|
||||
|
||||
await session.execute(stmt)
|
||||
await session.commit()
|
||||
|
||||
async def remove_order_by_customer(self, session: AsyncSession, customer: int):
|
||||
stmt = delete(Order.__table__).where(Order.customer == customer)
|
||||
|
||||
await session.execute(stmt)
|
||||
await session.commit()
|
||||
|
||||
Reference in New Issue
Block a user