mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refaqctor: document openapi endpoints
This commit is contained in:
@@ -10,18 +10,22 @@ import {
|
||||
import { TaxRatesApplication } from './TaxRate.application';
|
||||
import { ICreateTaxRateDTO, IEditTaxRateDTO } from './TaxRates.types';
|
||||
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('tax-rates')
|
||||
@ApiTags('tax-rates')
|
||||
@PublicRoute()
|
||||
export class TaxRatesController {
|
||||
constructor(private readonly taxRatesApplication: TaxRatesApplication) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new tax rate.' })
|
||||
public createTaxRate(@Body() createTaxRateDTO: ICreateTaxRateDTO) {
|
||||
return this.taxRatesApplication.createTaxRate(createTaxRateDTO);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@ApiOperation({ summary: 'Edit the given tax rate.' })
|
||||
public editTaxRate(
|
||||
@Param('id') taxRateId: number,
|
||||
@Body() editTaxRateDTO: IEditTaxRateDTO,
|
||||
@@ -30,26 +34,31 @@ export class TaxRatesController {
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOperation({ summary: 'Delete the given tax rate.' })
|
||||
public deleteTaxRate(@Param('id') taxRateId: number) {
|
||||
return this.taxRatesApplication.deleteTaxRate(taxRateId);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Retrieves the tax rate details.' })
|
||||
public getTaxRate(@Param('id') taxRateId: number) {
|
||||
return this.taxRatesApplication.getTaxRate(taxRateId);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Retrieves the tax rates.' })
|
||||
public getTaxRates() {
|
||||
return this.taxRatesApplication.getTaxRates();
|
||||
}
|
||||
|
||||
@Put(':id/activate')
|
||||
@ApiOperation({ summary: 'Activate the given tax rate.' })
|
||||
public activateTaxRate(@Param('id') taxRateId: number) {
|
||||
return this.taxRatesApplication.activateTaxRate(taxRateId);
|
||||
}
|
||||
|
||||
@Put(':id/inactivate')
|
||||
@ApiOperation({ summary: 'Inactivate the given tax rate.' })
|
||||
public inactivateTaxRate(@Param('id') taxRateId: number) {
|
||||
return this.taxRatesApplication.inactivateTaxRate(taxRateId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user