dummy data
This commit is contained in:
@@ -2,41 +2,52 @@ from flask import jsonify
|
||||
from app.utils.logger import logger
|
||||
from app.api.services.base_service import BaseService
|
||||
from sqlalchemy import func, desc
|
||||
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.user import UserSchema
|
||||
from app.models import Members
|
||||
|
||||
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']
|
||||
},
|
||||
}
|
||||
}
|
||||
with db.session.begin():
|
||||
validated_data = SubscriptionService.validate_data(data, UserSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
member_data = Members.get_member_by_uid(uid)
|
||||
member_id = member_data.id
|
||||
|
||||
return subscription_products_data
|
||||
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 ResponseHelper.success(data=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