CREATE TABLE cashfree_setting (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,

    plan_type ENUM('PERIODIC', 'ON_DEMAND') NOT NULL,

    enach_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    upi_autopay_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    bank_transfer_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    auto_approve_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    retry_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    max_retry_count INT NOT NULL DEFAULT 0,

    retry_after_days INT DEFAULT NULL,

    retry_interval_days INT DEFAULT NULL,

    penalty_enabled BOOLEAN NOT NULL DEFAULT FALSE,

    penalty_amount DECIMAL(10,2) DEFAULT 0.00,

    is_active BOOLEAN NOT NULL DEFAULT TRUE,

    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
        ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO cashfree_setting (
    plan_type,
    enach_enabled,
    upi_autopay_enabled,
    bank_transfer_enabled,
    auto_approve_enabled,
    retry_enabled,
    max_retry_count,
    retry_after_days,
    retry_interval_days,
    penalty_enabled,
    penalty_amount,
    is_active
) VALUES (
    'PERIODIC',
    FALSE,
    FALSE,
    FALSE,
    FALSE,
    FALSE,
    0,
    NULL,
    NULL,
    FALSE,
    0.00,
    FALSE
);