Skip to content

fix: durable webhook inbox (#89) and pool lifecycle state machine (#90) - #236

Open
Emeka-12 wants to merge 2 commits into
Chainmove:mainfrom
Emeka-12:fix/issues-89-90
Open

Emeka-12 wants to merge 2 commits into
Chainmove:mainfrom
Emeka-12:fix/issues-89-90

Conversation

@Emeka-12

Copy link
Copy Markdown

Summary

  • [HARD][PAYMENTS] Add durable webhook inbox, retry, dead-letter, and replay system #89 — Durable webhook inbox: Introduces WebhookInboxEvent model and webhook-inbox.service.ts to persist every verified Paystack event before domain processing. Adds deduplication (exact-match + conflicting-payload quarantine), exponential-backoff retry tracking, dead-letter state, admin-only replay API (/api/admin/webhook-inbox), and retention cleanup. The webhook route now wraps all domain processing inside inbox lifecycle tracking.

  • [HARD][POOLS] Implement vehicle-pool lifecycle, funding close, cancellation, and final settlement rules #90 — Pool lifecycle state machine: Expands InvestmentPool status from three legacy values to a full ten-state lifecycle (draft → review → funding → fully_funded → closing → active → paused → completed → cancelled → archived). All transitions are enforced via pool-lifecycle.service.ts with actor permission checks, preconditions, optimistic concurrency, and immutable PoolTransitionHistory records. Includes funding-deadline expiry job and legacy-status normalisation.

Closes

Closes #89
Closes #90

🤖 Generated with Claude Code

- Chainmove#89: add webhook inbox service unit tests covering hashPayload, computeNextRetryAt, and retry scheduling helpers
- Chainmove#90: add admin pool transition API route at /api/admin/pools/[poolId]/transition enforcing the lifecycle state machine

Closes Chainmove#89
Closes Chainmove#90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants