import { ApiProperty } from '@nestjs/swagger';
import { IsDateString, IsEnum, IsNumber, IsString } from 'class-validator';

export class InvoiceDTO {
  @ApiProperty()
  @IsString()
  id: string = '';

  @ApiProperty()
  @IsString()
  invoiceNumber: string = '';

  @ApiProperty()
  @IsDateString()
  date: string = '';

  @ApiProperty()
  @IsDateString()
  dueDate: string = '';

  @ApiProperty()
  @IsNumber()
  amount: number = 0;

  @ApiProperty()
  @IsNumber()
  vatAmount: number = 0;

  @ApiProperty()
  @IsNumber()
  totalAmount: number = 0;

  @ApiProperty({ enum: ['paid', 'pending', 'overdue', 'failed'] })
  @IsEnum(['paid', 'pending', 'overdue', 'failed'])
  status: 'paid' | 'pending' | 'overdue' | 'failed' = 'pending';

  @ApiProperty()
  @IsString()
  description: string = '';

  @ApiProperty({ enum: ['league', 'team', 'driver', 'race', 'platform'] })
  @IsEnum(['league', 'team', 'driver', 'race', 'platform'])
  sponsorshipType: 'league' | 'team' | 'driver' | 'race' | 'platform' = 'league';

  @ApiProperty()
  @IsString()
  pdfUrl: string = '';
}