-- Jeu d'operations factices pour tester les simulateurs de la page Outils,
-- a importer via phpMyAdmin (OPTIONNEL, environnement de test uniquement).
-- Cree 3 enseignes de demonstration si absentes, puis des depenses reparties
-- sur les 6 derniers mois POUR L'UTILISATEUR id = 1 (adapter si besoin).
-- Nettoyage : voir database/seeds/clear_operations_test.sql

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

INSERT INTO operations (user_id, type, label, amount_cents, merchant_id, operation_date) VALUES
    (1, 'expense', 'Courses hebdo',      15230, (SELECT id FROM merchants WHERE name = 'Carrefour'), DATE_SUB(CURDATE(), INTERVAL 5 MONTH)),
    (1, 'expense', 'Courses hebdo',      18790, (SELECT id FROM merchants WHERE name = 'Carrefour'), DATE_SUB(CURDATE(), INTERVAL 4 MONTH)),
    (1, 'expense', 'Courses hebdo',      21140, (SELECT id FROM merchants WHERE name = 'Carrefour'), DATE_SUB(CURDATE(), INTERVAL 3 MONTH)),
    (1, 'expense', 'Courses hebdo',      19560, (SELECT id FROM merchants WHERE name = 'Carrefour'), DATE_SUB(CURDATE(), INTERVAL 2 MONTH)),
    (1, 'expense', 'Courses hebdo',      17420, (SELECT id FROM merchants WHERE name = 'Carrefour'), DATE_SUB(CURDATE(), INTERVAL 1 MONTH)),
    (1, 'expense', 'Courses',             8930, (SELECT id FROM merchants WHERE name = 'Lidl'),      DATE_SUB(CURDATE(), INTERVAL 4 MONTH)),
    (1, 'expense', 'Courses',            11210, (SELECT id FROM merchants WHERE name = 'Lidl'),      DATE_SUB(CURDATE(), INTERVAL 2 MONTH)),
    (1, 'expense', 'Courses',             9640, (SELECT id FROM merchants WHERE name = 'Lidl'),      DATE_SUB(CURDATE(), INTERVAL 1 MONTH)),
    (1, 'expense', 'Abonnement',          1349, (SELECT id FROM merchants WHERE name = 'Netflix'),   DATE_SUB(CURDATE(), INTERVAL 5 MONTH)),
    (1, 'expense', 'Abonnement',          1349, (SELECT id FROM merchants WHERE name = 'Netflix'),   DATE_SUB(CURDATE(), INTERVAL 4 MONTH)),
    (1, 'expense', 'Abonnement',          1349, (SELECT id FROM merchants WHERE name = 'Netflix'),   DATE_SUB(CURDATE(), INTERVAL 3 MONTH)),
    (1, 'expense', 'Abonnement',          1349, (SELECT id FROM merchants WHERE name = 'Netflix'),   DATE_SUB(CURDATE(), INTERVAL 2 MONTH)),
    (1, 'expense', 'Abonnement',          1349, (SELECT id FROM merchants WHERE name = 'Netflix'),   DATE_SUB(CURDATE(), INTERVAL 1 MONTH));
