feat: Admin Subscriptions dashboard and add form #35

Open
nix-dev wants to merge 1 commit from nix-dev/ecomm-store:feature/issue-17-admin-subscriptions into main
First-time contributor

Closes #17

Summary

  • Add /admin/subscriptions page showing:
    • Active subscription count and total revenue (cents + sats)
    • Projected revenue at 1mo/3mo/6mo/1yr assuming no new signups or cancelations
    • Upcoming renewal events table
    • Recent subscription events table
  • Add /admin/subscriptions/add page with form to create subscriptions:
    • User identifier (email or ID)
    • Subscription product dropdown (auto-populated from enabled subscription products)
    • Frequency override and initial state selection
  • Fix bug in createSubscription() where $status parameter was undefined
  • Add nav link on admin dashboard index

Test Plan

  • Navigate to /admin/subscriptions and verify stats tables render
  • Navigate to /admin/subscriptions/add and verify form renders with product dropdown
  • Create a subscription via the form and verify it appears in the recent events table
  • Verify projected revenue calculations match expected values
Closes #17 ## Summary - Add `/admin/subscriptions` page showing: - Active subscription count and total revenue (cents + sats) - Projected revenue at 1mo/3mo/6mo/1yr assuming no new signups or cancelations - Upcoming renewal events table - Recent subscription events table - Add `/admin/subscriptions/add` page with form to create subscriptions: - User identifier (email or ID) - Subscription product dropdown (auto-populated from enabled subscription products) - Frequency override and initial state selection - Fix bug in `createSubscription()` where `$status` parameter was undefined - Add nav link on admin dashboard index ## Test Plan - [ ] Navigate to `/admin/subscriptions` and verify stats tables render - [ ] Navigate to `/admin/subscriptions/add` and verify form renders with product dropdown - [ ] Create a subscription via the form and verify it appears in the recent events table - [ ] Verify projected revenue calculations match expected values
- /admin/subscriptions: shows revenue stats, projected revenue (1mo/3mo/6mo/1yr),
  upcoming renewal events, and recent subscription history
- /admin/subscriptions/add: form to create subscriptions by user email/ID
  with product selection, frequency override, and initial state
- Fix bug in createSubscription() where $status was undefined parameter
- Add model methods: getRecent, getUpcoming, getTotalRevenue, getActiveCount,
  getProjectedRevenue, getSubscriptionProducts
- Add nav link on admin dashboard

Closes #17
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/issue-17-admin-subscriptions:nix-dev-feature/issue-17-admin-subscriptions
git switch nix-dev-feature/issue-17-admin-subscriptions

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff nix-dev-feature/issue-17-admin-subscriptions
git switch nix-dev-feature/issue-17-admin-subscriptions
git rebase main
git switch main
git merge --ff-only nix-dev-feature/issue-17-admin-subscriptions
git switch nix-dev-feature/issue-17-admin-subscriptions
git rebase main
git switch main
git merge --no-ff nix-dev-feature/issue-17-admin-subscriptions
git switch main
git merge --squash nix-dev-feature/issue-17-admin-subscriptions
git switch main
git merge --ff-only nix-dev-feature/issue-17-admin-subscriptions
git switch main
git merge nix-dev-feature/issue-17-admin-subscriptions
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
null/ecomm-store!35
No description provided.