Commit 93b0c18b authored by harshavardhan.c's avatar harshavardhan.c

Added new services for support lens dashboard

parent 1c975cab
...@@ -16,9 +16,12 @@ class Endpoints: ...@@ -16,9 +16,12 @@ class Endpoints:
save_support_case = base_url + "/support_case/create" save_support_case = base_url + "/support_case/create"
fetch_support_case = base_url + "/support_case/fetch" fetch_support_case = base_url + "/support_case/fetch"
delete_support_case = base_url + "/support_case/delete" delete_case_details = base_url + "/support_case/delete"
resolve_case_details = base_url + "/support_case/resolve"
close_case_details = base_url + "/support_case/close"
edit_support_case = base_url + "/support_case/edit" edit_support_case = base_url + "/support_case/edit"
get_support_case_table_details = base_url + "/support_case/fetch_table" get_support_case_table_details = base_url + "/support_case/fetch_table"
get_dashboard_details = base_url + "/support_case/get_dashboard_details"
class DBMapping: class DBMapping:
...@@ -39,7 +42,12 @@ class DBMapping: ...@@ -39,7 +42,12 @@ class DBMapping:
class CaseStatus: class CaseStatus:
OPEN = "open" OPEN = "open"
DELETE = "delete" DELETED = "deleted"
CLOSED = "closed"
REPLIED = "replied"
RESOLVED = "resolved"
RE_ASSIGNED = "re_assigned"
ASSIGNED = "assigned"
class StatusMessages: class StatusMessages:
...@@ -58,6 +66,8 @@ class StatusMessages: ...@@ -58,6 +66,8 @@ class StatusMessages:
SUPPORTCASE_SAVE = "Failed to save support case details" SUPPORTCASE_SAVE = "Failed to save support case details"
SUPPORTCASE_FETCH = "Failed to fetch support case details" SUPPORTCASE_FETCH = "Failed to fetch support case details"
SUPPORTCASE_DASHBOARD = "Failed to fetch dashboard details"
SUPPORTCASE = "Failed to update case details"
class StaticJsons: class StaticJsons:
...@@ -95,8 +105,8 @@ class StaticJsons: ...@@ -95,8 +105,8 @@ class StaticJsons:
] ]
SUPPORTLENS_FETCHTABLE_HEADERCONTENT = [ SUPPORTLENS_FETCHTABLE_HEADERCONTENT = [
{ {
"value": "case_number", "value": "case_id",
"label": "case Number", "label": "Case Number",
"enable_column_search": True, "enable_column_search": True,
"header_type": "text" "header_type": "text"
}, },
...@@ -107,18 +117,19 @@ class StaticJsons: ...@@ -107,18 +117,19 @@ class StaticJsons:
"header_type": "text" "header_type": "text"
}, },
{ {
"value": "customer_project_id", "value": "ProjectName",
"label": "Customer Project ID", "label": "Customer Project ID",
"enable_column_search": True, "enable_column_search": True,
"header_type": "text" "header_type": "text"
}, },
{ # {
"value": "status", # "value": "status",
"label": "Status", # "label": "Status",
"enable_column_search": True, # "enable_column_search": True,
"header_type": "select", # "header_type": "select",
"options": [] # "options": [],
}, # "hidden": True
# },
{ {
"value": "created_by", "value": "created_by",
"label": "Created By", "label": "Created By",
...@@ -127,7 +138,7 @@ class StaticJsons: ...@@ -127,7 +138,7 @@ class StaticJsons:
"options": [] "options": []
}, },
{ {
"value": "last_updated", "value": "last_updated_on",
"label": "Last Updated", "label": "Last Updated",
"enable_column_search": True, "enable_column_search": True,
"header_type": "date_range" "header_type": "date_range"
...@@ -159,6 +170,110 @@ class StaticJsons: ...@@ -159,6 +170,110 @@ class StaticJsons:
] ]
} }
SUPPORTLENS_HEADER_CONTENT = {"support_lens_table_header_content": [
{
"key": "open",
"label": "Open",
"svgName": 'open.svg',
"count": 0,
"className": "w-20",
},
{
"key": "replied",
"label": "Replied",
"count": 0,
"svgName": 'replied-yet-to-assign.svg',
"className": "w-20",
},
{
"key": "assigned",
"label": "Assigned",
"count": 0,
"svgName": 'assigned.svg',
"className": "w-20",
},
{
"key": "re_assigned",
"label": "Re-Assigned",
"count": 0,
"svgName": 're-assigned.svg',
"className": "w-20",
},
{
"key": "resolved",
"label": "Resolved",
"count": 0,
"svgName": 'resolved.svg',
"className": "w-20",
},
{
"key": "deleted",
"label": "Deleted",
"count": 0,
"svgName": 'deleted.svg',
"className": "w-20 mr-1",
},
{
"key": "closed",
"label": "Closed",
"count": 0,
"svgName": 'closed.svg',
"className": "w-20 mr-1",
}
],
"support_lens_dashboard_header_content":
[
{
"key": "open",
"label": "OPEN CASES",
"count": 0,
"valueColor": "#484848",
"iconStyle": {"color": '#F44336'},
"svgName": 'open.svg'
},
{
"key": "replied",
"label": "REPLIED/ YET TO ASSIGN",
"count": 0,
"valueColor": "#484848",
"iconStyle": {'color': '#FFC107'},
"svgName": 'replied-yet-to-assign.svg'
},
{
"key": "assigned",
"label": "ASSIGNED CASES",
"count": 0,
"valueColor": "#484848",
"iconStyle": {'color': '#03A9F4'},
"svgName": 'assigned.svg'
},
{
"key": "re_assigned",
"label": "RE-ASSIGNED CASES",
"count": 0,
"valueColor": "#484848",
"iconStyle": {'color': '#3F51B5'},
"svgName": 're-assigned.svg'
},
{
"key": "resolved",
"label": "RESOLVED CASES",
"count": 0,
"valueColor": "#484848",
"iconStyle": {'color': '#4CAF50'},
"svgName": 'resolved.svg'
}
],
"support_lens_chart_header_content":
[
{"count": 0, "name": 'OPEN CASES', "itemStyle": {"color": '#EF5350'}, "key": "open"},
{"count": 0, "name": 'REPLIED/ YET TO ASSIGN', "itemStyle": {"color": '#FFCA28'}, "key": "replied"},
{"count": 0, "name": 'ASSIGNED CASES', "itemStyle": {"color": '#29B6F6'}, "key": "assigned"},
{"count": 0, "name": 'RE-ASSIGNED CASES', "itemStyle": {"color": '#5C6BC0'}, "key": "re_assigned"},
{"count": 0, "name": 'RESOLVED CASES', "itemStyle": {"color": '#66BB6A'}, "key": "resolved"},
]
}
class MongoEncryptionConstants: class MongoEncryptionConstants:
......
...@@ -118,7 +118,7 @@ class ResolverSetupHandler: ...@@ -118,7 +118,7 @@ class ResolverSetupHandler:
collection_name=DBMapping.resolver_configuration, collection_name=DBMapping.resolver_configuration,
set_json=record, query=query_json) set_json=record, query=query_json)
final_json = dict(status=StatusMessages.SUCCESS, message="Category saved Successfully") final_json = dict(status=StatusMessages.SUCCESS, message="Resolver data saved Successfully")
except Exception as e: except Exception as e:
logger.debug("Exception occurred while saving category data" + str(e)) logger.debug("Exception occurred while saving category data" + str(e))
return final_json return final_json
...@@ -165,7 +165,7 @@ class ResolverSetupHandler: ...@@ -165,7 +165,7 @@ class ResolverSetupHandler:
self.mongo_obj.delete_one_record(db_name=DBMapping.support_lens_configuration, self.mongo_obj.delete_one_record(db_name=DBMapping.support_lens_configuration,
collection_name=DBMapping.resolver_configuration, collection_name=DBMapping.resolver_configuration,
query_json=query_json) query_json=query_json)
final_json = dict(status=StatusMessages.SUCCESS, message="Resolved deleted Successfully") final_json = dict(status=StatusMessages.SUCCESS, message="Resolver data deleted Successfully")
except Exception as e: except Exception as e:
logger.debug("Exception occurred while deleting Resolver data" + str(e)) logger.debug("Exception occurred while deleting Resolver data" + str(e))
return final_json return final_json
......
...@@ -35,24 +35,47 @@ def fetch_support_case_details(): ...@@ -35,24 +35,47 @@ def fetch_support_case_details():
return final_json return final_json
@supportcase_setup_configuration.route(Endpoints.delete_support_case, methods=['POST']) @supportcase_setup_configuration.route(Endpoints.delete_case_details, methods=['POST'])
@apply_encryption @apply_encryption
def delete_support_case_details(): def delete_case_details():
final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE_SAVE} final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE}
try: try:
input_data = request.data input_data = request.data
# input_data = request.get_json() # input_data = request.get_json()
final_json = handler_obj.delete_case_details(input_data) final_json = handler_obj.delete_support_case_details(input_data)
except Exception as e: except Exception as e:
logger.exception("Exception -> %s" % str(e)) logger.exception("Exception -> %s" % str(e))
return final_json return final_json
@supportcase_setup_configuration.route(Endpoints.resolve_case_details, methods=['POST'])
@apply_encryption
def resolve_case_details():
final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE}
try:
input_data = request.data
# input_data = request.get_json()
final_json = handler_obj.resolve_support_case_details(input_data)
except Exception as e:
logger.exception("Exception -> %s" % str(e))
return final_json
@supportcase_setup_configuration.route(Endpoints.close_case_details, methods=['POST'])
@apply_encryption
def close_case_details():
final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE}
try:
input_data = request.data
# input_data = request.get_json()
final_json = handler_obj.close_case_details(input_data)
except Exception as e:
logger.exception("Exception -> %s" % str(e))
return final_json
@supportcase_setup_configuration.route(Endpoints.get_support_case_table_details, methods=['POST']) @supportcase_setup_configuration.route(Endpoints.get_support_case_table_details, methods=['POST'])
@apply_encryption @apply_encryption
def get_support_case_table_details(): def get_support_case_table_details():
final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE_SAVE} final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE_FETCH}
try: try:
input_data = request.data input_data = request.data
# input_data = request.get_json() # input_data = request.get_json()
...@@ -60,3 +83,16 @@ def get_support_case_table_details(): ...@@ -60,3 +83,16 @@ def get_support_case_table_details():
except Exception as e: except Exception as e:
logger.exception("Exception -> %s" % str(e)) logger.exception("Exception -> %s" % str(e))
return final_json return final_json
@supportcase_setup_configuration.route(Endpoints.get_dashboard_details, methods=['POST'])
@apply_encryption
def get_dashboard_details():
final_json = {"status": StatusMessages.FAILED, "message": StatusMessages.SUPPORTCASE_DASHBOARD}
try:
input_data = request.data
# input_data = request.get_json()
final_json = handler_obj.get_dashboard_details(input_data)
except Exception as e:
logger.exception("Exception -> %s" % str(e))
return final_json
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment