From 884ccda7323309310a75577094da36501ab8bf75 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 23 Sep 2025 13:25:23 -0400 Subject: [PATCH] backend data --- app/api/services/office_dashboard.py | 38 ++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/app/api/services/office_dashboard.py b/app/api/services/office_dashboard.py index 83d3685..86bfcb5 100644 --- a/app/api/services/office_dashboard.py +++ b/app/api/services/office_dashboard.py @@ -210,11 +210,45 @@ class OfficeDashboardService(BaseService): # "profile_completed": account_result.profile_completed, # "next_billing": account_result.next_billing, + membersSubList = MembersProducts.get_member_productlist_by_member_id(account_result.id) + member_sub_data = [] + if membersSubList: + for subs in membersSubList: + member_sub_data.append({ + 'id': subs.id, + 'member_id': subs.member_id, + 'product_id': subs.product_id, + 'internal_url': subs.internal_url, + 'external_url': subs.external_url, + 'dns_group': subs.dns_group, + 'status': subs.status, + 'updated': subs.updated, + "added": subs.added, + }) + + + member_payments = Payments.get_member_payments_by_member_id(account_result.id) + + member_payments_data = [] + + for t in member_payments: + member_payments_data.append({ + 'id': t.id, + 'uid': t.uid, + 'option_name': t.option_name, + 'option_type': t.option_type, + 'payment_uid': t.payment_uid, + 'amount': round(t.amount * 0.01, 2), + 'status': t.status, + 'added': t.added + }) + + account_result = { "account": account_data, "account_profile": {}, - "subscriptions": {}, - "payments": {} + "subscriptions": member_sub_data, + "payments": member_payments_data } logger.info('RETURN API::get office account view') logger.info(account_result)