invoice payment! prerelease

This commit is contained in:
2026-02-15 15:04:50 +07:00
parent 50b1a8f80c
commit 36ffca460f
15 changed files with 240 additions and 41 deletions

View File

@@ -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()