onlook icon indicating copy to clipboard operation
onlook copied to clipboard

feat: add stripe webhooks incomplete

Open Kitenite opened this issue 9 months ago • 2 comments

Description

Related Issues

Type of Change

  • [ ] Bug fix
  • [ ] New feature
  • [ ] Documentation update
  • [ ] Release
  • [ ] Refactor
  • [ ] Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


[!IMPORTANT] Add Stripe webhook handling for subscription events and refactor subscription management in the database and models.

  • Stripe Webhooks:
    • Add handleCheckoutSessionCompleted and handleSubscriptionDeleted in stripe.ts to handle checkout.session.completed and customer.subscription.deleted events.
    • Update POST function in route.ts to use new handlers.
  • Database Schema:
    • Add plans, prices, and subscriptions tables in subscription.ts.
    • Add usageRecords table in usage.ts.
    • Update users table relations in user.ts to include subscriptions.
  • Models and Enums:
    • Add SubscriptionPlans enum in subscription/index.ts.
    • Remove UsagePlanType and related interfaces from usage/index.ts.
  • Refactoring:
    • Move default creation functions from utility/src/defaults to db/src/defaults.
    • Update imports in various files to reflect new paths and names.
  • API Routers:
    • Add subscriptionRouter in routers/subscription.ts for user plan queries.
    • Update root.ts to include subscriptionRouter.

This description was created by Ellipsis for 49521877c15bd12a553711a3b07bc026fe273921. You can customize this summary. It will automatically update as commits are pushed.

Kitenite avatar Jun 13 '25 05:06 Kitenite

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2025 7:48pm
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2025 7:48pm

vercel[bot] avatar Jun 13 '25 05:06 vercel[bot]

This pull request has been ignored for the connected project wowaemfasoptxrdjhilu because there are no changes detected in apps/backend/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase. Learn more about Supabase Branching ↗︎.

supabase[bot] avatar Jun 13 '25 05:06 supabase[bot]