type PriorityInput = {
  plan: "basic" | "standard" | "premium";
  emergency?: boolean;
  description?: string;
};

export function calculatePriority({
  plan,
  emergency,
  description
}: PriorityInput) {
  let score = 0;

  // Base by plan
  if (plan === "premium") score += 30;
  if (plan === "standard") score += 20;
  if (plan === "basic") score += 10;

  // Emergency toggle
  if (emergency) score += 40;

  // Simple keyword detection (MVP-safe)
  if (description?.toLowerCase().includes("no heat") ||
      description?.toLowerCase().includes("no cool")) {
    score += 25;
  }

  return score;
}
