-- Minimal Dolibarr reference/seed data for integration testing

INSERT INTO llx_c_country (rowid, code, code_iso, label, active) VALUES (1, 'US', 'USA', 'United States', 1);

INSERT INTO llx_categorie (rowid, entity, fk_parent, label, type, description, visible)
VALUES
    (1, 1, 0, 'Electronics', 0, 'Electronics category', 1),
    (2, 1, 0, 'Accessories', 0, 'Accessories category', 1);

INSERT INTO llx_product (rowid, ref, entity, label, description, price, price_ttc, tva_tx, weight, weight_units, barcode, tosell, tobuy, fk_product_type, seuil_stock_alerte, datec)
VALUES
    (1, 'WIDGET-001', 1, 'Widget Pro', 'A very fine widget.', 100.00, 119.99, 20.0000, 1.5, 3, '1234567890123', 1, 1, 0, 5, NOW()),
    (2, 'GADGET-002', 1, 'Gadget Max', 'A gadget with no stock yet.', 50.00, 59.99, 20.0000, 0.5, 3, '1234567890124', 1, 1, 0, 5, NOW()),
    (3, 'SVC-003',    1, 'Setup Service', 'A service, not a stocked product.', 75.00, 90.00, 20.0000, NULL, NULL, NULL, 1, 0, 1, NULL, NOW());

-- Widget stock split across 2 warehouses: 15 + 8 = 23
INSERT INTO llx_product_stock (rowid, fk_product, fk_entrepot, reel) VALUES
    (1, 1, 1, 15),
    (2, 1, 2, 8);
-- Gadget (id 2) intentionally has NO stock rows -> should sync to 0

INSERT INTO llx_categorie_product (fk_categorie, fk_product) VALUES
    (1, 1), -- Widget -> Electronics
    (2, 1), -- Widget -> Accessories (multi-category)
    (2, 2); -- Gadget -> Accessories
