From c6c8abd23b17dfeb67bd686de8b0bc13559c4d45 Mon Sep 17 00:00:00 2001 From: Muhammad Arslan Date: Tue, 29 Nov 2022 18:07:53 +0500 Subject: [PATCH] Subscription settings added (#338) --- cms/envs/common.py | 3 +++ lms/envs/common.py | 43 ++++++++++++++++++++++++++++++ openedx/features/edly/constants.py | 9 +++++++ 3 files changed, 55 insertions(+) diff --git a/cms/envs/common.py b/cms/envs/common.py index a61801882248..ea1a06449258 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -108,6 +108,9 @@ IDA_LOGOUT_URI_LIST, + # Subscription Plans + PLAN_FEATURES, + # Methods to derive settings _make_mako_template_dirs, _make_locale_paths, diff --git a/lms/envs/common.py b/lms/envs/common.py index 2e0e1a9bcddc..54db2ca05036 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -52,6 +52,18 @@ ) from openedx.core.lib.derived import derived, derived_collection_entry from openedx.core.release import doc_version +from openedx.features.edly.constants import ( + ADDITIONAL_USER_PRICE, + COURSE_AUTHORS, + ELITE, + ESSENTIALS, + MONTHLY_ACTIVE_USERS, + NUMBER_OF_COURSES, + NUMBER_OF_REGISTERED_USERS, + STAFF_USERS, + TRIAL, + WP_ADMIN_USERS, +) from xmodule.modulestore.modulestore_settings import update_module_store_settings from xmodule.modulestore.edit_info import EditInfoMixin from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin @@ -3998,3 +4010,34 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring ##################### SUPPORT URL ############################ SUPPORT_HOW_TO_UNENROLL_LINK = '' + +# Subscription Plans +PLAN_FEATURES = { + TRIAL: { + ADDITIONAL_USER_PRICE: 0, + MONTHLY_ACTIVE_USERS: 20, + NUMBER_OF_REGISTERED_USERS: 20, + NUMBER_OF_COURSES: 3, + STAFF_USERS: 1, + WP_ADMIN_USERS: 1, + COURSE_AUTHORS: 1, + }, + ESSENTIALS: { + ADDITIONAL_USER_PRICE: 2, + MONTHLY_ACTIVE_USERS: 1000, + NUMBER_OF_REGISTERED_USERS: 5000, + NUMBER_OF_COURSES: 50, + STAFF_USERS: 1, + WP_ADMIN_USERS: 1, + COURSE_AUTHORS: 3, + }, + ELITE: { + ADDITIONAL_USER_PRICE: 2, + MONTHLY_ACTIVE_USERS: 5000, + NUMBER_OF_REGISTERED_USERS: 50000, + NUMBER_OF_COURSES: 200, + STAFF_USERS: 3, + WP_ADMIN_USERS: 3, + COURSE_AUTHORS: 10, + } +} diff --git a/openedx/features/edly/constants.py b/openedx/features/edly/constants.py index bbdd0ad174b6..898b7c21b1ee 100644 --- a/openedx/features/edly/constants.py +++ b/openedx/features/edly/constants.py @@ -8,3 +8,12 @@ ELITE = 'elite' TRIAL_EXPIRED = 'trial expired' DEACTIVATED = 'deactivated' + +# FEATURE FLAGS +ADDITIONAL_USER_PRICE = 'additional_user_price' +MONTHLY_ACTIVE_USERS = 'monthly_active_users' +NUMBER_OF_REGISTERED_USERS = 'number_of_registered_users' +NUMBER_OF_COURSES = 'number_of_courses' +STAFF_USERS = 'staff_users' +WP_ADMIN_USERS = 'wp_admin_users' +COURSE_AUTHORS = 'course_authors'