feat: finish working on account transaction webhook

This commit is contained in:
Abdalhamid Alhamad
2025-07-09 13:31:08 +03:00
parent 3b3f8c0104
commit 038b8ef6e3
15 changed files with 249 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Expose, Type } from 'class-transformer';
import { IsNumber, IsString, ValidateNested } from 'class-validator';
import { IsNumber, IsString, Min, ValidateNested } from 'class-validator';
export class CardAcceptorLocationDto {
@Expose()
@ -99,6 +99,7 @@ export class CardTransactionWebhookRequest {
@Type(() => Number)
@IsNumber()
@Min(0, { message: 'amount must be zero or a positive number' })
@ApiProperty({ example: '100.5' })
transactionAmount!: number;
@ -108,6 +109,7 @@ export class CardTransactionWebhookRequest {
@Type(() => Number)
@IsNumber()
@Min(0, { message: 'amount must be zero or a positive number' })
@ApiProperty({ example: '100.5' })
billingAmount!: number;
@ -117,6 +119,7 @@ export class CardTransactionWebhookRequest {
@Type(() => Number)
@IsNumber()
@Min(0, { message: 'amount must be zero or a positive number' })
@ApiProperty({ example: '100.5' })
settlementAmount!: number;
@ -127,12 +130,14 @@ export class CardTransactionWebhookRequest {
@Expose()
@Type(() => Number)
@IsNumber()
@Min(0, { message: 'amount must be zero or a positive number' })
@ApiProperty({ example: '20' })
fees!: number;
@Expose()
@Type(() => Number)
@IsNumber()
@Min(0, { message: 'amount must be zero or a positive number' })
@ApiProperty({ example: '4.5' })
vatOnFees!: number;