-- Migration: 00001_create_enums
-- Description: Create all custom enum types for Dirt application
-- Author: Auto-generated
-- Date: 2025-12-15

-- ============================================
-- REQUIRED EXTENSIONS
-- ============================================
-- gen_random_uuid() is provided by pgcrypto.
-- Supabase recommends installing extensions into the `extensions` schema.
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;

-- ============================================
-- GENDER ENUM
-- ============================================
-- Gender selection for users and review subjects
-- Using inclusive terminology (man/woman vs male/female)
CREATE TYPE gender AS ENUM (
  'man',
  'woman',
  'non_binary',
  'prefer_not_to_say'
);

-- ============================================
-- REVIEW STATUS ENUM
-- ============================================
-- Review lifecycle status
CREATE TYPE review_status AS ENUM (
  'draft',           -- Author still editing
  'pending_review',  -- Submitted, awaiting moderation
  'flagged',         -- Auto-flagged by keyword scan
  'approved',        -- Live and visible
  'rejected',        -- Rejected by moderator
  'removed'          -- Removed after report/appeal
);

-- ============================================
-- RESPONSE STATUS ENUM
-- ============================================
-- Response lifecycle status
CREATE TYPE response_status AS ENUM (
  'pending_review',  -- Subject submitted, awaiting moderation
  'approved',        -- Live and visible on review
  'rejected',        -- Rejected by moderator
  'removed'          -- Removed after report/appeal
);

-- ============================================
-- REPORT REASON ENUM
-- ============================================
-- Report reasons
CREATE TYPE report_reason AS ENUM (
  'false_information',
  'harassment',
  'defamation',
  'doxxing',
  'spam',
  'inappropriate_content',
  'other'
);

-- ============================================
-- MODERATION ACTION ENUM
-- ============================================
-- Moderation actions
CREATE TYPE moderation_action AS ENUM (
  'approve',
  'reject',
  'request_changes',
  'escalate',
  'ban_user'
);

-- ============================================
-- SUBSCRIPTION TIER ENUM
-- ============================================
-- Subscription tiers
CREATE TYPE subscription_tier AS ENUM (
  'free',
  'pro_monthly',
  'pro_yearly'
);

-- ============================================
-- VERIFICATION STATUS ENUM
-- ============================================
-- Verification status
CREATE TYPE verification_status AS ENUM (
  'not_started',
  'pending',
  'verified',
  'failed',
  'expired'
);
