feat: add summary to completed orders

This commit is contained in:
2026-06-17 13:19:16 +03:00
parent 909f4d9298
commit 8ebe016591
5 changed files with 34 additions and 7 deletions

View File

@@ -52,7 +52,7 @@ class ListOrdersByDateCommand:
@transactional
async def __call__(self, *, limit: int, offset: int, year: int, month: int | None = None) -> tuple[list[OrderEntity], int]:
async def __call__(self, *, limit: int, offset: int, year: int, month: int | None = None) -> tuple[list[OrderEntity], int, Decimal]:
orders = await self._unit_of_work.order_repository.list_by_date(
year=year,
month=month,
@@ -61,8 +61,9 @@ class ListOrdersByDateCommand:
)
total = await self._unit_of_work.order_repository.count_by_date(year=year, month=month)
summary = await self._unit_of_work.order_repository.sum_by_date(year=year, month=month)
return orders, total
return orders, total, summary
class GetOrderCommand: