Bing Analytics and Insights added, background jobs added, database setup updated, environment setup updated, frontend updated, backend updated.

Onboarding Manager and Router Manager refactored, analytics and background jobs added, database setup updated, environment setup updated, frontend updated, backend updated.
Critical onboarding database migration implemented.
This commit is contained in:
ajaysi
2025-10-18 10:28:15 +05:30
parent 40fb6ac95b
commit 1f087aad4c
69 changed files with 11995 additions and 189 deletions

View File

@@ -13,7 +13,7 @@ class BusinessInfoService:
def __init__(self):
pass
async def save_business_info(self, business_info: 'BusinessInfoRequest') -> Dict[str, Any]:
async def save_business_info(self, business_info: dict) -> Dict[str, Any]:
"""Save business information for users without websites."""
try:
from models.business_info_request import BusinessInfoRequest
@@ -65,7 +65,7 @@ class BusinessInfoService:
logger.error(f"❌ Error getting business info: {str(e)}")
raise HTTPException(status_code=500, detail=f"Failed to get business info: {str(e)}")
async def update_business_info(self, business_info_id: int, business_info: 'BusinessInfoRequest') -> Dict[str, Any]:
async def update_business_info(self, business_info_id: int, business_info: dict) -> Dict[str, Any]:
"""Update business information."""
try:
from models.business_info_request import BusinessInfoRequest

View File

@@ -182,7 +182,7 @@ async def get_user_writing_personas(user_id: int = 1):
raise HTTPException(status_code=500, detail="Internal server error")
async def save_business_info(business_info: 'BusinessInfoRequest'):
async def save_business_info(business_info: dict):
try:
from api.onboarding_utils.business_info_service import BusinessInfoService
business_service = BusinessInfoService()
@@ -212,7 +212,7 @@ async def get_business_info_by_user(user_id: int):
raise HTTPException(status_code=500, detail=f"Failed to get business info: {str(e)}")
async def update_business_info(business_info_id: int, business_info: 'BusinessInfoRequest'):
async def update_business_info(business_info_id: int, business_info: dict):
try:
from api.onboarding_utils.business_info_service import BusinessInfoService
business_service = BusinessInfoService()

View File

@@ -112,6 +112,18 @@ class OnboardingSummaryService:
logger.error(f"Error getting website analysis: {str(e)}")
return None
async def get_website_analysis_data(self) -> Dict[str, Any]:
"""Get website analysis data for API endpoint."""
try:
website_analysis = self._get_website_analysis()
return {
"website_analysis": website_analysis,
"status": "success" if website_analysis else "no_data"
}
except Exception as e:
logger.error(f"Error in get_website_analysis_data: {str(e)}")
raise e
def _get_research_preferences(self) -> Optional[Dict[str, Any]]:
"""Get research preferences from database."""
try:
@@ -169,4 +181,13 @@ class OnboardingSummaryService:
"content_optimization": website_analysis is not None and research_preferences is not None
}
return capabilities
return capabilities
async def get_research_preferences_data(self) -> Dict[str, Any]:
"""Get research preferences data for the user."""
try:
research_prefs_service = ResearchPreferencesService()
return await research_prefs_service.get_research_preferences(self.user_id)
except Exception as e:
logger.error(f"Error getting research preferences data: {e}")
raise