mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-18 05:08:13 +01:00
Allow to read amazon labels for part retrieval and creation
This commit is contained in:
@@ -101,6 +101,10 @@ final class BarcodeScanHelper
|
||||
return $this->parseLCSCBarcode($input);
|
||||
}
|
||||
|
||||
if ($type === BarcodeSourceType::AMAZON) {
|
||||
return new AmazonBarcodeScanResult($input);
|
||||
}
|
||||
|
||||
//Null means auto and we try the different formats
|
||||
$result = $this->parseInternalBarcode($input);
|
||||
|
||||
@@ -135,6 +139,11 @@ final class BarcodeScanHelper
|
||||
return $this->parseLCSCBarcode($input);
|
||||
}
|
||||
|
||||
//Try amazon barcode
|
||||
if (AmazonBarcodeScanResult::isAmazonBarcode($input)) {
|
||||
return new AmazonBarcodeScanResult($input);
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException('Unknown barcode');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user