import { IsString, IsNumber, IsBoolean, IsOptional, IsDateString, IsIn, Min } from 'class-validator'

const CATEGORIES = ['court_filing','translation','notarization','travel','accommodation','courier','printing','government_fee','expert_witness','other']

export class CreateExpenseDto {
  @IsString()
  clientFolderId: string

  @IsOptional() @IsString()
  matterId?: string

  @IsString()
  description: string

  @IsIn(CATEGORIES)
  category: string

  @IsNumber() @Min(0)
  amount: number

  @IsOptional() @IsString()
  currency?: string

  @IsDateString()
  expenseDate: string

  @IsOptional() @IsBoolean()
  billable?: boolean

  @IsOptional() @IsBoolean()
  vatIncluded?: boolean

  @IsOptional() @IsNumber()
  vatRate?: number

  @IsOptional() @IsString()
  receiptUrl?: string

  @IsOptional() @IsString()
  notes?: string

  @IsString()
  createdBy: string
}
