-- Migration: Add commission rate and cashback rate to suppliers table
-- These rates are per-supplier. NULL means use global default from settings table.

ALTER TABLE suppliers
ADD COLUMN commissionRate DECIMAL(5,2) NULL 
  COMMENT 'Supplier-specific commission rate percentage. NULL = use global default from settings',
ADD COLUMN cashbackRate DECIMAL(5,2) NULL 
  COMMENT 'Supplier-specific cashback rate percentage. NULL = use global default from settings';

-- Add indexes for better query performance
CREATE INDEX idx_suppliers_commission_rate ON suppliers(commissionRate);
CREATE INDEX idx_suppliers_cashback_rate ON suppliers(cashbackRate);

-- Note: Existing suppliers will have NULL values, which means they'll use global defaults
-- Admins can set individual rates through the Manage Suppliers interface

