invoice payment! prerelease
This commit is contained in:
@@ -43,3 +43,13 @@ class InvoiceRepository:
|
||||
.values(inline_message_id=inline_message_id)
|
||||
)
|
||||
await session.execute(stmt)
|
||||
|
||||
async def update_invoice_status(
|
||||
self, session: AsyncSession, *, invoice_id: int, status: InvoiceStatus
|
||||
):
|
||||
stmt = (
|
||||
update(Invoice.__table__)
|
||||
.where(Invoice.id == invoice_id)
|
||||
.values(status=status)
|
||||
)
|
||||
await session.execute(stmt)
|
||||
|
||||
@@ -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