-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscription Plan Selection #229
Comments
This PR implements some new necessary logic in order to follow new saas requirements for process creation. Related: vocdoni/interoperability#210 vocdoni/interoperability#229 - Adds a footer on process creation - Adds a store draft button - Implement new steps when is saas - Add saas extra features on the form - Mock `useAccountPlan`, simulating a call that gives for an organization which features a plan has activated. - Add some minimum styles to try it easier ## Important! This PR **does not** implement: - New styles - Some buttons logics (for example save draft or upgrade plan) - New modals - Logic to store the election on the saas backend (this need some meetings). For now, the SDK and the remote signer are able to create an election on the backend as before.
* Upgrade Github CI workflows * Adds plan types and db setters/getters * Enables reading plan from a json file in the root folder and update any previous subscriptions existing in the DB * Emembeded plans json in `assets/plans.json` * Adds `GET /plans` and `GET /plans/{planID}` * Implements default subscription plan * Implements `GET /organizations/{address}/subscription` * Implements first version of stripe webhook handler that updates subscription * Adds flags "stripeApiSecret" and "stripeWebhookSecret" * Makes user phone Mongo Index a sparse index, as way to accept null values * Creates subscriptions package responsible for checking user permissions for Transactions * Implements initial version subscriiption permission, using the censussize * Updates Docs * Allows only org admins to read organization subscription info * Updates stripe API and subscription IDs * Updates go packages More info on: #17 (comment) vocdoni/interoperability#229
Right now we cannot upgrade a plan (only the tier). We should look in the dashboard how to manage this upgrade flow. Also, when canceling the subscription, the organization don't show any subscription. We should show take a look how to do the cancel/downgrade (show the current plan until the plan subscription ends, even when canceling) or show the Free plan subscription. |
To ensure the organization can perform the desired action, the backend should implement the following checks and controls. These checks can be categorized into basic eligibility, feature-specific, and quota-related validations: 1. Subscription and Plan ValidationsSubscription Status:
Plan-Specific Features:
Quota Limitations:
Add-On Features:
2. Role-Based Access Control (RBAC)Admin Permissions:
Scoped Permissions:
3. Resource Ownership and AvailabilityOrganization Ownership:
|
To extend the subscription model and premium features into a comprehensive system that controls organizational limits, voting process types, and specific voting features, we need to carefully design both the database schema and the logic for backend checks. Below is a detailed breakdown of how this extended model will work, including the structure for a "subscription" object in the database, how it relates to organizational parameters, and integration with Stripe for payment and plan management.
Extended Subscription Model Structure
1. Subscription Object Structure in the Database
The subscription object will have three main sections: organization, votingTypes, and features. Each section will control different aspects of the SaaS platform based on the subscribed plan.
2. Update Organization Object Structure
Each organization object in the database will reference a subscription object and include additional parameters specific to that organization.
Backend Logic for Subscription Checks
The backend needs to perform checks at multiple points to enforce the limits set by the subscription plan. Here's how it would be structured:
1. Check Organizational Limits:
currentMembers < subscriptions.organization.memberships
.currentSubOrgs < subscriptions.organization.subOrgs
.currentProcesses < subscriptions.organization.maxProcesses
.currentCensusSize
to enforce voter limits when a new process is created.2. Check Voting Process Types:
3. Check Voting Features:
During process configuration, check the desired features (e.g., personalization, emailReminder) against subscriptions.features to ensure they are enabled.
Integration with Stripe for Payment and Plan Management
1. Stripe Plan Integration:
2. Syncing Stripe Data with Database:
The text was updated successfully, but these errors were encountered: