2.4 KiB
2.4 KiB
Changes summary (2026-02-11)
Implemented strict lot_category flow using pricelist_items.lot_category only (no parsing from lot_name), plus local caching and backfill:
- Local DB schema + migrations
- Added
lot_categorycolumn tolocal_pricelist_itemsviaLocalPricelistItemmodel. - Added local migration
2026_02_11_local_pricelist_item_categoryto add the column if missing and create indexes:idx_local_pricelist_items_pricelist_lot (pricelist_id, lot_name)idx_local_pricelist_items_lot_category (lot_category)
- Server model/repository
- Added
LotCategoryfield tomodels.PricelistItem. PricelistRepository.GetItemsnow setsCategoryfromLotCategory(no parsing fromlot_name).
- Sync + local DB helpers
SyncPricelistItemsnow saveslot_categoryinto local cache viaPricelistItemToLocal.- Added
LocalDB.CountLocalPricelistItemsWithEmptyCategoryandLocalDB.ReplaceLocalPricelistItems. - Added
LocalDB.GetLocalLotCategoriesByServerPricelistIDfor strict category lookup. - Added
SyncPricelistsbackfill step: for used active pricelists with empty categories, force refresh items from server.
- API handler
GET /api/pricelists/:id/itemsreturnscategoryfromlocal_pricelist_items.lot_category(no parsing fromlot_name).
- Article category foundation
- New package
internal/article:ResolveLotCategoriesStrictpulls categories from local pricelist items and errors on missing category.GroupForLotCategorymaps only allowed codes (CPU/MEM/GPU/M2/SSD/HDD/EDSFF/HHHL/NIC/HCA/DPU/PSU/PS) to article groups; excludesSFP.- Error type
MissingCategoryForLotErrorwith baseErrMissingCategoryForLot.
- Tests
- Added unit tests for converters and article category resolver.
- Added handler test to ensure
/api/pricelists/:id/itemsreturnslot_category. - Added sync test for category backfill on used pricelist items.
go test ./...passed.
Additional fixes (2026-02-11):
- Fixed article parsing bug: CPU/GPU parsers were swapped in
internal/article/generator.go. CPU now uses last token from CPU lot; GPU uses model+memory fromGPU_vendor_model_mem_iface. - Adjusted configurator base tab layout to align labels on the same row (separate label row + input row grid).
UI rule (2026-02-19):
- In all breadcrumbs, truncate long specification/configuration names to 16 characters using ellipsis.