Skip to content

improvement(subscriptions): added log retention cron, enterprise plan & refactored subscriptions logic#357

Merged
waleedlatif1 merged 9 commits into
mainfrom
improvement/subs
May 15, 2025
Merged

improvement(subscriptions): added log retention cron, enterprise plan & refactored subscriptions logic#357
waleedlatif1 merged 9 commits into
mainfrom
improvement/subs

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator
  • added cron to cleanup logs for free users
  • added log retention cron, enterprise plan. refactored subscriptions logic & ui

Description

Added log retention cron, enterprise plan & refactored subscriptions logic

Type of change

  • New feature (non-breaking change which adds functionality)
  • Code refactoring (no functional changes)

How Has This Been Tested?

Tested manually, ensured that the plan can be issued and the limits adjusted accordingly

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (npm test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel

vercel Bot commented May 14, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 1:25am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) May 15, 2025 1:25am

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR significantly refactors the subscription and waitlist management systems, adding enterprise plan support and log retention features.

  • Added new workspace_invitation table and subscription metadata for enterprise plans in /db/migrations/0035_adorable_loa.sql
  • Added chat execution tracking with new totalChatExecutions field in user stats and related API endpoints
  • Introduced enterprise subscription management with per-seat allowances and custom limits in /lib/subscription/utils.ts
  • Removed waitlist management UI components and API routes, suggesting a major restructuring of this functionality
  • Added daily cron job in vercel.json to clean up logs for free users

The changes appear well-structured but warrant careful testing of the waitlist functionality migration and enterprise plan integration.

41 file(s) reviewed, 21 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread apps/sim/app/admin/waitlist/components/pagination/pagination.tsx
Comment thread apps/sim/app/admin/waitlist/components/search-bar/search-bar.tsx
Comment thread apps/sim/app/api/admin/waitlist/route.ts
Comment thread apps/sim/app/api/user/subscription/update-seats/route.ts Outdated
Comment thread apps/sim/app/api/user/subscription/update-seats/route.ts Outdated
Comment thread apps/sim/db/schema.ts
Comment thread apps/sim/lib/subscription/subscription.ts Outdated
Comment thread apps/sim/lib/subscription/subscription.ts
Comment thread apps/sim/lib/subscription/utils.test.ts
Comment thread apps/sim/lib/usage-monitor.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant