diff --git a/src/order/infraestructure/controller/order.controller.ts b/src/order/infraestructure/controller/order.controller.ts index fb5b5c3f..4b6ffbab 100644 --- a/src/order/infraestructure/controller/order.controller.ts +++ b/src/order/infraestructure/controller/order.controller.ts @@ -344,8 +344,8 @@ export class OrderController { paymentId: data.paymentId ? data.paymentId : paymentId, - currency: data.currency - ? data.currency.toLowerCase() + currency: data.currency ? + data.currency.toLowerCase() : 'usd', paymentMethod: data.paymentMethod, directionId: data.idUserDirection, @@ -429,7 +429,9 @@ export class OrderController { paymentId: data.paymentId ? data.paymentId : paymentId, - currency: data.currency.toLowerCase(), + currency: data.currency ? + data.currency.toLowerCase() + : 'usd', paymentMethod: data.paymentMethod, directionId: data.idUserDirection, products: data.products, diff --git a/src/order/infraestructure/dto/payment-entry-dto.ts b/src/order/infraestructure/dto/payment-entry-dto.ts index 0d4af252..34769401 100644 --- a/src/order/infraestructure/dto/payment-entry-dto.ts +++ b/src/order/infraestructure/dto/payment-entry-dto.ts @@ -18,8 +18,7 @@ export class PaymentEntryDto { }) @IsString() @IsOptional() - @Transform(({ value }) => value ?? 'usd') - currency: string; + currency?: string; @ApiProperty({ example: 'credit', description: 'The method of payment used' }) @Transform(({ value }) => value ?? 'credit') diff --git a/src/order/infraestructure/dto/wallet-payment-entry-dto.ts b/src/order/infraestructure/dto/wallet-payment-entry-dto.ts index cfbb4c7d..6cbe9aa8 100644 --- a/src/order/infraestructure/dto/wallet-payment-entry-dto.ts +++ b/src/order/infraestructure/dto/wallet-payment-entry-dto.ts @@ -16,7 +16,8 @@ export class WalletPaymentEntryDto { description: 'The currency in which the payment is made, only use USD, EUR or BSF', }) @IsString() - currency: string; + @IsOptional() + currency?: string; @ApiProperty({ example: 'card', description: 'The method of payment used' }) @IsString()