-- ============================================
-- TEMPLATE-SAAS: Commissions Enums
-- Version: 1.0.0
-- Module: SAAS-020
-- ============================================

-- Scheme type enum (how commission is calculated)
CREATE TYPE commissions.scheme_type AS ENUM (
  'percentage',    -- Percentage of sale amount
  'fixed',         -- Fixed amount per sale
  'tiered'         -- Tiered rates based on amount ranges
);

-- Applies to enum (what the commission applies to)
CREATE TYPE commissions.applies_to AS ENUM (
  'all',           -- All sales
  'products',      -- Specific products only
  'categories'     -- Specific categories only
);

-- Entry status enum (commission entry lifecycle)
CREATE TYPE commissions.entry_status AS ENUM (
  'pending',       -- Awaiting approval
  'approved',      -- Approved, pending payment
  'rejected',      -- Rejected by admin
  'paid',          -- Commission has been paid
  'cancelled'      -- Cancelled (e.g., sale reversed)
);

-- Period status enum (payment period lifecycle)
CREATE TYPE commissions.period_status AS ENUM (
  'open',          -- Currently accepting entries
  'closed',        -- Closed, pending processing
  'processing',    -- Being processed for payment
  'paid'           -- All commissions paid out
);
