diff --git a/.gitignore b/.gitignore index 80e9572..7a2241c 100644 --- a/.gitignore +++ b/.gitignore @@ -74,4 +74,8 @@ Network Trash Folder Temporary Items .apdisk +# Release artifacts, but DO track releases/memory/ for changelog releases/ +!releases/ +!releases/memory/ +!releases/memory/** diff --git a/CLAUDE.md b/CLAUDE.md index 0068116..21132bd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,6 +56,12 @@ - `/pricelists/:id` - `/setup` +## Release Notes & Change Log +Release notes are maintained in `releases/memory/` directory organized by version tags (e.g., `v1.2.1.md`). +Before working on the codebase, review the most recent release notes to understand recent changes. +- Check `releases/memory/` for detailed changelog between tags +- Each release file documents commits, breaking changes, and migration notes + ## Commands ```bash # Development diff --git a/README.md b/README.md index 6f2562f..73623e3 100644 --- a/README.md +++ b/README.md @@ -347,9 +347,22 @@ quoteforge/ │ └── static/ # CSS, JS, изображения ├── migrations/ # SQL миграции ├── config.example.yaml # Пример конфигурации +├── releases/ +│ └── memory/ # Changelog между тегами (v1.2.1.md, v1.2.2.md, ...) └── go.mod ``` +## Releases & Changelog + +Change log между версиями хранится в `releases/memory/` каталоге в файлах вида `v{major}.{minor}.{patch}.md`. + +Каждый файл содержит: +- Список коммитов между версиями +- Описание изменений и их влияния +- Breaking changes и заметки о миграции + +**Перед работой над кодом проверьте последний файл в этой папке, чтобы понять текущее состояние проекта.** + ## Роли пользователей | Роль | Описание | diff --git a/releases/memory/v1.2.1.md b/releases/memory/v1.2.1.md new file mode 100644 index 0000000..b4d1c1a --- /dev/null +++ b/releases/memory/v1.2.1.md @@ -0,0 +1,72 @@ +# v1.2.1 Release Notes + +**Date:** 2026-02-09 +**Changes since v1.2.0:** 2 commits + +## Summary +Fixed configurator component substitution by updating to work with new pricelist-based pricing model. Addresses regression from v1.2.0 refactor that removed `CurrentPrice` field from components. + +## Commits + +### 1. Refactor: Remove CurrentPrice from local_components (5984a57) +**Type:** Refactor +**Files Changed:** 11 files, +167 insertions, -194 deletions + +#### Overview +Transitioned from component-based pricing to pricelist-based pricing model: +- Removed `CurrentPrice` and `SyncedAt` from LocalComponent (metadata-only now) +- Added `WarehousePricelistID` and `CompetitorPricelistID` to LocalConfiguration +- Removed 2 unused methods: UpdateComponentPricesFromPricelist, EnsureComponentPricesFromPricelists + +#### Key Changes +- **Data Model:** + - LocalComponent: now stores only metadata (LotName, LotDescription, Category, Model) + - LocalConfiguration: added warehouse and competitor pricelist references + +- **Migrations:** + - drop_component_unused_fields - removes CurrentPrice, SyncedAt columns + - add_warehouse_competitor_pricelists - adds new pricelist fields + +- **Quote Calculation:** + - Updated to use pricelist_items instead of component.CurrentPrice + - Added PricelistID field to QuoteRequest + - Maintains offline-first behavior + +- **API:** + - Removed CurrentPrice from ComponentView + - Components API no longer returns pricing + +### 2. Fix: Load component prices via API (acf7c8a) +**Type:** Bug Fix +**Files Changed:** 1 file (web/templates/index.html), +66 insertions, -12 deletions + +#### Problem +After v1.2.0 refactor, the configurator's autocomplete was filtering out all components because it checked for the removed `current_price` field on component objects. + +#### Solution +Implemented on-demand price loading via API: +- Added `ensurePricesLoaded()` function to fetch prices from `/api/quote/price-levels` +- Added `componentPricesCache` to cache loaded prices in memory +- Updated all 3 autocomplete modes (single, multi, section) to load prices when input is focused +- Changed price validation from `c.current_price` to `hasComponentPrice(lot_name)` +- Updated cart item creation to use cached API prices + +#### Impact +- Components without prices are still filtered out (as required) +- Price checks now use API data instead of removed database field +- Frontend loads prices on-demand for better performance + +## Testing Notes +- ✅ Configurator component substitution now works +- ✅ Prices load correctly from pricelist +- ✅ Offline mode still supported (prices cached after initial load) +- ✅ Multi-pricelist support functional (estimate/warehouse/competitor) + +## Known Issues +None + +## Migration Path +No database migration needed from v1.2.0 - migrations were applied in v1.2.0 release. + +## Breaking Changes +None for end users. Internal: `ComponentView` no longer includes `CurrentPrice` in API responses.