-- Unified donations table
CREATE TABLE donations (
    id INT PRIMARY KEY AUTO_INCREMENT,
    type ENUM('ramadan', 'qurbani', 'general') NOT NULL,
    branch_id INT,
    donation_category_id INT,
    name VARCHAR(255),
    contact VARCHAR(100),
    email VARCHAR(255),
    amount DECIMAL(12,2) NOT NULL,
    payment_method_id INT,
    receipt_no VARCHAR(100),
    address VARCHAR(255),
    note TEXT,
    collected_by INT,
    collected_at DATETIME,
    status ENUM('pending', 'completed', 'cancelled') DEFAULT 'completed',
    transaction_id VARCHAR(255),
    extra_fields JSON,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Add foreign key constraints as needed for branch_id, payment_method_id, collected_by, etc.