mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-19 18:01:30 +00:00
fix to remove fallback from LCSC barcode part resolver as the PC code is the ultimate source of truth.
This commit is contained in:
parent
343c078b7d
commit
fb22117f10
1 changed files with 2 additions and 8 deletions
|
|
@ -217,7 +217,6 @@ final readonly class BarcodeScanResultHandler
|
||||||
* Resolve LCSC barcode -> Part.
|
* Resolve LCSC barcode -> Part.
|
||||||
* Strategy:
|
* Strategy:
|
||||||
* 1) Try providerReference.provider_id == pc (LCSC "Cxxxxxx") if you store it there
|
* 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)
|
* Returns first match (consistent with EIGP114 logic)
|
||||||
*/
|
*/
|
||||||
private function resolvePartFromLCSC(LCSCBarcodeScanResult $barcodeScan): ?Part
|
private function resolvePartFromLCSC(LCSCBarcodeScanResult $barcodeScan): ?Part
|
||||||
|
|
@ -231,15 +230,10 @@ final readonly class BarcodeScanResultHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to MPN (pm)
|
// part does not exist in DB
|
||||||
$pm = $barcodeScan->mpn; // e.g. RC0402FR-071ML
|
|
||||||
if (!$pm) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->em->getRepository(Part::class)->getPartByMPN($pm);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to extract creation information for a part from the given barcode scan result. This can be used to
|
* Tries to extract creation information for a part from the given barcode scan result. This can be used to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue