Deliver scoped approval-request alerts with independent preferences - #1017
Closed
sridharkalaibala wants to merge 7 commits into
Closed
sridharkalaibala wants to merge 7 commits into
sridharkalaibala wants to merge 7 commits into
Conversation
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.
New pending discount requests did not produce owner Inbox or phone alerts. Add independent account/branch opt-in and quiet hours, bounded background event materialization, negotiated Inbox entries, and push delivery that rechecks current recipient scope, discount limits, request state/expiry, preferences and session before every attempt. No financial details or approval command enter a provider payload.
GET/POST
/notifications/approvals/:branchIduses live ACL and revision checks./discovery?approvals=1advertises support only while decisions are enabled;/inbox?approvals=1opts into the new shape. Older clients retain daily-only responses. Expired or closed requests are hidden while pagination preserves the underlying cursor. Each worker stage handles failures independently.Also repair actual daily-summary push materialization: the internal
pushPendingmarker belongs on Inbox writes, not the public preference response. The latter previously violated the strict mobile preference contract.Stacked on #1016. Paired mobile implementation: Posnic/posnic-business#13.
Local validation: 38 real-Mongo access/approval-alert/daily-notification/push tests, three notification-worker unit tests, targeted ESLint/Prettier, 19 README claims, generated API docs/OpenAPI lint and attribution checks pass. README correctly declares 741 endpoints. Paired mobile passes 71 tests, 31 browser flows and both Hermes exports. Existing CI is unchanged.
Decisions remain disabled unless explicitly configured. Production deployment, real APNs/FCM delivery, physical-device behavior, qualified translations and uncertain cashier execution handling remain release work.