-- ============================================================
-- SARS 2026 (2025/26) Tax Rebates & Medical Tax Credits
-- CostusWorx © 2026 — retire.costusworx.co.za
-- ============================================================
--
-- Run AFTER tax_schema.sql (tables must exist).
-- Safe to re-run: DELETE + INSERT pattern.
--
-- Sources:
--   SARS Budget 2025 (effective 1 March 2025):
--   Primary rebate:    R17,235
--   Secondary (65+):   R9,444
--   Tertiary (75+):    R3,145
--   Medical credit:    R364/month (main member and first dependant)
--                      R246/month (each additional dependant from 3rd person)
--
-- credit_per_dep covers the first dependant at R364; subsequent dependants
-- are charged the same here for simplicity. Adjust per client if needed.
-- ============================================================

SET NAMES utf8mb4;

-- ── Tax Rebates 2026 ──────────────────────────────────────────────────────────

DELETE FROM tax_rebates WHERE tax_year = 2026;

INSERT INTO tax_rebates (tax_year, rebate_type, amount, age_threshold) VALUES
    (2026, 'primary',   17235.00, NULL),
    (2026, 'secondary',  9444.00, 65),
    (2026, 'tertiary',   3145.00, 75);

-- ── Medical Tax Credits 2026 ──────────────────────────────────────────────────

INSERT INTO medical_tax_credits (tax_year, credit_per_main, credit_per_dep)
VALUES (2026, 364.00, 364.00)
ON DUPLICATE KEY UPDATE
    credit_per_main = VALUES(credit_per_main),
    credit_per_dep  = VALUES(credit_per_dep);
