mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
refaqctor: document openapi endpoints
This commit is contained in:
@@ -11,18 +11,22 @@ import {
|
||||
import { ISaleReceiptDTO } from './types/SaleReceipts.types';
|
||||
import { SaleReceiptApplication } from './SaleReceiptApplication.service';
|
||||
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('sale-receipts')
|
||||
@ApiTags('sale-receipts')
|
||||
@PublicRoute()
|
||||
export class SaleReceiptsController {
|
||||
constructor(private saleReceiptApplication: SaleReceiptApplication) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new sale receipt.' })
|
||||
createSaleReceipt(@Body() saleReceiptDTO: ISaleReceiptDTO) {
|
||||
return this.saleReceiptApplication.createSaleReceipt(saleReceiptDTO);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@ApiOperation({ summary: 'Edit the given sale receipt.' })
|
||||
editSaleReceipt(
|
||||
@Param('id', ParseIntPipe) id: number,
|
||||
@Body() saleReceiptDTO: ISaleReceiptDTO,
|
||||
@@ -31,26 +35,31 @@ export class SaleReceiptsController {
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Retrieves the sale receipt details.' })
|
||||
getSaleReceipt(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.saleReceiptApplication.getSaleReceipt(id);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOperation({ summary: 'Delete the given sale receipt.' })
|
||||
deleteSaleReceipt(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.saleReceiptApplication.deleteSaleReceipt(id);
|
||||
}
|
||||
|
||||
@Post(':id/close')
|
||||
@ApiOperation({ summary: 'Close the given sale receipt.' })
|
||||
closeSaleReceipt(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.saleReceiptApplication.closeSaleReceipt(id);
|
||||
}
|
||||
|
||||
@Get(':id/pdf')
|
||||
@ApiOperation({ summary: 'Retrieves the sale receipt PDF.' })
|
||||
getSaleReceiptPdf(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.saleReceiptApplication.getSaleReceiptPdf(0, id);
|
||||
}
|
||||
|
||||
@Get('state')
|
||||
@ApiOperation({ summary: 'Retrieves the sale receipt state.' })
|
||||
getSaleReceiptState() {
|
||||
return this.saleReceiptApplication.getSaleReceiptState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user