Open jpaulet opened 2 months ago
Just FYI, actually the frontend can get an env var called "features", more or less accepts this:
{
"faucet": true,
"calculator": true,
"vote": {
"anonymous": true,
"overwrite": true,
"secret": true,
"customization": true
},
"types": {
"single": true,
"multi": false,
"approval": false,
"participatory": false,
"borda": false
},
"login": [
"web3",
"web2"
],
"census": [
"spreadsheet",
"token",
"web3"
],
"unimplemented_census": [],
"voting_type": [
"single",
"approval"
],
"unimplemented_voting_type": [],
"languages": [
"en",
"es",
"ca"
]
}
This configure what the ui-scaffold have to show on the frontend. Take special attention to unimplemented_census
and unimplemented_voting_type
, this are those to be shown on the view with a badge Pro
.
Feature object is defined here: https://github.com/vocdoni/ui-scaffold/blob/main/src/importmeta.d.ts#L1
And the keys of the unimplemented features are:
I suggest to adapt this code, or think if we need to develop something on this direction to show this pro features
This would be for showing/not showing by configuration in the ENV var. What we want to archive is to know if the current org plan includes the feature in the subscription plan in order to render a "PRO" (for instance) and change the behavior (allow directly to select it or upgrade the plan/pay extra tokens).
As Vocdoni, we want to reuse the current voting process structure stored in the Blockchain but also store some new information in the database, after passing the corresponding checks/permissions/subscription level by the backend. In the database, we should store for each process, the extra-features enabled for that specific process. The proccess could have a list of new extra-features, like:
1 - Check if the process can be created by the user:
2 -Design the process table in the BBDD 3 - Store the process object in the BBDD with the news params.
Premium Features List
Customization and Personalization
Email Reminders
SMS Notifications
Anonymous voting
Custom Voting Instructions and Popups
White-Label Voting Page
Advanced Voter Authentication
Custom URL for Voting Page
Post-Voting Redirect and Countdown
Live Streaming
Extended Support and Priority Service
Custom Email Templates
Support for Attachments
Emergency Voting Pause
Private Voting
Daily updates on voting turnout
Free text input
Options in Random Order
Welcome Page
Others: Quorum, Encrypted, etc.
And the list of features could increase in the future.
Then, in the DDBB, we must relate the process ID with the list of extra-features added, and in some cases, the frontend should be able to read those parameters to render extra information or change the look'n'feel of the voting page.
Possible solution for the BBDD:
ProcessId:
0x02323....ab
Features:The backend must compare each feature name with the current organization subscription and check if is enabled in the current plan, then, in the plans it will be something similar to:
If a feature is not in the subscription list, it can't be stored in the process list and should be ignored.