- 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>
2.5 KiB
2.5 KiB
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 | Stack, project structure, modules, routes |
| pricelist.md | Pricelist types (Estimate / Warehouse / Competitor) and creation rules |
| vendor-mapping.md | partnumber → LOT mapping, bundles, ignore logic |
| background-tasks.md | Task Manager: Submit, polling, task types |
| data-rules.md | Categories, data integrity rules |
| patterns.md | Code patterns: CSV export, streaming, virtual fields |
| api.md | All API endpoints |
| operations.md | Config, commands, build, release |
| history.md | Architectural decisions and change log |
| schema-baseline-2026-03-21.sql | Full DB schema as of 2026-03-21 (before migrations 042–049) |
Documentation Standards
- Language: All documentation in
bible/is written in English. - Architectural decisions: Every architectural decision MUST be recorded in 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.
- Warehouse pricelist — only mapped partnumbers from
qt_partnumber_book_items.lots_json. Unmapped partnumbers are excluded entirely. - Categories — always from
lot.lot_category. Never derive from LOT name. - Background tasks — Task Manager only (
taskManager.Submit()). Never use SSE. - Vendor mapping — canonical source of truth is
qt_partnumber_book_items, one row perpartnumber, with full composition inlots_json. - Home page — redirect to
/admin/pricing. Configurator, projects, export must not appear in the UI. - Document decisions — every architectural decision must be added to
bible/history.md.