-- Recertification notification type (shopdb-flask)
--
-- Employee-photo type (blue, like recognition) for employees who must retake a
-- training course. The shopfloor feed splits it one card per employee and the
-- dashboard shows it in a blue "Recertification Required" carousel; the display
-- window is two weeks (computed server-side in the notifications API).
--
-- Idempotent - safe to re-run. The notifications plugin also seeds this type on
-- install (plugins/notifications/plugin.py); this file is for databases that
-- already exist and are not re-installed.

INSERT INTO notificationtypes (typename, typedescription, typecolor, isactive)
SELECT * FROM (
    SELECT 'Recertification' AS typename,
           'Employees due to retake a training course (shows two weeks)' AS typedescription,
           'recertification' AS typecolor,
           1 AS isactive
) AS t
WHERE NOT EXISTS (
    SELECT 1 FROM notificationtypes WHERE typename = 'Recertification'
);
