68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
import { BaseStatusDto } from 'src/core/modules/infrastructure/dto/base-status.dto';
|
|
import { RefundEntity } from '../../domain/entities/refund.entity';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNumber, IsString, ValidateIf } from 'class-validator';
|
|
import { Exclude } from 'class-transformer';
|
|
import { TransactionEntity } from 'src/modules/transaction/transaction/domain/entities/transaction.entity';
|
|
import { RefundType } from '../../constants';
|
|
|
|
export class RefundDto extends BaseStatusDto implements RefundEntity {
|
|
@ApiProperty({
|
|
type: String,
|
|
required: true,
|
|
example: RefundType.BOOKING,
|
|
})
|
|
@IsString()
|
|
type: RefundType;
|
|
|
|
@ApiProperty({
|
|
type: Number,
|
|
example: 1750000,
|
|
})
|
|
@IsNumber()
|
|
refund_total: number;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
required: false,
|
|
example: 'BCA',
|
|
})
|
|
bank_name: string;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
required: false,
|
|
example: 'andhika',
|
|
})
|
|
bank_account_name: string;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
required: false,
|
|
example: '64222456',
|
|
})
|
|
bank_account_number: string;
|
|
|
|
@ApiProperty({
|
|
type: Object,
|
|
required: true,
|
|
example: {
|
|
id: 'uuid',
|
|
invoice_code: 'INV-',
|
|
},
|
|
})
|
|
transaction: TransactionEntity;
|
|
|
|
@Exclude()
|
|
code: string;
|
|
|
|
@Exclude()
|
|
request_date: Date;
|
|
|
|
@Exclude()
|
|
refund_date: Date;
|
|
|
|
@Exclude()
|
|
transaction_id: string;
|
|
}
|