3.0 KiB
3.0 KiB
PriceForge Memory
LOT Page Refactoring (2026-02-10)
What was done:
-
Created new dedicated
/lotpage with two tabs:- LOT tab: Component/article management (table with search, sort, create LOT)
- Сопоставления tab: partnumber ↔ LOT mappings management
-
Removed LOT tab from "Администратор цен" (Pricing Admin)
-
Removed "Сопоставление partnumber → LOT" section from Warehouse tab
-
Updated main menu navigation:
- LOT link → /lot (new page)
- Администратор цен → /admin/pricing (Estimate, Склад, Конкуренты)
- Настройки (unchanged)
Files changed:
web/templates/lot.html(NEW) - Complete page with LOT and stock mappings tabsweb/templates/base.html- Updated menu to link LOT to /lotweb/templates/admin_pricing.html- Removed LOT tab, changed default to Estimateinternal/handlers/web.go- Added lot.html to template list, added Lot() handlercmd/pfs/main.go- Added /lot route
Technical notes:
- lot.html uses same API endpoints as admin_pricing for data loading
- Stock mappings functions copied from admin_pricing.html but adapted for new page
- Default tab for Pricing Admin is now 'estimate' instead of 'lots'
Data Rules (2026-02-18)
- Never derive category from item name (lot name). Always use category from
PricelistItem(lot_category/ JSONcategory).
Vendor Partnumber Global Mapping (2026-02-18)
Decision Summary
lot_partnumbersremains the canonical integration table for external configurator.- Mapping is strict 1:1 by key
(vendor, partnumber)(fallback to empty vendor is allowed). - Composite mappings are represented via internal virtual LOT bundles:
partnumber -> bundle_lotinlot_partnumbers- bundle composition in
qt_lot_bundle_itemswithqty.
- Ignore logic is moved from
stock_ignore_rulestoqt_vendor_partnumber_seen.is_ignored. - Warehouse pricing stays client-compatible: published by LOT, bundle expansion happens inside PriceForge.
Rationale
- Preserves external/client contracts (
lot_partnumbers, LOT-based pricelists). - Avoids multi-row ambiguity in
lot_partnumbers. - Supports complex assembled vendor SKUs without client changes.
- Centralizes ignore behavior across all sources via seen-registry.
Constraints
- Bundle LOT is internal and must stay hidden in regular LOT list by default.
- Resolver order is mandatory: exact
vendor+partnumberthen fallbackvendor=''. - Bundle allocation for missing estimate uses fallback from previous active warehouse pricelist; if absent then
0.
Implementation References
- Migration:
migrations/023_vendor_partnumber_global_mapping.sql - Models:
internal/models/lot.go,internal/models/configuration.go - Resolver:
internal/lotmatch/matcher.go - Warehouse allocation:
internal/warehouse/snapshot.go - Vendor mapping service:
internal/services/vendor_mapping.go - Stock import seen/ignore integration:
internal/services/stock_import.go - API wiring:
internal/handlers/pricing.go,cmd/pfs/main.go