custom data

This commit is contained in:
CHIEFSOFT\ameye
2025-09-28 15:29:06 -04:00
parent 0119f70100
commit 53e2171e0b
3 changed files with 23 additions and 10 deletions
+1
View File
@@ -336,6 +336,7 @@ ALTER TABLE members_products ADD provision_status INT DEFAULT 0;
ALTER TABLE members_products ADD p_file INT DEFAULT 0;
ALTER TABLE members_products ADD url_status INT DEFAULT 0;
ALTER TABLE members_products ADD product_template VARCHAR(100);
ALTER TABLE members_products ADD custom_template VARCHAR(100);
-- INSERT INTO merms_products (name,description,status,product_id, banner) VALUES ('Personal Website','Your personal professional web presence',1,'A000001', 'banner.jpg');
-- INSERT INTO merms_products (name,description,status,product_id, banner) VALUES ('Professional Website','Your healthcare practice online presence ',1,'A000002', 'banner.jpg');
+20 -9
View File
@@ -6,7 +6,7 @@ from app.api.services.base_service import BaseService
from sqlalchemy import func, desc
from datetime import datetime, timedelta, timezone
from app.extensions import db
from app.models import MembersProducts, Products, Payments, Members, CustomTemplates, ProductsTemplates
from app.models import MembersProducts, Products, Payments, Members, CustomTemplates, ProductsTemplates, MembersProfile
class OfficeDashboardService(BaseService):
@@ -207,7 +207,9 @@ class OfficeDashboardService(BaseService):
"trial_end": account_result.trial_end,
}
# "profile_completed": account_result.profile_completed,
member_id = account_result.id
logger.info(f"member_id :: member_uid: {member_id} :: {member_uid} ")
# "profile_comp leted": account_result.profile_completed,
# "next_billing": account_result.next_billing,
membersSubList = MembersProducts.get_member_productlist_by_member_id(account_result.id)
@@ -223,11 +225,12 @@ class OfficeDashboardService(BaseService):
'external_url': subs.external_url,
'dns_group': subs.dns_group,
'status': subs.status,
'product_template': subs.product_template,
'custom_template': subs.custom_template,
'updated': subs.updated,
"added": subs.added,
})
member_payments = Payments.get_member_payments_by_member_id(account_result.id)
member_payments_data = []
@@ -243,11 +246,23 @@ class OfficeDashboardService(BaseService):
'status': t.status,
'added': t.added
})
account_profile_data = []
current_profile = MembersProfile.get_member_profile_by_member_id(member_id)
if current_profile is None:
account_profile_data = []
else:
account_profile_data = {
'id': current_profile.id,
'profile_uid': current_profile.uid,
'member_id': current_profile.member_id,
'practice': current_profile.practice,
'specialization': current_profile.specialization,
'url_name': current_profile.url_name
}
account_result = {
"account": account_data,
"account_profile": {},
"account_profile": account_profile_data,
"subscriptions": member_sub_data,
"payments": member_payments_data
}
@@ -258,7 +273,3 @@ class OfficeDashboardService(BaseService):
except Exception as e:
logger.error(f"An error occurred while getting cusomer data: {str(e)}", exc_info=True)
return jsonify({"message": "Internal Server Error"}), 500
+2 -1
View File
@@ -31,7 +31,7 @@ class MembersProducts(db.Model):
added = db.Column(db.DateTime(timezone=True), server_default=func.now())
updated = db.Column(db.DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
product_template= db.Column(db.String(100), nullable=True)
custom_template = db.Column(db.String(100), nullable=True)
# name = db.Column(db.String(100), nullable=False)
# description = db.Column(db.String(250), nullable=False)
@@ -160,6 +160,7 @@ class MembersProducts(db.Model):
'status': self.status,
'added': self.added,
'product_template': self.product_template,
'custom_template': self.custom_template,
'updated': self.updated
}