feat: add summary to completed orders
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user