Files
gridpilot.gg/apps/api/src/domain/payments/dtos/PaymentDTO.ts
2026-01-16 21:44:26 +01:00

57 lines
1.1 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger';
import { IsDate, IsEnum, IsNumber, IsOptional, IsString } from 'class-validator';
import { PayerType } from './PayerType';
import { PaymentStatus } from './PaymentStatus';
import { PaymentType } from './PaymentType';
export class PaymentDTO {
@ApiProperty()
@IsString()
id!: string;
@ApiProperty({ enum: PaymentType })
@IsEnum(PaymentType)
type!: PaymentType;
@ApiProperty()
@IsNumber()
amount!: number;
@ApiProperty()
@IsNumber()
platformFee!: number;
@ApiProperty()
@IsNumber()
netAmount!: number;
@ApiProperty()
@IsString()
payerId!: string;
@ApiProperty({ enum: PayerType })
@IsEnum(PayerType)
payerType!: PayerType;
@ApiProperty()
@IsString()
leagueId!: string;
@ApiProperty({ required: false })
@IsOptional()
@IsString()
seasonId?: string;
@ApiProperty({ enum: PaymentStatus })
@IsEnum(PaymentStatus)
status!: PaymentStatus;
@ApiProperty()
@IsDate()
createdAt!: Date;
@ApiProperty({ required: false })
@IsOptional()
@IsDate()
completedAt?: Date;
}