export type FeedbackCategory = 'bug' | 'feature' | 'complaint' | 'praise' | 'question' | 'other';
export type FeedbackSeverity = 'critical' | 'high' | 'medium' | 'low';
export type FeedbackStatus = 'new' | 'triaged' | 'in_progress' | 'resolved' | 'wont_fix';

export interface Feedback {
  id: string;
  user_id: string | null;
  user_type: 'worker' | 'contractor' | null;
  user_name: string | null;
  user_email: string | null;
  category: FeedbackCategory;
  severity: FeedbackSeverity;
  title: string;
  description: string;
  page_url: string | null;
  status: FeedbackStatus;
  admin_notes: string | null;
  resolved_at: string | null;
  created_at: string;
  updated_at: string;
}

export interface FeedbackCreateInput {
  category: FeedbackCategory;
  severity?: FeedbackSeverity;
  title: string;
  description: string;
  page_url?: string;
}

export interface FeedbackUpdateInput {
  status?: FeedbackStatus;
  severity?: FeedbackSeverity;
  admin_notes?: string;
  resolved_at?: string | null;
}

export const CATEGORY_LABELS: Record<FeedbackCategory, string> = {
  bug: '🐛 Bug',
  feature: '💡 Feature Request',
  complaint: '😤 Complaint',
  praise: '🙌 Praise',
  question: '❓ Question',
  other: '📝 Other',
};

export const SEVERITY_LABELS: Record<FeedbackSeverity, string> = {
  critical: '🔴 Critical',
  high: '🟠 High',
  medium: '🟡 Medium',
  low: '🟢 Low',
};

export const STATUS_LABELS: Record<FeedbackStatus, string> = {
  new: 'New',
  triaged: 'Triaged',
  in_progress: 'In Progress',
  resolved: 'Resolved',
  wont_fix: "Won't Fix",
};
