refactor(nestjs): validation schema dtos

This commit is contained in:
Ahmed Bouhuolia
2025-05-25 23:39:54 +02:00
parent 2b3f98d8fe
commit 24bf3dd06d
24 changed files with 247 additions and 135 deletions

View File

@@ -21,6 +21,7 @@ import {
ApiHeader,
ApiOperation,
ApiParam,
ApiQuery,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
@@ -111,7 +112,7 @@ export class SaleInvoicesController {
return this.saleInvoiceApplication.deleteSaleInvoice(id);
}
@Get('receivable/:customerId?')
@Get('receivable')
@ApiOperation({ summary: 'Retrieves the receivable sale invoices.' })
@ApiResponse({
status: 200,
@@ -119,13 +120,13 @@ export class SaleInvoicesController {
'The receivable sale invoices have been successfully retrieved.',
})
@ApiResponse({ status: 404, description: 'The customer not found.' })
@ApiParam({
@ApiQuery({
name: 'customerId',
required: false,
type: Number,
description: 'The customer id',
})
getReceivableSaleInvoices(@Param('customerId') customerId?: number) {
getReceivableSaleInvoices(@Query('customerId') customerId?: number) {
return this.saleInvoiceApplication.getReceivableSaleInvoices(customerId);
}