import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, 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;
}

export class PayInvoiceBodyDto {
  @ApiPropertyOptional()
  @IsNumber()
  @Min(0.01)
  amount!: number;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  method?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  reference?: string;
}
