Project

General

Profile

Edit Copy Actions

Feature #11531

closed

Feature #11348: Integrate stripe subscription module for onboarding companies

Task 3: Automated Past-Due & Grace Period Lockout (Dunning)

Added by Divya Inapakurthi 8 days ago. Updated about 14 hours ago.

Status:
Closed
Priority:
Normal
Start date:
10/15/2026
Due date:
10/15/2026
% Done:

100%

Estimated time:
Spent time:

Description

Goal: Protect platform access when recurring payments fail and the grace period expires.


Add

Subtasks


Add

Related issues

Updated by Divya Inapakurthi 7 days ago

  • Due date set to 10/15/2026
  • Status changed from New to Resolved
  • Start date changed from 10/14/2026 to 10/15/2026
  • % Done changed from 0 to 100

Automated Past-Due & Grace Period Lockout (Dunning)

Implemented automated dunning and access management for subscriptions with payment failures:

1. Grace Period Management
  • Configured 7-day grace window (`gracePeriodDays: 7`) with automatic `graceEndsAt` calculation upon payment failure.
  • Company Profile reflects remaining grace days and lockout warning (`Auto-Suspend`).

2. Background Dunning Automation
  • Implemented `processPastDueGraceExpirations` in tenant billing service:
    - Scans hourly for companies in `past_due` status whose `graceEndsAt <= now`.
    - Automatically transitions expired accounts to `suspended`.
    - Records suspension entry in `saasBillingActionHistory`.
    - Dispatches account suspension email with reactivation link.

3. RBAC & Access Enforcement
  • Updated `rbac.service.js`:
    - Grants full operational POS access while within active grace window (`new Date() <= graceEndsAt`).
    - Restricts access with HTTP 403 error once grace period has elapsed or when status is `suspended`.

4. Verification on Tenant
  • Tested `past_due` status transition on tenant `6ad07533f1752405cfbccf1b`:
    - Status confirmed `past_due`.
    - Grace period calculated correctly (5 days remaining).
    - Stripe action history logged in `saasBillingActionHistory`.
    - Operational access preserved during grace window.

Actions #2

Updated by Divya Inapakurthi 3 days ago

  • Target version set to sprint (10/12/2026 - 10/31/2026)
Actions #3

Updated by Divya Inapakurthi about 14 hours ago

  • Status changed from Resolved to Closed
Edit Copy Actions

Also available in: Atom PDF