-- Welfare Assistance Request Tracking Table
-- Database: salah

CREATE TABLE IF NOT EXISTS welfare_requests (
    id VARCHAR(50) PRIMARY KEY,
    recipient_name VARCHAR(255) NOT NULL,
    phone VARCHAR(20) NOT NULL,
    address TEXT,
    masjid VARCHAR(255),
    financial_request DECIMAL(10,2),
    request_date DATETIME DEFAULT CURRENT_TIMESTAMP,
    document_path VARCHAR(500),
    document_type VARCHAR(10),
    status VARCHAR(50) DEFAULT 'pending',
    notes TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX idx_recipient_name (recipient_name),
    INDEX idx_request_date (request_date),
    INDEX idx_status (status)
);
