3131
3232import logging
3333from datetime import datetime , timedelta , timezone
34- from sanitizer import sanitize_payload
34+ from backend . core . security . sanitizer import sanitize_payload
3535from reader_identity .routes import reader_identity_bp
3636
3737# Load environment variables from config directory based on APP_ENV
5151from models import db , User , Book , ShelfItem , BookNote , ReadingGoal , ReadingStats , Collection , CollectionItem , PriceHistory , PriceAlert , Review , register_user , login_user
5252from price_tracker import get_price_tracker
5353from cache_service import cache_service
54- from validators import (
54+ from backend . core . validators . validators import (
5555 validate_request ,
5656 validate_schema ,
5757 validate_google_books_id ,
9595from collections import defaultdict , deque
9696from math import ceil
9797from time import time
98- from error_responses import (
98+ from backend . core . responses . error_responses import (
9999 ErrorCodes , error_response , success_response ,
100100 validation_error , missing_fields_error , invalid_json_error ,
101101 auth_error , forbidden_error , unauthorized_access_error ,
@@ -1061,11 +1061,11 @@ def handle_analyze_mood(validated_data):
10611061@validate_schema (MoodTagsRequest )
10621062def handle_mood_tags (validated_data ):
10631063 """Get mood tags for a book."""
1064- from exceptions import (
1064+ from backend . core . exceptions . exceptions import (
10651065 LLMCircuitBreakerOpenError , AIServiceException ,
10661066 ValidationException , InvalidInputError
10671067 )
1068- from error_responses import handle_exception
1068+ from backend . core . responses . error_responses import handle_exception
10691069
10701070 try :
10711071
@@ -1092,11 +1092,11 @@ def handle_mood_tags(validated_data):
10921092@validate_schema (MoodSearchRequest )
10931093def handle_mood_search (validated_data ):
10941094 """Search for books based on mood/vibe with improved query parsing."""
1095- from exceptions import (
1095+ from backend . core . exceptions . exceptions import (
10961096 LLMCircuitBreakerOpenError , AIServiceException ,
10971097 ValidationException , InvalidInputError
10981098 )
1099- from error_responses import handle_exception
1099+ from backend . core . responses . error_responses import handle_exception
11001100
11011101 try :
11021102
@@ -1199,12 +1199,12 @@ def handle_purchase_links():
11991199@validate_schema (GenerateNoteRequest )
12001200def handle_generate_note (validated_data ):
12011201 """Generate AI-powered book recommendation with vibe support."""
1202- from exceptions import (
1202+ from backend . core . exceptions . exceptions import (
12031203 LLMCircuitBreakerOpenError , AIServiceException ,
12041204 DatabaseQueryError , DatabaseIntegrityError ,
12051205 ValidationException , InvalidInputError
12061206 )
1207- from error_responses import handle_exception
1207+ from backend . core . responses . error_responses import handle_exception
12081208
12091209 try :
12101210
@@ -1312,8 +1312,8 @@ def handle_socket_chat(data):
13121312def add_to_library (validated_data ):
13131313 """Add a book to the user's shelf."""
13141314 from sqlalchemy .exc import IntegrityError
1315- from exceptions import DatabaseQueryError , DatabaseIntegrityError , ValidationException
1316- from error_responses import handle_exception
1315+ from backend . core . exceptions . exceptions import DatabaseQueryError , DatabaseIntegrityError , ValidationException
1316+ from backend . core . responses . error_responses import handle_exception
13171317
13181318 try :
13191319
@@ -1741,8 +1741,8 @@ def register(validated_data):
17411741@validate_schema (LoginRequest )
17421742def login (validated_data ):
17431743 """Authenticate user and return JWT token."""
1744- from exceptions import DatabaseQueryError , ValidationException
1745- from error_responses import handle_exception
1744+ from backend . core . exceptions . exceptions import DatabaseQueryError , ValidationException
1745+ from backend . core . responses . error_responses import handle_exception
17461746
17471747 try :
17481748
0 commit comments