Public Access
1
0

feat: harden scheduled downgrade lifecycle and messaging

This commit is contained in:
pguerrerox
2026-05-26 00:34:00 +00:00
parent 232342d6a1
commit f1c3e2db7d
7 changed files with 133 additions and 35 deletions
+3 -1
View File
@@ -417,7 +417,7 @@ export function AccountPage({ user, onUserUpdated, initialCheckoutPlanCode = nul
<p className="mt-4 text-sm text-stone-600">{account.billing.message}</p>
{account.billing.pendingPlanCode && account.billing.pendingPlanEffectiveAt ? (
<div className="mt-4 rounded-2xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900">
Pending change to <span className="font-semibold">{account.billing.pendingPlanCode}</span> on {formatLifecycleDate(account.billing.pendingPlanEffectiveAt)}.
Scheduled downgrade to <span className="font-semibold">{account.billing.pendingPlanCode}</span> on {formatLifecycleDate(account.billing.pendingPlanEffectiveAt)}. If usage is above the new limits after this date, chargeable actions may pause until usage resets, you add capacity, or you upgrade again.
</div>
) : null}
<div className="mt-4 flex flex-wrap gap-3">
@@ -679,6 +679,8 @@ export function AccountPage({ user, onUserUpdated, initialCheckoutPlanCode = nul
<div className="grid gap-2 text-stone-600">
<div>Renewal: <span className="font-medium text-stone-900">{formatDateLabel(adminWorkspaceDetail.billing.currentPeriodEndsAt)}</span></div>
<div>Grace ends: <span className="font-medium text-stone-900">{formatDateLabel(adminWorkspaceDetail.billing.gracePeriodEndsAt)}</span></div>
<div>Pending plan: <span className="font-medium text-stone-900">{adminWorkspaceDetail.billing.pendingPlanCode || 'None'}</span></div>
<div>Pending effective: <span className="font-medium text-stone-900">{formatDateLabel(adminWorkspaceDetail.billing.pendingPlanEffectiveAt)}</span></div>
<div>Subscription ref: <span className="font-medium text-stone-900">{adminWorkspaceDetail.summary.externalSubscriptionRef || 'Not set'}</span></div>
<div>Usage period id: <span className="font-medium text-stone-900">{adminWorkspaceDetail.usagePeriodId || 'Not active'}</span></div>
</div>