refactor(nestjs): hook the new endpoints

This commit is contained in:
Ahmed Bouhuolia
2025-05-22 19:55:55 +02:00
parent 4e64a9eadb
commit 2b3f98d8fe
12 changed files with 258 additions and 230 deletions

View File

@@ -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);
}
}