2026-04-13 13:21:50 +03:30
|
|
|
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
2026-04-18 12:14:19 +03:30
|
|
|
import { Controller, Get, Param } from '@nestjs/common'
|
2026-04-13 13:21:50 +03:30
|
|
|
import { ApiTags } from '@nestjs/swagger'
|
|
|
|
|
import { SaleInvoicesService } from './saleInvoices.service'
|
2026-04-27 10:45:39 +03:30
|
|
|
import type { SaleInvoicesServiceFindAllResponseDto, SaleInvoicesServiceFindOneResponseDto } from './dto/saleInvoices-response.dto'
|
2026-04-13 13:21:50 +03:30
|
|
|
|
2026-04-18 12:14:19 +03:30
|
|
|
@ApiTags('ConsumerSaleInvoices')
|
|
|
|
|
@Controller('consumer/sale-invoices')
|
2026-04-13 13:21:50 +03:30
|
|
|
export class StatisticsController {
|
|
|
|
|
constructor(private readonly service: SaleInvoicesService) {}
|
|
|
|
|
|
2026-04-18 12:14:19 +03:30
|
|
|
@Get('')
|
2026-04-27 10:45:39 +03:30
|
|
|
async findAll(@TokenAccount('userId') consumerId: string): Promise<SaleInvoicesServiceFindAllResponseDto> {
|
2026-04-18 12:14:19 +03:30
|
|
|
return this.service.findAll(consumerId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get(':id')
|
2026-04-27 10:45:39 +03:30
|
|
|
async findOne(@TokenAccount('userId') consumerId: string, @Param('id') id: string): Promise<SaleInvoicesServiceFindOneResponseDto> {
|
2026-04-18 12:14:19 +03:30
|
|
|
return this.service.findOne(consumerId, id)
|
2026-04-13 13:21:50 +03:30
|
|
|
}
|
|
|
|
|
}
|