Add prepared Business reporting API and desktop worker - #1006
Closed
sridharkalaibala wants to merge 5 commits into
Closed
sridharkalaibala wants to merge 5 commits into
sridharkalaibala wants to merge 5 commits into
Conversation
This was referenced Sep 28, 2026
Contributor
Author
|
The complete Business companion stack, including this change, is integrated into develop through #1023. All checks, including CodeQL, passed before merge. Closing this superseded stacked PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Business mobile reads need prepared, scoped amounts without running desktop reports on Cloud. This adds a bounded overview API and an asynchronous desktop worker, with version-2 sales definitions reconciled against the real sale writer. Discounts are not deducted twice; paid KOT bills count; older-bill returns belong to their return day.
Reads recheck current ACL, branch membership and publisher generation, and return unavailable rather than fabricated zeros. Desktop preparation has a lease, cancellation and work limits. Business sessions do not consume selling-handset slots; explicit IP blocks remain effective.
Owners with branch membership can explicitly replace the reporting desktop using live candidate presence, assignment generations and a durable audit journal. An opt-in Community desktop mode prepares and publishes locally without Cloud or a sync agent; the operator supplies secure HTTPS access. Neither mode silently steals another publisher's assignment.
Local validation: 17 real-Mongo auth/read/preparation/management tests, 82 metric/sale-writer tests, 52 desktop route/classification/handset checks, API lint/format, generated docs, declared dependencies and attribution passed. Crash recovery covers both Cloud publication and Community process restart. No CI jobs were added.
Stacked on #1003. Companion Gateway and mobile changes are required for Cloud; Community desktop deployment is documented separately. This remains draft pending large-history performance, source-completeness checkpoints and deployed/native qualification. Summaries are always labelled partial or delayed.