office user
This commit is contained in:
@@ -97,7 +97,7 @@ class OfficeDashboardService(BaseService):
|
||||
"value": 159999.0
|
||||
},
|
||||
"payments": {
|
||||
"currency": "Naira",
|
||||
"currency": "Dollars",
|
||||
"currency_text": "\u0024",
|
||||
"text": "this week",
|
||||
"value": 0
|
||||
@@ -217,6 +217,7 @@ class OfficeDashboardService(BaseService):
|
||||
member_sub_data.append({
|
||||
'id': subs.id,
|
||||
'member_id': subs.member_id,
|
||||
'subscription_uid': str(subs.uid),
|
||||
'product_id': subs.product_id,
|
||||
'internal_url': subs.internal_url,
|
||||
'external_url': subs.external_url,
|
||||
|
||||
@@ -41,6 +41,7 @@ class SubscriptionsService(BaseService):
|
||||
for subs in membersSubList:
|
||||
member_sub_data.append({
|
||||
'id': subs.id,
|
||||
'subscription_uid': str(subs.uid),
|
||||
'member_id': subs.member_id,
|
||||
'product_id': subs.product_id,
|
||||
'internal_url': subs.internal_url,
|
||||
|
||||
@@ -38,27 +38,30 @@ class OfficeUsers(db.Model):
|
||||
@classmethod
|
||||
def get_office_users_list(cls):
|
||||
users_list = cls.query.all()
|
||||
|
||||
if not users_list:
|
||||
raise ValueError(f"No available users")
|
||||
return users_list
|
||||
|
||||
@classmethod
|
||||
def get_office_user_id(cls, user_id):
|
||||
"""
|
||||
Get customer's active loans by loan_id.
|
||||
"""
|
||||
users_list = cls.query.filter_by(id=user_id).first()
|
||||
if not users_list:
|
||||
# raise ValueError(f"pProduct with ID {product_id} does not exist.")
|
||||
logger.error(f"users_list with ID {user_id} does not exist.")
|
||||
return None
|
||||
return users_list
|
||||
|
||||
@classmethod
|
||||
def get_office_user_by_username(cls, username):
|
||||
logger.info(f"users_list looking for {username} .")
|
||||
users_list = cls.query.filter_by(username=username).first()
|
||||
logger.info(f"users_list looking for {username} after.")
|
||||
if not users_list:
|
||||
logger.error(f"users_list with ID {user_id} does not exist.")
|
||||
return None
|
||||
return users_list
|
||||
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Convert the Loan object to a dictionary format for JSON serialization.
|
||||
"""
|
||||
return {
|
||||
'id': self.id,
|
||||
'uid': self.uid,
|
||||
|
||||
Reference in New Issue
Block a user