Skip to content

Enforce authoritative prices and tax across order entry - #1064

Merged
sridharkalaibala merged 2 commits into
developfrom
codex/authoritative-order-pricing
Oct 1, 2026
Merged

sridharkalaibala merged 2 commits into
developfrom
codex/authoritative-order-pricing

Conversation

@sridharkalaibala

@sridharkalaibala sridharkalaibala commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

An item added to an existing Captain order could submit its tax-inclusive display price as the base, and POS would apply exclusive tax again. For example, a Rs45 paratha arrived as Rs47.25 before a second tax calculation.

Introduce a shared server-owned pricing authority for catalogue menu quotes, new online orders, order amendments, desktop checkout and kiosk admission. Fixed prices must match the scoped catalogue or configured outlet/customer/venue rules. Unconfigured differences and submitted tax changes fail before persistence. Variable and quick items retain their explicit pricing behavior; accepted lines carry a server-created snapshot so catalogue changes do not silently reprice existing orders.

The change also classifies billing outlets, customer price lists and modifier definitions for desktop synchronization and records deletion tombstones. docs/AUTHORITATIVE_ORDER_PRICING.md defines the contract, legacy behavior and rollout sequence.

Validation: 11 relevant API suites passed (701 tests); after final review, the five affected suites passed again (195 tests, including three new checkout rejection cases). Additional tax, pricing-rule, settings, modifier, idempotency and sync-classification suites passed. ESLint has zero errors; existing warnings remain. Attribution and diff checks passed.

Ready for development verification; production rollout still requires a packaged desktop/Captain/printed receipt smoke test. No production deployment or historical bill changes are included. Updating only the cloud API leaves an old desktop API unprotected. Offline devices can validate against their synced configuration but cannot know edits made while disconnected.

Companion changes: Captain Posnic/captain#183 and Gateway https://github.com/Posnic/Gateway/pull/33.

Merge preparation: corrected retained transfer-allocation handling, hardened deletion IDs and refreshed the server message inventory. Full local API run passed: 466 suites, 12,254 tests (13 skipped). Translation tests: 51 passed. Local lint: zero errors. Development companion fixes are merged through Captain #184 and Gateway #34; packaged device/receipt verification remains for the development environment.

Comment thread api/src/models/setting.model.js Fixed
Comment thread api/src/models/setting.model.js Fixed
@sridharkalaibala
sridharkalaibala marked this pull request as ready for review October 1, 2026 16:30
@sridharkalaibala
sridharkalaibala merged commit 7ac1cfd into develop Oct 1, 2026
12 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants