mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
refactor(nestjs): hook the new endpoints
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { BillPaymentsApplication } from './BillPaymentsApplication.service';
|
||||
import { ApiOperation, ApiParam, ApiTags } from '@nestjs/swagger';
|
||||
@@ -13,6 +14,7 @@ import {
|
||||
CreateBillPaymentDto,
|
||||
EditBillPaymentDto,
|
||||
} from './dtos/BillPayment.dto';
|
||||
import { GetBillPaymentsFilterDto } from './dtos/GetBillPaymentsFilter.dto';
|
||||
|
||||
@Controller('bill-payments')
|
||||
@ApiTags('bill-payments')
|
||||
@@ -57,6 +59,18 @@ export class BillPaymentsController {
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':billPaymentId/bills')
|
||||
@ApiOperation({ summary: 'Retrieves the bills of the given bill payment.' })
|
||||
@ApiParam({
|
||||
name: 'billPaymentId',
|
||||
required: true,
|
||||
type: Number,
|
||||
description: 'The bill payment id',
|
||||
})
|
||||
public getPaymentBills(@Param('billPaymentId') billPaymentId: string) {
|
||||
return this.billPaymentsApplication.getPaymentBills(Number(billPaymentId));
|
||||
}
|
||||
|
||||
@Get(':billPaymentId')
|
||||
@ApiOperation({ summary: 'Retrieves the bill payment details.' })
|
||||
@ApiParam({
|
||||
@@ -69,15 +83,9 @@ export class BillPaymentsController {
|
||||
return this.billPaymentsApplication.getBillPayment(Number(billPaymentId));
|
||||
}
|
||||
|
||||
@Get(':billPaymentId/bills')
|
||||
@ApiOperation({ summary: 'Retrieves the bills of the given bill payment.' })
|
||||
@ApiParam({
|
||||
name: 'billPaymentId',
|
||||
required: true,
|
||||
type: Number,
|
||||
description: 'The bill payment id',
|
||||
})
|
||||
public getPaymentBills(@Param('billPaymentId') billPaymentId: string) {
|
||||
return this.billPaymentsApplication.getPaymentBills(Number(billPaymentId));
|
||||
@Get('')
|
||||
@ApiOperation({ summary: 'Retrieves the bill payments list.' })
|
||||
public getBillPayments(@Query() filterDTO: GetBillPaymentsFilterDto) {
|
||||
return this.billPaymentsApplication.getBillPayments(filterDTO);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user