Money is integer paise, never a float
A discount carries its unit. Percentage discounts are stored in basis points, so 12% is 1200. Fixed discounts are stored in paise.
Percentage results round to the nearest paise. Every result floors at zero.
A spare-parts master, cross-reference and pricing system built around durable identity, immutable history and human-reviewed document extraction. It is in build and not yet deployed.
Part numbers, brand cross-references, customer prices and vendor prices lived in files and memory. Nobody could answer what a part last sold for, to whom, or when from one reliable trail.
Part numbers are corrected. Brands use different references for equivalent parts. If the visible number is treated as the database identity, fixing a typo can orphan every price already attached to it.
Vendor quotation PDFs can accelerate entry, but extraction is not clean enough to become a price without a person confirming every line.
The built foundation and the modules defined around it.
The invariants underneath prices, identity and configurable data.
A discount carries its unit. Percentage discounts are stored in basis points, so 12% is 1200. Fixed discounts are stored in paise.
Percentage results round to the nearest paise. Every result floors at zero.
Update and delete triggers raise. A back-dated entry joins the trail but never displaces the displayed last price, because “last” is max(date, then id).
Re-saving a quotation line updates rather than duplicates its price entry. A uniqueness constraint on the source line enforces that rule.
part_identities assigns every brand-and-part-number pair a stable surrogate ID. The ID survives a correction, so fixing a typo does not orphan the price history attached to it.
Built-in and custom fields share a single definition table. A type registry consumed by both client and server makes the grid, form, bulk-upload template, export and search behave identically.
Conditional visibility — bore dimensions only on bushes, for example — is configuration, not a hard-coded conditional.
Vendor quotation PDFs are parsed with an OCR fallback into a mandatory editable review table. A human confirms every line before it becomes a price.
Build-time invariants. This system is not yet live.
Show us the registers, spreadsheets and hand-offs that hold the operation together. We will map where a custom system would pay for itself.