sub items
This commit is contained in:
@@ -4,7 +4,7 @@ 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, MembersProducts, SubscriptionOptions
|
||||
from app.models import Members, MembersProducts, SubscriptionOptions, SubscriptionOptionsItems
|
||||
from app.extensions import db
|
||||
|
||||
|
||||
@@ -87,9 +87,8 @@ class SubscriptionService(BaseService):
|
||||
'package_uid': t.uid,
|
||||
'display_name': t.display_name,
|
||||
'option_name': t.option_name,
|
||||
'monthly': round(t.monthly*0.01, 2),
|
||||
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
||||
'Cancel anytime'],
|
||||
'monthly': round(t.monthly * 0.01, 2),
|
||||
"items": SubscriptionService.subscription_items_data(t.option_name),
|
||||
'added': t.added.isoformat() if t.added else None,
|
||||
'updated': t.updated.isoformat() if t.updated else None
|
||||
})
|
||||
@@ -115,6 +114,16 @@ class SubscriptionService(BaseService):
|
||||
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||
return jsonify({"message": "Internal Server Error"}), 500
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
@staticmethod
|
||||
def subscription_items_data(option_name):
|
||||
items_data = SubscriptionOptionsItems.get_subscription_item(option_name)
|
||||
res_options_items = []
|
||||
for t in items_data:
|
||||
res_options_items.append({
|
||||
'description': t.description
|
||||
})
|
||||
|
||||
# return ['Post Jobs 222', 'advanced instructors search', 'invite candidates', 'post events',
|
||||
# 'Cancel anytime']
|
||||
return res_options_items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user