feat(internal-admin): trial extend + manual activate #28

Merged
root merged 1 commits from dev into main 2026-05-18 09:39:29 +03:00
Owner

Phase C subscriptions endpoints under /internal/admin/subscriptions/:id.

Phase C subscriptions endpoints under /internal/admin/subscriptions/:id.
root added 1 commit 2026-05-18 09:39:28 +03:00
feat(internal-admin): trial extend + manual activate — Phase C
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
0e83353f4e
Two new endpoints on /internal/admin/subscriptions/:id behind the
InternalTokenGuard.

POST .../trial/extend     { days, reason, founderId }
- Only operates on status='trial' subscriptions.
- 1..90 day clamp; new endDate = max(now, current endDate) + days
  (never shrinks the trial window).
- Returns previous/new endDate + daysAdded.

POST .../activate         { reason, founderId }
- Wraps SubscriptionsService.activateSubscription which handles
  status transition, startDate/endDate by billing period, and
  brand auto-assignment for Full plan.
- Refuses already-active, cancelled, or expired subscriptions.

Wiring
- BillingService + BillingController added to InternalAdminModule.
- SubscriptionsModule imported so we can call activateSubscription.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
root merged commit a25a837401 into main 2026-05-18 09:39:29 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: root/sase.tr#28