Conversation
naaz-josh
commented
Sep 10, 2025
- Added api's endpoints : /api/crm-leads, /api/crm-leads/simple[id]
- Added UI for CRM listing and details along with navigations
- Memozing components, optimized callbacks and lazy loading
There was a problem hiding this comment.
Pull Request Overview
This PR implements CRM functionality by adding API endpoints for managing leads, creating comprehensive UI components for CRM listing and details views, and integrating CRM data collection with the existing transcription workflow.
- Adds new API endpoints
/api/crm-leadsand/api/crm-leads/simple/[id]for retrieving CRM lead data - Creates dedicated CRM UI pages with listing, detail views, and navigation integration
- Integrates CRM lead creation with audio transcription workflow using contact extraction
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| service/main.py | Adds CRM integration to upload endpoints, contact extraction, and lead creation |
| service/summarizer.py | Removes empty line formatting |
| service/crm_client.py | Removes empty line formatting |
| service/config.py | Removes empty line formatting |
| app/src/types/crm.ts | Defines TypeScript interfaces for CRM data structures |
| app/src/types/TranscriptionResponse.ts | Extends response type with CRM-related fields |
| app/src/lib/crm-api.ts | Implements CRM API client with methods for lead management |
| app/src/db/schema.ts | Adds CRM leads database table schema |
| app/src/constants/crm.ts | Defines CRM-related constants and messages |
| app/src/components/*.tsx | Implements CRM UI components with memoization and lazy loading |
| app/src/app/crm/* | Creates CRM page routes and detail views |
| app/src/app/api/crm-leads/* | Implements CRM API endpoints for data retrieval |
| app/migrations/* | Database migration files for CRM tables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| # Update: Use the complete street information from LLM extraction | ||
| street = contact_info.get("street") | ||
| logger.info(f"{street}= streetstreetstreetstreet") |
There was a problem hiding this comment.
Debug log message contains repetitive text 'streetstreetstreetstreet' which appears to be debugging leftover. This should be cleaned up to a proper descriptive message.
| logger.info(f"{street}= streetstreetstreetstreet") | |
| logger.info(f"CRM: Using street address: {street}") |
| result = generate_timestamp_json(translation, summary, detected_language) | ||
|
|
||
|
|
||
| contact_info = extract_contact_detailed_using_ollama(translation["text"]) if "text" in translation else {"name": None, "phone": None, "address": None} |
There was a problem hiding this comment.
The contact extraction logic is duplicated between v1 and v2 endpoints. Consider extracting this into a shared function to reduce code duplication.
| result = generate_timestamp_json(translation, summary, detected_language) | ||
|
|
||
|
|
||
| contact_info = extract_contact_detailed_using_ollama(translation["text"]) if "text" in translation else {"name": None, "phone": None, "address": None} |
There was a problem hiding this comment.
The contact extraction logic is duplicated between v1 and v2 endpoints. Consider extracting this into a shared function to reduce code duplication.
| @app.post("/upload-audio") | ||
| async def upload_audio(body: Body): | ||
| try: | ||
|
|
There was a problem hiding this comment.
Empty line with no purpose. This should be removed for cleaner code.
| street = contact_info.get("street") | ||
| logger.info(f"CRM: - Street: '{street}'") | ||
|
|
||
|
|
There was a problem hiding this comment.
Multiple consecutive empty lines should be reduced to a single empty line for consistent formatting.
| # Make the API call | ||
| response = requests.post( | ||
| f"{api_base_url}/api/crm-leads", | ||
| json=crm_lead_data, | ||
| headers={"Content-Type": "application/json"} | ||
| ) |
There was a problem hiding this comment.
The variable 'crm_lead_data' is referenced but not defined in the visible scope. This will cause a NameError at runtime.
| logger.info(f"CRM lead data saved successfully for lead_id={lead_id}") | ||
| return response.json() |
There was a problem hiding this comment.
The variable 'lead_id' is referenced but not defined in the visible scope. This will cause a NameError at runtime.
| logger.info(f"CRM lead data saved successfully for lead_id={lead_id}") | |
| return response.json() | |
| response_json = response.json() | |
| lead_id = response_json.get("lead_id") | |
| logger.info(f"CRM lead data saved successfully for lead_id={lead_id}") | |
| return response_json |
|
Bito Automatic Review Skipped - Branch Excluded |