feat(internal-admin): plan change + cancel/resume #29
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase D billing endpoints. Brand reassignment flagged when plan brandCount diverges.
Three new endpoints on /internal/admin/subscriptions/:id complete the Süper Panel billing surface. POST .../change-plan { newPlanId, reason, founderId } - Only for active or trial subscriptions. - Refuses no-op (already on that plan) and inactive plans. - Updates planId; leaves userBrands intact so the founder can decide. - Response includes brandReassignmentNeeded flag when the new plan's brandCount diverges from the current user-brand count (the panel surfaces a warning so the founder reaches out). POST .../cancel { reason, founderId } - Active or trial → cancelled (sets cancelledAt = now). - Refuses already-cancelled or expired. POST .../resume { reason, founderId } - Cancelled → active (clears cancelledAt). - All other states rejected. Controller cleanup: factored requireFounder + requireReason guards so every endpoint enforces the same validation contract uniformly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>