-- Migration 071 — HPE Aruba CX, Ubiquiti UniFi, Supermicro
--
-- All 8 URLs verified HTTP 200 (2026-04-21).
--
-- HPE Aruba:
--   CX 6300M-48G + CX 8360-32Y4C: cdn.blueally.com (Blue Ally partner CDN, stable).
--   CX 8100-48Y6C: cdn.blueally.com CX 8100 48XF4C chassis (R9W90A SKU).
--     Note: HPE has no CX 8100 model with "48Y6C" designation; 48Y6C = CX 8360 series.
--     This UPDATE will match the DB model name as-is; if the model name is wrong, UPDATE 0.
--
-- Ubiquiti: cdn.ecomm.ui.com official Ubiquiti e-commerce CDN (UUID-keyed, stable).
--
-- Supermicro:
--   SSE-C4632SRB + SSE-T7132SR: wiredzone.com Odoo product images (200 OK verified).
--   Note: supermicro.com/a_images/ redirects to .com.tw (geo-redirect, inconsistent).
--   Wiredzone dynamic product image URLs are stable as long as product listing exists.

-- ── HPE Aruba CX Series ───────────────────────────────────────────────────────

-- CX 6300M-48G — 48×1G + 4×SFP56 campus core switch
UPDATE switches
SET image_url        = 'https://cdn.blueally.com/securewirelessworks/images/switches/cx6300/jl663a.png',
    product_page_url = COALESCE(product_page_url, 'https://www.hpe.com/us/en/product-catalog/networking/networking-switches/pip.hpe-aruba-networking-cx-6300m-switch-series.2101276015.html'),
    assets_scraped_at = NOW()
WHERE model = 'CX 6300M-48G'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'hpe-aruba');

-- CX 8100-48Y6C — 48×25G + 6×100G data center switch
-- Note: HPE CX 8100 lineup has no 48Y6C SKU; 48Y6C = CX 8360 series. Image = CX 8100 48XF4C chassis.
UPDATE switches
SET image_url        = 'https://cdn.blueally.com/securewirelessworks/images/switches/cx8100/r9w90a-sm.png',
    product_page_url = COALESCE(product_page_url, 'https://www.hpe.com/us/en/product-catalog/networking/networking-switches/pip.hpe-aruba-networking-cx-8100-switch-series.2101276022.html'),
    assets_scraped_at = NOW()
WHERE model = 'CX 8100-48Y6C'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'hpe-aruba');

-- CX 8360-32Y4C — 32×25G + 4×100G data center switch
UPDATE switches
SET image_url        = 'https://cdn.blueally.com/securewirelessworks/images/switches/cx8360/jl700c-hero.png',
    product_page_url = COALESCE(product_page_url, 'https://www.hpe.com/us/en/product-catalog/networking/networking-switches/pip.aruba-8360-switch-series.2101298090.html'),
    assets_scraped_at = NOW()
WHERE model = 'CX 8360-32Y4C'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'hpe-aruba');

-- ── Ubiquiti UniFi ────────────────────────────────────────────────────────────

-- USW-EnterpriseXG-24 — 24×10G SFP+ + 2×25G SFP28 enterprise switch
UPDATE switches
SET image_url        = 'https://cdn.ecomm.ui.com/products/de04b908-bb34-45dd-834f-9b081429aa07/870f1265-84f2-48e9-88a6-e362e2df375e.png',
    product_page_url = COALESCE(product_page_url, 'https://store.ui.com/us/en/products/usw-enterprisexg-24'),
    assets_scraped_at = NOW()
WHERE model = 'USW-EnterpriseXG-24'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ubiquiti');

-- USW-Pro-Aggregation — 28-port SFP+ aggregation switch
UPDATE switches
SET image_url        = 'https://cdn.ecomm.ui.com/products/35879d83-6169-4d6b-abf6-d3b98b1e8367/6e96315d-1967-44f6-91eb-4b39ac34d7d6.png',
    product_page_url = COALESCE(product_page_url, 'https://store.ui.com/us/en/products/usw-pro-aggregation'),
    assets_scraped_at = NOW()
WHERE model = 'USW-Pro-Aggregation'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ubiquiti');

-- USW-Pro-Max-48-PoE — 48×1G PoE++ + 4×10G SFP+ Pro Max switch
UPDATE switches
SET image_url        = 'https://cdn.ecomm.ui.com/products/51e22689-9b81-4717-beed-fe2c65c57362/c20ff409-f511-4a04-9bf0-200065216489.png',
    product_page_url = COALESCE(product_page_url, 'https://store.ui.com/us/en/products/usw-pro-max-48-poe'),
    assets_scraped_at = NOW()
WHERE model = 'USW-Pro-Max-48-PoE'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ubiquiti');

-- ── Supermicro ────────────────────────────────────────────────────────────────

-- SSE-C4632SRB — 32×100G QSFP28 + 2×10G SFP+ ToR switch
UPDATE switches
SET image_url        = 'https://www.wiredzone.com/web/image/product.template/13901/image?unique=227f433',
    product_page_url = COALESCE(product_page_url, 'https://www.supermicro.com/en/products/accessories/Networking/SSE-C4632SB.php'),
    assets_scraped_at = NOW()
WHERE model = 'SSE-C4632SRB'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'supermicro');

-- SSE-T7132SR — 32×400G QSFP-DD Tomahawk 4 spine switch
UPDATE switches
SET image_url        = 'https://www.wiredzone.com/web/image/product.template/11620/image?unique=2155a7a',
    product_page_url = COALESCE(product_page_url, 'https://www.supermicro.com/en/products/accessories/Networking/SSE-T7132SR.php'),
    assets_scraped_at = NOW()
WHERE model = 'SSE-T7132SR'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'supermicro');
