-- Fausses transactions de juillet 2026 (celles de la maquette) pour tester le
-- rendu de la page "Mois en cours". A importer via phpMyAdmin.
-- POUR L'UTILISATEUR id = 1 (adapter si besoin).
-- Nettoyage : database/seeds/clear_operations_juillet_2026_demo.sql

-- Categories et enseignes utilisees (creees seulement si absentes)
INSERT IGNORE INTO categories (name, color, icon) VALUES
    ('Logement', '#6284f5', 'fa-solid fa-house'),
    ('Courses', '#ef4869', 'fa-solid fa-cart-shopping'),
    ('Transport', '#10b981', 'fa-solid fa-bus'),
    ('Restaurants', '#f5a623', 'fa-solid fa-utensils'),
    ('Loisirs', '#8b5cf6', 'fa-solid fa-gamepad'),
    ('Abonnements', '#f97316', 'fa-solid fa-repeat'),
    ('Divers', '#94a3b8', 'fa-solid fa-ellipsis');

INSERT IGNORE INTO merchants (name) VALUES
    ('Carrefour'), ('Lidl'), ('Monoprix'), ('Netflix'), ('Spotify');

-- Operations de juillet 2026
INSERT INTO operations (user_id, type, kind, label, amount_cents, category_id, merchant_id, operation_date) VALUES
    (1, 'income',  'salary',       'Salaire',                  238000, NULL, NULL, '2026-07-01'),
    (1, 'expense', 'fixed',        'Loyer',                     85000, (SELECT id FROM categories WHERE name = 'Logement' LIMIT 1),     NULL, '2026-07-02'),
    (1, 'expense', 'unique',       'Acompte location vacances', 45000, (SELECT id FROM categories WHERE name = 'Loisirs' LIMIT 1),      NULL, '2026-07-02'),
    (1, 'expense', 'fixed',        'Électricité',                4500, (SELECT id FROM categories WHERE name = 'Logement' LIMIT 1),     NULL, '2026-07-03'),
    (1, 'expense', 'unique',       'Carrefour',                 11220, (SELECT id FROM categories WHERE name = 'Courses' LIMIT 1),      (SELECT id FROM merchants WHERE name = 'Carrefour' LIMIT 1), '2026-07-03'),
    (1, 'expense', 'fixed',        'Passe Navigo',               8640, (SELECT id FROM categories WHERE name = 'Transport' LIMIT 1),    NULL, '2026-07-04'),
    (1, 'expense', 'subscription', 'Internet fibre',             2999, (SELECT id FROM categories WHERE name = 'Abonnements' LIMIT 1),  NULL, '2026-07-05'),
    (1, 'expense', 'subscription', 'Forfait mobile',             1999, (SELECT id FROM categories WHERE name = 'Abonnements' LIMIT 1),  NULL, '2026-07-05'),
    (1, 'expense', 'subscription', 'Netflix',                    1349, (SELECT id FROM categories WHERE name = 'Abonnements' LIMIT 1),  (SELECT id FROM merchants WHERE name = 'Netflix' LIMIT 1), '2026-07-06'),
    (1, 'expense', 'subscription', 'Spotify',                    1099, (SELECT id FROM categories WHERE name = 'Abonnements' LIMIT 1),  (SELECT id FROM merchants WHERE name = 'Spotify' LIMIT 1), '2026-07-06'),
    (1, 'expense', 'unique',       'Déjeuner équipe',            3370, (SELECT id FROM categories WHERE name = 'Restaurants' LIMIT 1),  NULL, '2026-07-07'),
    (1, 'expense', 'unique',       'Lidl',                       7080, (SELECT id FROM categories WHERE name = 'Courses' LIMIT 1),      (SELECT id FROM merchants WHERE name = 'Lidl' LIMIT 1), '2026-07-10'),
    (1, 'expense', 'unique',       'Équipement plage',           6490, (SELECT id FROM categories WHERE name = 'Divers' LIMIT 1),       NULL, '2026-07-15'),
    (1, 'expense', 'unique',       'Carrefour',                 10210, (SELECT id FROM categories WHERE name = 'Courses' LIMIT 1),      (SELECT id FROM merchants WHERE name = 'Carrefour' LIMIT 1), '2026-07-17'),
    (1, 'expense', 'unique',       'Pizzeria',                   4640, (SELECT id FROM categories WHERE name = 'Restaurants' LIMIT 1),  NULL, '2026-07-18'),
    (1, 'expense', 'unique',       'Monoprix',                   4870, (SELECT id FROM categories WHERE name = 'Courses' LIMIT 1),      (SELECT id FROM merchants WHERE name = 'Monoprix' LIMIT 1), '2026-07-24');
