Vendor mapping: wildcard ignore patterns, bulk CSV import, multi-lot qty

- Add glob pattern support (* and ?) for ignore rules stored in
  qt_vendor_partnumber_seen (is_pattern flag, migration 041)
- Pattern matching applied in stock/competitor import, partnumber book
  snapshot, and vendor mappings list (Go-side via NormalizeKey)
- BulkUpsertMappings: replace N+1 loop with two batch SQL upserts,
  validating all lots in a single query (~1500 queries → 3-4)
- CSV import: multi-lot per PN via repeated rows, optional qty column
- CSV export: updated column format vendor;partnumber;lot_name;qty;description;ignore;notes
- UI: ignore patterns section with add/delete, import progress feedback
- Update bible-local/vendor-mapping.md with new CSV format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-03-19 09:41:48 +03:00
parent df14da2265
commit f73e3d144d
13 changed files with 653 additions and 51 deletions

View File

@@ -135,6 +135,7 @@ type VendorPartnumberSeen struct {
Description *string `gorm:"column:description;size:10000" json:"description,omitempty"`
LastSeenAt time.Time `gorm:"column:last_seen_at;not null" json:"last_seen_at"`
IsIgnored bool `gorm:"column:is_ignored;not null;default:false;index:idx_qt_vendor_partnumber_seen_ignored" json:"is_ignored"`
IsPattern bool `gorm:"column:is_pattern;not null;default:false" json:"is_pattern,omitempty"`
IgnoredAt *time.Time `gorm:"column:ignored_at" json:"ignored_at,omitempty"`
IgnoredBy *string `gorm:"column:ignored_by;size:100" json:"ignored_by,omitempty"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"`