fix to remove fallback from LCSC barcode part resolver as the PC code is the ultimate source of truth.

This commit is contained in:
swdee 2026-03-09 10:48:57 +13:00
parent 343c078b7d
commit fb22117f10

View file

@ -217,7 +217,6 @@ final readonly class BarcodeScanResultHandler
* Resolve LCSC barcode -> Part.
* Strategy:
* 1) Try providerReference.provider_id == pc (LCSC "Cxxxxxx") if you store it there
* 2) Fallback to manufacturer_product_number == pm (MPN)
* Returns first match (consistent with EIGP114 logic)
*/
private function resolvePartFromLCSC(LCSCBarcodeScanResult $barcodeScan): ?Part
@ -231,13 +230,8 @@ final readonly class BarcodeScanResultHandler
}
}
// Fallback to MPN (pm)
$pm = $barcodeScan->mpn; // e.g. RC0402FR-071ML
if (!$pm) {
return null;
}
return $this->em->getRepository(Part::class)->getPartByMPN($pm);
// part does not exist in DB
return null;
}