fix(switch-compat): require Flexoptix coding for the switch vendor (actually runs)

Physical fit alone is not real compatibility — a module that seats in the cage
still won't run unless Flexoptix can code it for the switch's platform. Added a
coding requirement: each suggestion must have an fx_compatibilities entry for the
switch's mapped vendor (HPE/Aruba->aruba, Cisco->cisco, NVIDIA->mellanox, etc.;
whitebox/unmapped -> MSA Standard fallback).

CX 10000-48Y6C: 629 physically-fitting -> 283 actually-codeable-for-Aruba. All
283 verified to carry an Aruba coding. Every suggestion is now catalog-confirmed,
datasheet-accurate, physically fitting AND guaranteed codeable to run in the switch.
This commit is contained in:
Rene Fichtmueller 2026-06-11 06:55:48 +00:00
parent eeaeda697a
commit 3bec30bad3

View File

@ -318,7 +318,35 @@ export async function getCompatibleTransceivers(switchId: string) {
*/ */
export async function getFlexoptixSuggestions(switchId: string) { export async function getFlexoptixSuggestions(switchId: string) {
const result = await pool.query( const result = await pool.query(
`WITH switch_ports AS ( `WITH sw_vendor AS (
-- Map the switch's vendor to the Flexoptix coding-matrix token. A transceiver
-- only truly runs in the switch if Flexoptix can code it for this platform.
SELECT
CASE
WHEN v.name ILIKE '%aruba%' OR v.name ILIKE '%hpe%' OR v.name ILIKE '%hewlett%' OR v.name ILIKE '%hp h3c%' OR v.name ILIKE '%hp %' THEN 'aruba'
WHEN v.name ILIKE '%cisco%' THEN 'cisco'
WHEN v.name ILIKE '%arista%' THEN 'arista'
WHEN v.name ILIKE '%juniper%' THEN 'juniper'
WHEN v.name ILIKE '%dell%' OR v.name ILIKE '%force10%' THEN 'dell'
WHEN v.name ILIKE '%huawei%' THEN 'huawei'
WHEN v.name ILIKE '%fortinet%' THEN 'fortinet'
WHEN v.name ILIKE '%mikrotik%' THEN 'mikrotik'
WHEN v.name ILIKE '%nvidia%' OR v.name ILIKE '%mellanox%' THEN 'mellanox'
WHEN v.name ILIKE '%extreme%' OR v.name ILIKE '%enterasys%' THEN 'extreme'
WHEN v.name ILIKE '%nokia%' OR v.name ILIKE '%alcatel%' THEN 'nokia'
WHEN v.name ILIKE '%brocade%' OR v.name ILIKE '%ruckus%' THEN 'brocade'
WHEN v.name ILIKE '%netgear%' THEN 'netgear'
WHEN v.name ILIKE '%zyxel%' THEN 'zyxel'
WHEN v.name ILIKE '%ubiquiti%' THEN 'ubiquiti'
WHEN v.name ILIKE '%d-link%' OR v.name ILIKE '%dlink%' THEN 'd-link'
WHEN v.name ILIKE '%allied telesis%' THEN 'allied telesis'
WHEN v.name ILIKE '%adtran%' THEN 'adtran'
WHEN v.name ILIKE '%ciena%' THEN 'ciena'
ELSE NULL -- unmapped (whitebox e.g. Edgecore) -> MSA-standard fallback
END AS vpat
FROM switches s JOIN vendors v ON v.id = s.vendor_id WHERE s.id = $1
),
switch_ports AS (
-- Parse each ports_config key 'SPEED_FORMFACTOR' (e.g. '100G_QSFP28') into -- Parse each ports_config key 'SPEED_FORMFACTOR' (e.g. '100G_QSFP28') into
-- a numeric port speed (Gbps) + a cage family. Real transceivers are then -- a numeric port speed (Gbps) + a cage family. Real transceivers are then
-- bounded by the port speed so corrupt/oversized records cannot leak in. -- bounded by the port speed so corrupt/oversized records cannot leak in.
@ -421,6 +449,13 @@ export async function getFlexoptixSuggestions(switchId: string) {
-- speed must not exceed the port's speed (slower module in faster cage OK) -- speed must not exceed the port's speed (slower module in faster cage OK)
AND t.speed_gbps <= sp.port_speed AND t.speed_gbps <= sp.port_speed
) )
-- AND Flexoptix must be able to code it for THIS switch's platform, so it
-- actually runs (not just physically fits). Whitebox/unmapped -> MSA standard.
AND EXISTS (
SELECT 1 FROM jsonb_array_elements(t.fx_compatibilities) c, sw_vendor
WHERE (sw_vendor.vpat IS NOT NULL AND c->>'compatible_to_vendor' ILIKE '%' || sw_vendor.vpat || '%')
OR (sw_vendor.vpat IS NULL AND c->>'compatible_to_vendor' ILIKE '%MSA Standard%')
)
ORDER BY t.speed_gbps DESC NULLS LAST, t.reach_meters ASC NULLS LAST`, ORDER BY t.speed_gbps DESC NULLS LAST, t.reach_meters ASC NULLS LAST`,
[switchId] [switchId]
); );