-- ====================================================================
-- INTERNAL IT PORTAL TUG
-- Initial Seed Data
--
-- Safe to run more than once: it only ADDS rows that are missing. It never changes or
-- overwrites an application or category that already exists (the ON DUPLICATE KEY clauses
-- below deliberately update nothing), so importing it again cannot damage a live catalogue.
-- ====================================================================

-- 1. Administrator account
-- No account is seeded here: a password written into the repository is a password everyone
-- who has seen the repository knows. `php database/migrate.php` creates the first admin with a random
-- password (printed once) or with the ADMIN_INITIAL_PASSWORD environment variable.

-- 2. Categories (how applications are grouped on the dashboard)
INSERT INTO categories (id, name, sort_order) VALUES
(1, 'Operations', 10),
(2, 'IT & Support', 20),
(3, 'Guest Experience', 30),
(4, 'Administration', 40)
ON DUPLICATE KEY UPDATE id = id;

-- 3. Applications
INSERT INTO portal_apps (id, name, category_id, description, target_url, icon_path, open_in_new_tab, sort_order, is_active) VALUES
(
    1,
    'PLU Management System',
    1,
    'PLU requests, item master data and the wine list for the outlets.',
    'https://plumanagementsystem.portaltug.com',
    'assets/icons/apps/plu-system.svg',
    1,
    10,
    1
),
(
    2,
    'Update OCENT',
    1,
    'Order confirmation data updates.',
    'https://updateocent.portaltug.com',
    'assets/icons/apps/update-oc.svg',
    1,
    20,
    1
),
(
    3,
    'IT Ticketing',
    2,
    'Report and track IT issues and service requests.',
    'https://ticketing.portaltug.com',
    'assets/icons/apps/support-ticketing.svg',
    1,
    30,
    1
),
(
    4,
    'Wine Booklet',
    3,
    'The digital wine list shown on the tablets.',
    'https://winebooklet.portaltug.com',
    'assets/icons/apps/analytics.svg',
    1,
    40,
    1
)
ON DUPLICATE KEY UPDATE id = id;
