mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
37 lines
851 B
TypeScript
37 lines
851 B
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsBoolean, IsIn, IsNumber, IsOptional, IsString, Min } from 'class-validator';
|
|
|
|
export class GenerateInvoiceDto {
|
|
@ApiPropertyOptional({ description: 'Create even when the calculated amount is zero.' })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
confirmZero?: boolean;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
performedBy?: string;
|
|
|
|
@ApiPropertyOptional({ enum: ['ETB', 'USD'], description: 'Currency to bill the generated invoice in.' })
|
|
@IsOptional()
|
|
@IsIn(['ETB', 'USD'])
|
|
billingCurrency?: 'ETB' | 'USD';
|
|
}
|
|
|
|
export class PayInvoiceBodyDto {
|
|
@ApiPropertyOptional()
|
|
@IsNumber()
|
|
@Min(0.01)
|
|
amount!: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
method?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
reference?: string;
|
|
}
|