Files
psp_api/src/modules/consumer/saleInvoices/saleInvoices.controller.ts
T

22 lines
908 B
TypeScript
Raw Normal View History

import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
import { Controller, Get, Param } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { SaleInvoicesService } from './saleInvoices.service'
import type { SaleInvoicesServiceFindAllResponseDto, SaleInvoicesServiceFindOneResponseDto } from './dto/saleInvoices-response.dto'
@ApiTags('ConsumerSaleInvoices')
@Controller('consumer/sale-invoices')
export class StatisticsController {
constructor(private readonly service: SaleInvoicesService) {}
@Get('')
async findAll(@TokenAccount('userId') consumerId: string): Promise<SaleInvoicesServiceFindAllResponseDto> {
return this.service.findAll(consumerId)
}
@Get(':id')
async findOne(@TokenAccount('userId') consumerId: string, @Param('id') id: string): Promise<SaleInvoicesServiceFindOneResponseDto> {
return this.service.findOne(consumerId, id)
}
}