feat: enhance business activities and sale invoices handling with new query constants and pagination support

This commit is contained in:
2026-05-16 14:49:23 +03:30
parent 83e7c26133
commit 5baf5bfea6
14 changed files with 154 additions and 41 deletions
@@ -1,8 +1,9 @@
import { PosInfo } from '@/common/decorators/posInfo.decorator'
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
import type { IPosPayload } from '@/common/models'
import { Body, Controller, Get, Param, Post } from '@nestjs/common'
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { ConsumerSaleInvoicesFilterDto } from './dto/saleInvoices-filter.dto'
import type {
SaleInvoicesServiceFindAllResponseDto,
SaleInvoicesServiceFindOneResponseDto,
@@ -18,8 +19,15 @@ export class StatisticsController {
@Get('')
async findAll(
@TokenAccount('userId') consumerId: string,
@Query('page') page = '1',
@Query('perPage') perPage = '10',
): Promise<SaleInvoicesServiceFindAllResponseDto> {
return this.service.findAll(consumerId)
const filter: ConsumerSaleInvoicesFilterDto = {
page: Number(page) || 1,
perPage: Number(perPage) || 10,
}
return this.service.findAll(consumerId, filter)
}
@Get(':id')