import { IsEnum, IsOptional, IsString, IsNumber, IsDateString } from 'class-validator'

export class CreateTransactionDto {
  @IsEnum(['intake', 'disbursement', 'refund', 'invoice_applied'])
  type: 'intake' | 'disbursement' | 'refund' | 'invoice_applied'

  @IsNumber()
  amount: number   // always positive — service applies sign based on type

  @IsOptional() @IsDateString() date?: string
  @IsOptional() @IsString() description?: string
  @IsOptional() @IsString() invoiceRef?: string
  @IsOptional() @IsString() matterId?: string
  @IsOptional() @IsString() createdBy?: string
}
