-- Script de vérification pour le deuxième lot de produits en mode ADMIN
-- Date: 02/07/2025

-- Vérification du nombre total d'articles ajoutés (doit être 52)
SELECT 
    'Total articles batch 2' as verification,
    COUNT(*) as count
FROM stock s
JOIN products p ON s.product_id = p.id
WHERE s.store_id = 1 
AND s.stock_type = 'admin'
AND s.created_at >= '2025-02-07';

-- Vérification par catégorie
SELECT 
    c.name as category,
    COUNT(*) as count,
    SUM(s.quantity) as total_quantity
FROM stock s
JOIN products p ON s.product_id = p.id
JOIN categories c ON p.category_id = c.id
WHERE s.store_id = 1 
AND s.stock_type = 'admin'
AND s.created_at >= '2025-02-07'
GROUP BY c.name
ORDER BY c.name;

-- Vérification des nouvelles couleurs ajoutées
SELECT 
    'Nouvelles couleurs batch 2' as verification,
    GROUP_CONCAT(name SEPARATOR ', ') as colors
FROM colors 
WHERE name IN ('Turquoise', 'Green Fluo', 'Brown Chocolate', 'Dark Grey', 'Gardenia', 
               'Flare Beige', 'Cross Beige', 'Dark Purple', 'Cape Blue', 'Light Blue', 
               'Midnight Blue', 'Light Purple', 'Red Cherry', 'Amy', 'Black Cream');

-- Détail des produits ajoutés avec leurs quantités
SELECT 
    p.name as product_name,
    co.name as color,
    si.name as size,
    s.quantity,
    p.retail_price,
    ca.name as category
FROM stock s
JOIN products p ON s.product_id = p.id
JOIN colors co ON p.color_id = co.id
JOIN sizes si ON p.size_id = si.id
JOIN categories ca ON p.category_id = ca.id
WHERE s.store_id = 1 
AND s.stock_type = 'admin'
AND s.created_at >= '2025-02-07'
ORDER BY ca.name, p.name, co.name, si.name;
