fix: additional code quality and performance improvements
Code quality: - Remove empty except blocks with proper logging - Create shared pagination utility function - Remove duplicate UUID validation code - Fix dead code in translation.py Performance: - Fix N+1 query in followup engine (use join instead of loop) - Add eager loading for customer health scores - Create database indexes for common query patterns: - customers: (user_id, status), (user_id, last_contact_at) - payment_transactions: (user_id, created_at) - followup_logs: (user_id, customer_id) - notifications: (user_id, is_read) Configuration: - Centralize magic numbers in config.py: - Payment prices - File upload limits - Rate limiting settings - Pagination defaults - Update auth.py to use centralized rate limiting config - Update customer/product imports to use centralized upload limits - Update import_service.py to use centralized MAX_ROWS
This commit is contained in:
@@ -21,8 +21,11 @@ OPTIONAL_COLUMNS = {
|
||||
}
|
||||
|
||||
|
||||
from app.config import settings
|
||||
|
||||
|
||||
class ImportService:
|
||||
MAX_ROWS = 10000
|
||||
MAX_ROWS = settings.MAX_EXCEL_ROWS
|
||||
|
||||
@staticmethod
|
||||
def parse_xlsx(file_bytes: bytes) -> Tuple[List[Dict[str, Any]], List[str]]:
|
||||
|
||||
Reference in New Issue
Block a user