diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 53d4dee..454a6bd 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -87,14 +87,21 @@ def merms_account_bar(): response = AccountService.process_bar_request(data) return response -@api.route("/panel/account-actions", methods=["POST"]) +@api.route("/panel/account/bar", methods=["POST"]) +@jwt_required() +def merms_account_bar2(): + data = request.get_json() + response = AccountService.process_bar_request(data) + return response + +@api.route("/panel/account/actions", methods=["POST"]) @jwt_required() def merms_account_actions(): data = request.get_json() - response = AccountService.process_request(data) + response = AccountService.process_action_request(data) return response -@api.route("/panel/account-productsurl", methods=["POST"]) +@api.route("/panel/account/productsurl", methods=["POST"]) @jwt_required() def merms_account_product_url(): data = request.get_json() diff --git a/app/api/services/account.py b/app/api/services/account.py index c194460..3e27c5f 100644 --- a/app/api/services/account.py +++ b/app/api/services/account.py @@ -38,6 +38,22 @@ class AccountService(BaseService): } return ResponseHelper.success(data=bar_data) + @staticmethod + def process_action_request(data): + bar_data = { + "last_update": datetime.datetime.utcnow(), + "top_bar": [ + {"id": "1", "description": "Contacts", "last_update": "10-10-2010 11:00 AM", + "value": random.randint(0, 10), "data_span": 'Last 2 months'}, + {"id": "2", "description": "Site Traffic", "last_update": "10-10-2010 11:30 AM", + "value": random.randint(0, 10), "data_span": 'Past 12 hours'}, + {"id": "3", "description": "Appointments", "last_update": "10-12-2010 11:30 AM", + "value": random.randint(0, 10), "data_span": 'Last 14 days'}, + {"id": "4", "description": "Purchases", "last_update": "10-12-2010 11:30 AM", + "value": random.randint(0, 10), "data_span": 'Last 3 months'}, + ] + } + return ResponseHelper.success(data=bar_data) @staticmethod def process_request(data):