/**
 * @ai-summary Type definitions for ownership-costs feature
 */

// Cost types supported by ownership-costs feature
export type OwnershipCostType = 'insurance' | 'registration' | 'tax' | 'other';

// Cost interval types
export type CostInterval = 'monthly' | 'semi_annual' | 'annual' | 'one_time';

export interface OwnershipCost {
  id: string;
  userId: string;
  vehicleId: string;
  documentId?: string;
  costType: OwnershipCostType;
  description?: string;
  amount: number;
  interval: CostInterval;
  startDate: string;
  endDate?: string;
  createdAt: string;
  updatedAt: string;
}

export interface CreateOwnershipCostRequest {
  vehicleId: string;
  documentId?: string;
  costType: OwnershipCostType;
  description?: string;
  amount: number;
  interval: CostInterval;
  startDate: string;
  endDate?: string;
}

export interface UpdateOwnershipCostRequest {
  documentId?: string | null;
  costType?: OwnershipCostType;
  description?: string | null;
  amount?: number;
  interval?: CostInterval;
  startDate?: string;
  endDate?: string | null;
}

// Aggregated cost statistics
export interface OwnershipCostStats {
  insuranceCosts: number;
  registrationCosts: number;
  taxCosts: number;
  otherCosts: number;
  totalCosts: number;
}

// Display labels for cost types
export const COST_TYPE_LABELS: Record<OwnershipCostType, string> = {
  insurance: 'Insurance',
  registration: 'Registration',
  tax: 'Tax',
  other: 'Other',
};

// Display labels for intervals
export const INTERVAL_LABELS: Record<CostInterval, string> = {
  monthly: 'Monthly',
  semi_annual: 'Semi-Annual (6 months)',
  annual: 'Annual',
  one_time: 'One-Time',
};
