This is something I’ve been having difficultly setting up correctly.
My app allows users to sign up which creates a collection of users and companies. Users are currently tied to the company collection via relationship.
During onboarding, a user selects an account tier (Basic or Premium). Basic is free with less features and Premium will cost will access to all features.
My dilema is setting up the collections with the proper relationships so that when a change is made to the “company” subscription, it will affect all users associated with that company.
What is the most optimized way to set up the collections?
Do I need a separate collection for Subscriptions?
Do I need a seperate collection for Tiers (listing the two tiers)?
How do I make the relationships work so that companies and all users within that company take on the changes?
I would just store the permissions in the company table and then reference that for your conditional actions or visibility throughout the app. Seeing as a user can have once company, it should be straightforward.
By all means have a collection of tiers which is related to company, but if you have only two tiers, is it necessary?
If you really want to store it on a User level then you have to GET the users from that company and update the value for each one. Most likely via a 3rd party API call to Adalo Collections.