Description
Today, zapping in ZapDesk relies on each user funding their own wallet. For internal recognition (zapping a colleague who fixed a bug, helped a customer, etc.) a company should be able to fund a shared budget centrally and let staff zap from it within agreed limits — without each person needing to top up a personal wallet.
Add the ability to connect a corporate NWC (Nostr Wallet Connect) wallet to a ZapDesk organization, with a per-user (and/or per-period) allowance that defines how much each authorised user can spend from it.
Expected Behavior
- An organization admin can connect a corporate NWC wallet on the org settings page (NWC connection string / pairing flow).
- Admins can configure allowances:
- Per-user budget (e.g. "every team member can zap up to 50k sats / month"), or
- Per-role / group budget (e.g. higher allowance for managers).
- Optional reset cadence (daily / weekly / monthly).
- When a user sends a zap, they can choose "Use corporate wallet" (if they have remaining allowance) or "Use personal wallet".
- The corporate wallet path debits the shared NWC wallet and decrements the user's remaining allowance.
- If the user's allowance is exhausted or the corporate wallet is offline / out of funds, the UI falls back to personal wallet with a clear message.
- All corporate-wallet zaps are recorded with: payer (the user), funding source ("corporate"), recipient, amount, timestamp.
Notes / Implementation Pointers
- Reuse the existing NWC wiring (see Lightning / zap code paths); the new bit is the org-level connection and the allowance ledger.
- Allowance ledger: simplest model is a per-user counter (`remainingSats`, `resetsAt`) updated on each successful zap and reset on schedule. Atomic decrement on the server before payment to avoid double-spend across concurrent zaps.
- Treat the corporate NWC secret as sensitive — store encrypted at rest, never expose to clients; payment-execution happens server-side.
- Audit log of corporate-wallet zaps is essential for finance / compliance: who zapped whom, when, how much.
- Consider an admin dashboard showing total spend, top recipients, and remaining org-level budget.
Environment
- Version: 0.9.0
- Pages: org settings, profile zap flow, ticket zap flow
Description
Today, zapping in ZapDesk relies on each user funding their own wallet. For internal recognition (zapping a colleague who fixed a bug, helped a customer, etc.) a company should be able to fund a shared budget centrally and let staff zap from it within agreed limits — without each person needing to top up a personal wallet.
Add the ability to connect a corporate NWC (Nostr Wallet Connect) wallet to a ZapDesk organization, with a per-user (and/or per-period) allowance that defines how much each authorised user can spend from it.
Expected Behavior
Notes / Implementation Pointers
Environment