Harden pricelist formation and document architecture decisions

This commit is contained in:
Mikhail Chusavitin
2026-02-20 19:01:07 +03:00
parent d381a5833d
commit c96a8806c4
14 changed files with 335 additions and 29 deletions

View File

@@ -11,7 +11,7 @@ Categories are **always** taken from `lot.lot_category` (table `lot`).
### When creating pricelists
1. **Estimate**: load `lot.lot_category` for all components.
1. **Estimate**: include only components with `current_price > 0` and `is_hidden = 0`, then load `lot.lot_category`.
2. **Warehouse**: load `lot.lot_category` for all positions.
3. Persist into `lot_category` column of `qt_pricelist_items`.
@@ -28,7 +28,7 @@ type PricelistItem struct {
- Category is **not** a virtual field — it is persisted to DB when the pricelist is created.
- JOIN with `lot` is only needed for `lot_description`; category is already in `qt_pricelist_items`.
- Default value when category is absent in source: `PART_`.
- Default value when category is absent in source or LOT row is missing: `PART_`.
---