subscription layer
This commit is contained in:
@@ -8,7 +8,9 @@ from app.api.services import (
|
|||||||
MyProductsService,
|
MyProductsService,
|
||||||
ContactService,
|
ContactService,
|
||||||
OfficeAuthService,
|
OfficeAuthService,
|
||||||
OfficeDashboardService, WebContentsService
|
OfficeDashboardService,
|
||||||
|
WebContentsService,
|
||||||
|
SubscriptionService
|
||||||
)
|
)
|
||||||
from app.utils.logger import logger
|
from app.utils.logger import logger
|
||||||
from app.api.middlewares import enforce_json, require_auth
|
from app.api.middlewares import enforce_json, require_auth
|
||||||
@@ -183,6 +185,12 @@ def myproduct_settings_values():
|
|||||||
response = MyProductsService.process_settings_values(data)
|
response = MyProductsService.process_settings_values(data)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@api.route("/panel/subscription/products", methods=["POST"])
|
||||||
|
def subscription_products():
|
||||||
|
data = request.get_json()
|
||||||
|
logger.info(f"Route Subscription Product Data ==>>>> {data}")
|
||||||
|
response = SubscriptionService.subscription_available_products(data)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
# /panel/myproduct/subscription
|
# /panel/myproduct/subscription
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ from app.api.services.contacts import ContactService
|
|||||||
from app.api.services.office_auth import OfficeAuthService
|
from app.api.services.office_auth import OfficeAuthService
|
||||||
from app.api.services.office_dashboard import OfficeDashboardService
|
from app.api.services.office_dashboard import OfficeDashboardService
|
||||||
from app.api.services.web_contents import WebContentsService
|
from app.api.services.web_contents import WebContentsService
|
||||||
|
from app.api.services.subscription import SubscriptionService
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
from flask import jsonify
|
||||||
|
from app.utils.logger import logger
|
||||||
|
from app.api.services.base_service import BaseService
|
||||||
|
from sqlalchemy import func, desc
|
||||||
|
|
||||||
|
|
||||||
|
class SubscriptionService(BaseService):
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def subscription_available_products(data):
|
||||||
|
try:
|
||||||
|
subscription_products_data = {
|
||||||
|
"current_product": {
|
||||||
|
"display_name": "Current Subscriptions",
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"starter":{
|
||||||
|
"display_name" : "Starter",
|
||||||
|
"monthly" : 5.99,
|
||||||
|
"items" : ['Post Jobs','advanced instructors search','invite candidates','post events',
|
||||||
|
'Cancel anythime']
|
||||||
|
},
|
||||||
|
"basic": {
|
||||||
|
"display_name": "Basic",
|
||||||
|
"monthly": 12.99,
|
||||||
|
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
||||||
|
'Cancel anythime']
|
||||||
|
},
|
||||||
|
"premium": {
|
||||||
|
"display_name": "Premium",
|
||||||
|
"monthly": 20.99,
|
||||||
|
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
||||||
|
'Cancel anythime']
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return subscription_products_data
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||||
|
return jsonify({"message": "Internal Server Error"}), 500
|
||||||
Reference in New Issue
Block a user