Prisma and Stripe subscription authorisation
I am working on a side project that has different tiers of subscriptions. I'm using Stripe and have set up everything to sync up
subscription
s, price
s and product
s from Stripe with my database. Now depending on the tier of the subscription users have certain restrictions. For example (completely random), imagine restricting people to X blog posts, Y tweets per day or access to feature Z . Would you guys put this information on the metadata of the Stripe product
like
or create a new table in your database like
The benefit to the metadata is you can directly edit it from Stripe, while the benefit of the table is that you actually know what it contains. Thoughts? How do you guys handle this stuff?1 Reply
I would create a separate table for this permissions - which is related to a user and thereby to the stripe subscription
Since permissions are a own responsibility, they should be stored sepeerate - since maybe you will change your payment provider, add more or want to add a few users who do not have to pay
In all these scenarios a more well defined responsibility and boundary between these „data slices“ is benetifial in my opinion