guillermoscript / lms-front

AI Powered LMS app for the future of learning
https://lms-front-two.vercel.app
1 stars 0 forks source link

Implement Renewal Flow #52

Closed guillermoscript closed 2 months ago

guillermoscript commented 3 months ago

Allow the user to renew their current plan with minimal changes required.

guillermoscript commented 3 months ago

Summary Workflow

  1. Identify Subscriptions Due for Renewal: Daily checks using notify_users_for_renewal function scheduled by pg_cron.
  2. Notify Users: Notify users within 15 days of expiry to renew.
  3. User-Initiated Renewal: When the user clicks the renewal button, trigger create_transaction_for_renewal function.
  4. Process New Transactions: Managed by trigger_manage_transactions, updating subscription details upon successful payment.

Using pg_cron, we maintain a timely reminder system, and by integrating the frontend button logic, users can manually trigger renewals, ensuring a robust and user-friendly renewal process.