product management, unification of kb and so on.
This commit is contained in:
@@ -48,13 +48,21 @@ class OrderRepository:
|
||||
return order
|
||||
|
||||
async def remove_order_by_id(self, session: AsyncSession, order_id: int):
|
||||
stmt = delete(Order.__table__).where(Order.id == order_id)
|
||||
stmt = delete(Order).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)
|
||||
stmt = delete(Order).where(Order.customer == customer)
|
||||
|
||||
await session.execute(stmt)
|
||||
await session.commit()
|
||||
|
||||
async def update_order_status(
|
||||
self, session: AsyncSession, order_id: int, status: OrderStatus
|
||||
):
|
||||
order = await self.get_order_by_id(session, order_id)
|
||||
order.status = status
|
||||
|
||||
await session.commit()
|
||||
|
||||
Reference in New Issue
Block a user