We have an existing implementation where all users belong to an organisation will depend on the organisation subscription, so if the subscription has ended all users belong to this organisation will not be able to access our web application. They won't be able to login due to expired subscription.
Sample DB Schema for Existing Implementation:
Now we want to implement a subscription not only for an organisation but also for individual user. So there will be:
Trial (for 1 user and with limited access to some features) Subscription 1 (for 1 user) Subscription 2 (for 20 user) Subscription 3 (this is an enterprise and would depend on how many allowed users an enterprise want). By this I have to track user who are in trial subscription with their start and end date however there is also a problem this trial user has an organisation which in the existing implementation organisation has allowed accounts and renewal date (expiration date of their subscription).
I'm thinking to create a subscription table where I will add user_id and organisation_id in this table and will include the start and end date also the type of subscription whether trial, subscription 1, subscription 2 or subscription 3. But I'm worried this would be a bad implementation knowing organisation table has already allowed accounts (how many user could access our web application) and renewal date (which is their expiration date of their subscription). Any suggestion on this? I would really appreciate it.