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

@@ -18,6 +18,7 @@ import {
IPaymentsReceivedFilter,
PaymentReceiveMailOptsDTO,
} from './types/PaymentReceived.types';
import { CreatePaymentReceivedDto, EditPaymentReceivedDto } from './dtos/PaymentReceived.dto';
@Controller('payments-received')
@ApiTags('payments-received')
@@ -57,7 +58,7 @@ export class PaymentReceivesController {
@Post()
@ApiOperation({ summary: 'Create a new payment received.' })
public createPaymentReceived(
@Body() paymentReceiveDTO: IPaymentReceivedCreateDTO,
@Body() paymentReceiveDTO: CreatePaymentReceivedDto,
) {
return this.paymentReceivesApplication.createPaymentReceived(
paymentReceiveDTO,
@@ -68,7 +69,7 @@ export class PaymentReceivesController {
@ApiOperation({ summary: 'Edit the given payment received.' })
public editPaymentReceive(
@Param('id', ParseIntPipe) paymentReceiveId: number,
@Body() paymentReceiveDTO: IPaymentReceivedEditDTO,
@Body() paymentReceiveDTO: EditPaymentReceivedDto,
) {
return this.paymentReceivesApplication.editPaymentReceive(
paymentReceiveId,