import { Controller, Get, Query } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { ExcludePrivilege, Public } from 'src/core/guards';
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';

import { ReportSummaryService } from './report-summary.service';
import { GetSummaryReportDto } from '../shared/dto/summary-report.get.dto';

@ApiTags(`${MODULE_NAME.REPORT_SUMMARY.split('-').join(' ')}`)
@Controller(`v1/${MODULE_NAME.REPORT_SUMMARY}`)
@Public(false)
@ApiBearerAuth('JWT')
export class ReportSummaryController {
  constructor(private service: ReportSummaryService) {}

  @Get('income-item')
  @ExcludePrivilege()
  async getReportItem(@Query() query: GetSummaryReportDto) {
    return await this.service.getReportItem(query);
  }

  @Get('income-item-master')
  @ExcludePrivilege()
  async getReportItemMaster(@Query() query: GetSummaryReportDto) {
    return await this.service.getReportItemMaster(query);
  }
}
