Files
QuoteForge/bible
Michael Chus 5e56f386cc feat: implement vendor spec BOM import and PN→LOT resolution (Phase 1)
- Migration 029: local_partnumber_books, local_partnumber_book_items,
  vendor_spec TEXT column on local_configurations
- Models: LocalPartnumberBook, LocalPartnumberBookItem, VendorSpec,
  VendorSpecItem with JSON Valuer/Scanner
- Repository: PartnumberBookRepository (GetActiveBook, FindLotByPartnumber,
  SaveBook/Items, ListBooks, CountBookItems)
- Service: VendorSpecResolver 3-step resolution (book → manual suggestion
  → unresolved) + AggregateLOTs with is_primary_pn qty logic
- Sync: PullPartnumberBooks append-only pull from qt_partnumber_books
- Handlers: VendorSpecHandler (GET/PUT/resolve/apply), PartnumberBooksHandler
- Routes: /api/configs/:uuid/vendor-spec*, /api/partnumber-books,
  /api/sync/partnumber-books, /partnumber-books page
- UI: 3 top-level tabs [Estimate][BOM вендора][Ценообразование]; Excel paste,
  PN resolution, inline LOT autocomplete, pricing table
- Bible: 03-database.md updated, 09-vendor-spec.md added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 10:22:22 +03:00
..

QuoteForge Bible — Architectural Documentation

The single source of truth for architecture, schemas, and patterns.


Table of Contents

File Topic
01-overview.md Product: purpose, features, tech stack, repository structure
02-architecture.md Architecture: local-first, sync, pricing, versioning
03-database.md DB schemas: SQLite + MariaDB, permissions, indexes
04-api.md API endpoints and web routes
05-config.md Configuration, environment variables, paths, installation
06-backup.md Backup: implementation, rotation policy
07-dev.md Development: commands, code style, guardrails

Bible Rules

Every architectural decision must be recorded in the Bible.

Any change to DB schema, data access patterns, sync behavior, API contracts, configuration format, or any other system-level aspect — the corresponding bible/ file must be updated in the same commit as the code.

On every user-requested commit, the Bible must be reviewed and updated in that commit.

The Bible is the single source of truth for architecture. Outdated documentation is worse than none.

Documentation language: English.

All files in bible/ are written and updated in English only. Mixing languages is not allowed.


Quick Reference

Where is user data stored? SQLite → ~/Library/Application Support/QuoteForge/qfs.db (macOS). MariaDB is sync-only.

How to look up a price for a line item? local_pricelist_items → by pricelist_id from config + lot_name. Prices are never taken from local_components.

Pre-commit check? go build ./cmd/qfs && go vet ./...

What must never be restored? cron jobs, admin pricing, alerts, stock import, importer utility — all removed intentionally.

Where is the release changelog? releases/memory/v{major}.{minor}.{patch}.md