refactor
This commit is contained in:
57
apps/api/src/domain/payments/dtos/PaymentDTO.ts
Normal file
57
apps/api/src/domain/payments/dtos/PaymentDTO.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, IsEnum, IsOptional, IsDate } from 'class-validator';
|
||||
import { PaymentType } from './PaymentType';
|
||||
import { PayerType } from './PayerType';
|
||||
import { PaymentStatus } from './PaymentStatus';
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user