Implement global vendor mappings with bundle support and seen-based ignore

This commit is contained in:
Mikhail Chusavitin
2026-02-18 19:54:07 +03:00
parent b94dd3d015
commit c22328bf03
21 changed files with 2048 additions and 342 deletions

View File

@@ -130,3 +130,28 @@ type PricelistItem struct {
- Главная страница должна вести на `/admin/pricing`.
- В UI не должно быть ссылок на конфигуратор, проекты и экспорт.
- **НЕ использовать SSE** - только фоновые задачи через Task Manager.
## Vendor Mapping Rules (2026-02-18)
- `lot_partnumbers` is the canonical mapping contract for external configurator.
- Do not reintroduce multi-row mapping for one key: one `(vendor, partnumber)` -> one `lot_name`.
- Resolver behavior is fixed:
- first exact `vendor + partnumber`,
- then fallback `vendor='' + partnumber`.
- Composite vendor partnumbers must be implemented via internal bundle tables:
- `qt_lot_bundles`
- `qt_lot_bundle_items`
- Bundle LOT is internal and hidden in regular LOT UI by default.
- Ignore behavior:
- do not use `stock_ignore_rules` for new logic,
- use `qt_vendor_partnumber_seen.is_ignored` (cross-source).
- Client compatibility requirement:
- client still consumes LOT-based pricelists,
- bundle expansion/allocation happens only inside PriceForge warehouse calculations.
### Related modules
- Migration: `migrations/023_vendor_partnumber_global_mapping.sql`
- Service/API: `internal/services/vendor_mapping.go`, `internal/handlers/pricing.go`
- Resolver: `internal/lotmatch/matcher.go`
- Warehouse calc: `internal/warehouse/snapshot.go`
- Stock import seen+ignore: `internal/services/stock_import.go`