new data
This commit is contained in:
@@ -45,6 +45,8 @@ ALTER TABLE members ADD lastname VARCHAR(25);
|
|||||||
ALTER TABLE members ALTER COLUMN password TYPE VARCHAR(250);
|
ALTER TABLE members ALTER COLUMN password TYPE VARCHAR(250);
|
||||||
ALTER TABLE members ADD country VARCHAR(3);
|
ALTER TABLE members ADD country VARCHAR(3);
|
||||||
ALTER TABLE members ADD stripe_customer_id VARCHAR(100)
|
ALTER TABLE members ADD stripe_customer_id VARCHAR(100)
|
||||||
|
ALTER TABLE members ADD profile_completed timestamp without time zone DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- UPDATE members SET account_name ='This is the account name';
|
-- UPDATE members SET account_name ='This is the account name';
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ from app.api.services import (
|
|||||||
OfficeAuthService,
|
OfficeAuthService,
|
||||||
OfficeDashboardService,
|
OfficeDashboardService,
|
||||||
WebContentsService,
|
WebContentsService,
|
||||||
SubscriptionService
|
SubscriptionService,
|
||||||
|
CommonDataService
|
||||||
)
|
)
|
||||||
from app.utils.logger import logger
|
from app.utils.logger import logger
|
||||||
from app.api.middlewares import enforce_json, require_auth
|
from app.api.middlewares import enforce_json, require_auth
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ from app.api.services.office_auth import OfficeAuthService
|
|||||||
from app.api.services.office_dashboard import OfficeDashboardService
|
from app.api.services.office_dashboard import OfficeDashboardService
|
||||||
from app.api.services.web_contents import WebContentsService
|
from app.api.services.web_contents import WebContentsService
|
||||||
from app.api.services.subscription import SubscriptionService
|
from app.api.services.subscription import SubscriptionService
|
||||||
|
from app.api.services.common_data import CommonDataService
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
from flask import jsonify
|
||||||
|
from app.utils.logger import logger
|
||||||
|
from app.api.services.base_service import BaseService
|
||||||
|
from sqlalchemy import func, desc
|
||||||
|
from app.api.helpers.response_helper import ResponseHelper
|
||||||
|
from app.api.schemas.user import UserSchema
|
||||||
|
from app.models import Members
|
||||||
|
from app.extensions import db
|
||||||
|
|
||||||
|
class CommonDataService(BaseService):
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def available_practices(data):
|
||||||
|
try:
|
||||||
|
with db.session.begin():
|
||||||
|
validated_data = CommonDataService.validate_data(data, UserSchema())
|
||||||
|
token = validated_data.get('token')
|
||||||
|
uid = validated_data.get('uid')
|
||||||
|
member_data = Members.get_member_by_uid(uid)
|
||||||
|
member_id = member_data.id
|
||||||
|
|
||||||
|
available_practices_data = {
|
||||||
|
{
|
||||||
|
"type": "Physician",
|
||||||
|
"specialties": [
|
||||||
|
"General Practitioner",
|
||||||
|
"Cardiologist",
|
||||||
|
"Dermatologist",
|
||||||
|
"Pediatrician",
|
||||||
|
"Surgeon",
|
||||||
|
"Oncologist",
|
||||||
|
"Neurologist",
|
||||||
|
"Psychiatrist",
|
||||||
|
"Radiologist",
|
||||||
|
"Anesthesiologist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Nurse",
|
||||||
|
"specialties": [
|
||||||
|
"Registered Nurse (RN)",
|
||||||
|
"Nurse Practitioner (NP)",
|
||||||
|
"Licensed Practical Nurse (LPN)",
|
||||||
|
"Certified Nursing Assistant (CNA)",
|
||||||
|
"Clinical Nurse Specialist (CNS)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Dentist",
|
||||||
|
"specialties": [
|
||||||
|
"General Dentist",
|
||||||
|
"Orthodontist",
|
||||||
|
"Oral Surgeon",
|
||||||
|
"Periodontist",
|
||||||
|
"Endodontist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Pharmacist",
|
||||||
|
"specialties": [
|
||||||
|
"Retail Pharmacist",
|
||||||
|
"Hospital Pharmacist",
|
||||||
|
"Clinical Pharmacist",
|
||||||
|
"Compounding Pharmacist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Therapist",
|
||||||
|
"specialties": [
|
||||||
|
"Physical Therapist (PT)",
|
||||||
|
"Occupational Therapist (OT)",
|
||||||
|
"Speech-Language Pathologist (SLP)",
|
||||||
|
"Psychotherapist",
|
||||||
|
"Massage Therapist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Other Allied Health Professional",
|
||||||
|
"specialties": [
|
||||||
|
"Medical Assistant",
|
||||||
|
"Phlebotomist",
|
||||||
|
"Radiologic Technologist",
|
||||||
|
"Dietitian/Nutritionist",
|
||||||
|
"Optometrist",
|
||||||
|
"Chiropractor",
|
||||||
|
"Podiatrist",
|
||||||
|
"Medical Laboratory Scientist"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseHelper.success(data=available_practices_data)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||||
|
return jsonify({"message": "Internal Server Error"}), 500
|
||||||
|
|
||||||
|
|
||||||
@@ -245,6 +245,7 @@ class LoginService(BaseService):
|
|||||||
"firstname":member.firstname,
|
"firstname":member.firstname,
|
||||||
"lastname": member.lastname,
|
"lastname": member.lastname,
|
||||||
"room": member.uid,
|
"room": member.uid,
|
||||||
|
"profile_completed": member.profile_completed,
|
||||||
"token": user_token
|
"token": user_token
|
||||||
}
|
}
|
||||||
padded_member_id = str(member.id).zfill(6)
|
padded_member_id = str(member.id).zfill(6)
|
||||||
|
|||||||
@@ -21,22 +21,34 @@ class SubscriptionService(BaseService):
|
|||||||
|
|
||||||
subscription_products_data = {
|
subscription_products_data = {
|
||||||
"current_product": {
|
"current_product": {
|
||||||
"display_name": "Current Subscriptions",
|
"display_name": "Subscriptions",
|
||||||
|
"subs":[
|
||||||
|
'Post Jobs',
|
||||||
|
'advanced instructors search',
|
||||||
|
'invite candidates',
|
||||||
|
'post events',
|
||||||
|
'Cancel anythime'
|
||||||
|
],
|
||||||
|
"next_payment":'2025-10-15 11:00:07.47214'
|
||||||
|
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"starter":{
|
"starter":{
|
||||||
|
"package_uid" : "cd2c0a4d-9ad4-472e-96f5-28d10c06916f",
|
||||||
"display_name" : "Starter",
|
"display_name" : "Starter",
|
||||||
"monthly" : 5.99,
|
"monthly" : 5.99,
|
||||||
"items" : ['Post Jobs','advanced instructors search','invite candidates','post events',
|
"items" : ['Post Jobs','advanced instructors search','invite candidates','post events',
|
||||||
'Cancel anythime']
|
'Cancel anythime']
|
||||||
},
|
},
|
||||||
"basic": {
|
"basic": {
|
||||||
|
"package_uid": "ef2ffa1c-9272-42cd-9d33-0e614047b4f8",
|
||||||
"display_name": "Basic",
|
"display_name": "Basic",
|
||||||
"monthly": 12.99,
|
"monthly": 12.99,
|
||||||
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
||||||
'Cancel anythime']
|
'Cancel anythime']
|
||||||
},
|
},
|
||||||
"premium": {
|
"premium": {
|
||||||
|
"package_uid": "64bf48f6-1e7f-402e-8ff0-76f4ce0f2055",
|
||||||
"display_name": "Premium",
|
"display_name": "Premium",
|
||||||
"monthly": 20.99,
|
"monthly": 20.99,
|
||||||
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
"items": ['Post Jobs', 'advanced instructors search', 'invite candidates', 'post events',
|
||||||
@@ -52,3 +64,7 @@ class SubscriptionService(BaseService):
|
|||||||
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||||
return jsonify({"message": "Internal Server Error"}), 500
|
return jsonify({"message": "Internal Server Error"}), 500
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
@@ -21,11 +21,13 @@ class Members(db.Model):
|
|||||||
firstname = db.Column(db.String(25), nullable=False)
|
firstname = db.Column(db.String(25), nullable=False)
|
||||||
lastname = db.Column(db.String(100), nullable=True)
|
lastname = db.Column(db.String(100), nullable=True)
|
||||||
country = db.Column(db.String(3), nullable=True)
|
country = db.Column(db.String(3), nullable=True)
|
||||||
|
profile_completed = db.Column(db.DateTime(timezone=False))
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
return {
|
return {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"uid": str(self.uid),
|
"uid": str(self.uid),
|
||||||
|
"profile_completed": self.profile_completed,
|
||||||
"username": self.account_id,
|
"username": self.account_id,
|
||||||
"account_id": self.username,
|
"account_id": self.username,
|
||||||
"password": self.password,
|
"password": self.password,
|
||||||
|
|||||||
Reference in New Issue
Block a user