feat: enhance business activities and sale invoices handling with new query constants and pagination support
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user