Files
PriceForge/bible-local/BIBLE.md
Mikhail Chusavitin 5f8aec456b Unified Quote Journal (parts_log) v3
- New unified append-only quote log table parts_log replaces three
  separate log tables (stock_log, partnumber_log_competitors, lot_log)
- Migrations 042-049: extend supplier, create parts_log/import_formats/
  ignore_rules, rework qt_lot_metadata composite PK, add lead_time_weeks
  to pricelist_items, backfill data, migrate ignore rules
- New services: PartsLogBackfillService, ImportFormatService,
  UnifiedImportService; new world pricelist type (all supplier types)
- qt_lot_metadata PK changed to (lot_name, pricelist_type); all queries
  now filter WHERE pricelist_type='estimate'
- Fix pre-existing bug: qt_component_usage_stats column names
  quotes_last30d/quotes_last7d (no underscore) — added explicit gorm tags
- Bible: full table inventory, baseline schema snapshot, updated pricelist/
  data-rules/api/history/architecture docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 17:25:54 +03:00

53 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PriceForge Bible
The main architectural reference for developers and AI agents. Source of truth for the project.
---
## What is PriceForge
PriceForge is a price and pricelist manager built on top of MariaDB.
- **Runtime**: MariaDB-only, fail-fast (if DB is unavailable at startup — server exits)
- **Main UI**: `/admin/pricing`
- **Default port**: `8084`
- **Go module**: `git.mchus.pro/mchus/priceforge`
---
## Table of Contents
| File | Description |
|------|-------------|
| [architecture.md](architecture.md) | Stack, project structure, modules, routes |
| [pricelist.md](pricelist.md) | Pricelist types (Estimate / Warehouse / Competitor) and creation rules |
| [vendor-mapping.md](vendor-mapping.md) | partnumber → LOT mapping, bundles, ignore logic |
| [background-tasks.md](background-tasks.md) | Task Manager: Submit, polling, task types |
| [data-rules.md](data-rules.md) | Categories, data integrity rules |
| [patterns.md](patterns.md) | Code patterns: CSV export, streaming, virtual fields |
| [api.md](api.md) | All API endpoints |
| [operations.md](operations.md) | Config, commands, build, release |
| [history.md](history.md) | Architectural decisions and change log |
| [schema-baseline-2026-03-21.sql](schema-baseline-2026-03-21.sql) | Full DB schema as of 2026-03-21 (before migrations 042049) |
---
## Documentation Standards
- **Language**: All documentation in `bible/` is written in **English**.
- **Architectural decisions**: Every architectural decision MUST be recorded in [history.md](history.md) with date, rationale, constraints, and affected files. No exceptions.
- **Before user-requested commits**: If a user asks to create a commit, update relevant `bible/` docs in the same change set before committing.
---
## Hard Rules (for AI agents)
> These rules MUST NOT be violated when writing code.
1. **Warehouse pricelist** — only mapped partnumbers from `qt_partnumber_book_items.lots_json`. Unmapped partnumbers are excluded entirely.
2. **Categories** — always from `lot.lot_category`. Never derive from LOT name.
3. **Background tasks** — Task Manager only (`taskManager.Submit()`). Never use SSE.
4. **Vendor mapping** — canonical source of truth is `qt_partnumber_book_items`, one row per `partnumber`, with full composition in `lots_json`.
5. **Home page** — redirect to `/admin/pricing`. Configurator, projects, export must not appear in the UI.
6. **Document decisions** — every architectural decision must be added to `bible/history.md`.