import { IsString, IsInt, IsOptional, IsNumber, Min, IsUUID } from "class-validator";

export class TrackUsageDto {
  @IsUUID()
  workspaceId!: string;

  @IsUUID()
  userId!: string;

  @IsString()
  provider!: string;

  @IsString()
  model!: string;

  @IsOptional()
  @IsUUID()
  providerInstanceId?: string;

  @IsInt()
  @Min(0)
  promptTokens!: number;

  @IsInt()
  @Min(0)
  completionTokens!: number;

  @IsInt()
  @Min(0)
  totalTokens!: number;

  @IsOptional()
  @IsNumber()
  @Min(0)
  costCents?: number;

  @IsOptional()
  @IsString()
  taskType?: string;

  @IsOptional()
  @IsUUID()
  conversationId?: string;

  @IsOptional()
  @IsInt()
  @Min(0)
  durationMs?: number;
}
