export interface Actual {
  id: string;
  project_id: string;
  team_member_id: string | null;
  month: string;
  hours_logged: string;
  notes: string | null;
  variance: {
    allocated_hours: string | null;
    variance_percentage: number | null;
    variance_indicator: 'green' | 'yellow' | 'red' | 'gray';
  };
  created_at: string;
  updated_at: string;
  project?: {
    id: string;
    code: string;
    title: string;
  };
  team_member?: {
    id: string;
    name: string;
  };
}

export interface CreateActualRequest {
  project_id: string;
  team_member_id: string | null;
  month: string;
  hours: number;
  notes?: string | undefined;
}

export interface UpdateActualRequest {
  hours_logged: number;
  notes?: string;
}

export interface ActualVariance {
  allocated: number;
  actual: number;
  variance_percentage: number;
  indicator: 'green' | 'yellow' | 'red';
}

export interface ActualGridItem {
  id: string;
  project_id: string;
  project: {
    id: string;
    code: string;
    title: string;
    status?: unknown;
    is_active: boolean;
  };
  team_member_id: string | null;
  team_member: { id: string; name: string; is_active: boolean } | null;
  month: string;
  allocated_hours: string;
  actual_hours: string;
  variance_percentage: number | null;
  variance_display: string | null;
  variance_indicator: 'green' | 'yellow' | 'red' | 'gray';
  notes: string | null;
  is_readonly: boolean;
}

export interface ActualsMeta {
  current_page: number;
  last_page: number;
  total: number;
  per_page: number;
}

export interface ActualsPaginatedResponse<T> {
  data: T;
  meta: ActualsMeta;
}

export interface ActualsQueryParams {
  project_ids?: string[];
  team_member_ids?: string[];
  include_inactive?: boolean;
  search?: string;
  page?: number;
  per_page?: number;
}
