Skip to content

Conversation

@MayNiklas
Copy link
Contributor

This pull request enhances the BOM import functionality, specifically improving how supplier part numbers (SPNs) are used to automatically link BOM entries to existing parts in the database.

Improvements to BOM import logic:

  • Added logic to attempt linking BOM entries to existing parts using supplier SPNs when a Part-DB ID is not provided. This checks all known suppliers and matches entries based on supplier name and SPN.
  • Optimized supplier lookup by creating a mapping of supplier names to supplier objects for efficient SPN matching.

In my opinion, there is no reason not to match a part when a supplier SPN provided by the user does match to something already in the DB.
A lot of people have for example LCSC SPN's in their BOM's.
Automatically linking matched parts greatly simplifies the project creation workflow!
I for example would use this a lot even while still working on the project, to make sure I have all the needed parts early in the process!

If you have a different opinion on it, feel free to tell me :)
I'm willing to make changes if requested :)

Note: I'm not able to execute the PHP tests locally. While I did deploy the code on my server and it did work, I have not yet executed the tests. I therefore hope for them to pass on your CI :)

Add automatic part linking via supplier part numbers (SPNs) in the
BOM importer. When a Part-DB ID is not provided, the importer now
searches for existing parts by matching supplier SPNs from the CSV
with orderdetail records in the database.

This allows automatic part linking when KiCad schematic BOMs contain
supplier information like LCSC SPN, Mouser SPN, etc., improving the
import workflow for users who track parts by supplier part numbers.
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.26%. Comparing base (ae4c078) to head (e7a1790).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1209      +/-   ##
============================================
+ Coverage     58.23%   58.26%   +0.02%     
- Complexity     7435     7442       +7     
============================================
  Files           582      582              
  Lines         23656    23680      +24     
============================================
+ Hits          13775    13796      +21     
- Misses         9881     9884       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant