chore: add direct payment for invoice

This commit is contained in:
Mahyargdz
2025-05-14 16:31:05 +03:30
parent eae5981ea1
commit 2ac29d1a91
9 changed files with 82 additions and 19 deletions
@@ -1,5 +1,5 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsEnum, IsInt, IsNotEmpty, IsUUID, IsUrl, Min } from "class-validator";
import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsUUID, IsUrl, Min } from "class-validator";
import { WalletMessage } from "../../../common/enums/message.enum";
import { TransferType } from "../enums/payment-type.enum";
@@ -22,6 +22,12 @@ export class GatewayDepositDto extends DepositDto {
@IsUUID("4", { message: WalletMessage.GATEWAY_ID_SHOULD_BE_UUID })
@ApiProperty({ description: "Gateway id to pay", example: "e6fdce2a-9f91-47c4-8561-48368fc275b5" })
gatewayId: string;
@IsOptional()
@IsNotEmpty({ message: WalletMessage.INVOICE_ID_REQUIRED })
@IsUUID("4", { message: WalletMessage.INVOICE_ID_SHOULD_BE_UUID })
@ApiProperty({ description: "Invoice id to pay", example: "e6fdce2a-9f91-47c4-8561-48368fc275b5" })
invoiceId?: string;
}
export class TransferDepositDto extends DepositDto {
@@ -1,4 +1,4 @@
import { IsEnum, IsNotEmpty } from "class-validator";
import { IsEnum, IsNotEmpty, IsOptional } from "class-validator";
import { GatewayEnum } from "../enums/gateway.enum";
import { GatewayType } from "../types/gateway.type";
@@ -8,6 +8,10 @@ export class VerifyParamDto {
@IsNotEmpty()
@IsEnum(GatewayEnum)
gateway: GatewayType;
@IsOptional()
@IsNotEmpty()
invoiceId?: string;
}
export class VerifyQueryDto {