Skip to content

Deliver scoped approval-request alerts with independent preferences - #1017

Closed
sridharkalaibala wants to merge 7 commits into
codex/business-item-insightsfrom
codex/business-approval-alerts
Closed

sridharkalaibala wants to merge 7 commits into
codex/business-item-insightsfrom
codex/business-approval-alerts

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

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/:branchId uses live ACL and revision checks. /discovery?approvals=1 advertises support only while decisions are enabled; /inbox?approvals=1 opts 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 pushPending marker 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.

@sridharkalaibala

Copy link
Copy Markdown
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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant