product management, unification of kb and so on.

This commit is contained in:
2026-02-24 20:47:52 +07:00
parent 36ffca460f
commit 035170e46f
23 changed files with 470 additions and 130 deletions

View File

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