Member Action
This commit is contained in:
+42
-13
@@ -7,7 +7,7 @@ from marshmallow import ValidationError
|
||||
from app.api.enums import TransactionType
|
||||
from app.api.integrations import SimbrellaIntegration
|
||||
from app.extensions import db
|
||||
from app.models import Offer, RACCheck, Members
|
||||
from app.models import Offer, RACCheck, Members, MembersActions
|
||||
from app.api.services.offer_analysis import OfferAnalysis
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
@@ -40,20 +40,49 @@ class AccountService(BaseService):
|
||||
|
||||
@staticmethod
|
||||
def process_action_request(data):
|
||||
bar_data = {
|
||||
|
||||
member_actions = MembersActions.get_recent_member_actions(data)
|
||||
member_actions_data = []
|
||||
|
||||
for t in member_actions:
|
||||
product_data.append({
|
||||
'id': t.id,
|
||||
'uid': t.uid,
|
||||
'product_id': t.product_id,
|
||||
'name': t.name,
|
||||
'description': t.description,
|
||||
'status': t.status,
|
||||
'added': t.added,
|
||||
'updated': t.updated,
|
||||
'banner': t.banner
|
||||
})
|
||||
|
||||
action_data = {
|
||||
"recent_actions": member_actions_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'},
|
||||
]
|
||||
"initial": random.randint(0, 10),
|
||||
"processing": random.randint(0, 10),
|
||||
"verifying": random.randint(0, 10),
|
||||
"completed": random.randint(0, 10),
|
||||
"actions": member_actions_data
|
||||
}
|
||||
return ResponseHelper.success(data=bar_data)
|
||||
|
||||
logger.info(f"Member Actions Error: {action_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=action_data)
|
||||
|
||||
@staticmethod
|
||||
def process_request(data):
|
||||
|
||||
Reference in New Issue
Block a user