-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Objective: Refactor the current basic subscription list into a dynamic state-machine engine that manages trials, grace periods, and predicts cash-flow impact.
L3 Complexity: Requires a major rewrite of the subscription service, a new background worker for state transitions, and complex predictive math.
Files involved (8):
models/Subscription.js
(Add state machine & tracking)
services/subscriptionService.js
(Complete refactor)
jobs/renewalWorker.js (New: Handle trials/expiries)
middleware/subscriptionValidator.js
(New: Lifecycle validation)
utils/predictiveMath.js (New: Forecast cash flow impact)
routes/subscriptions.js
(Update for lifecycle actions)
tests/subscription.test.js (Full lifecycle test suite)
SUBSCRIPTION_ENGINE_DOCUMENTATION.md (Technical spec)