-
Notifications
You must be signed in to change notification settings - Fork 2
CRM Functionality #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/crm-leads
Are you sure you want to change the base?
CRM Functionality #146
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
Co-authored-by: Copilot <[email protected]>
…lingo.ai into CRM_Functionality
…ingo.ai into CRM_Functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: | ||
|
|
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line with no purpose. This should be removed for cleaner code.
| street = contact_info.get("street") | ||
| logger.info(f"CRM: - Street: '{street}'") | ||
|
|
||
|
|
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"} | ||
| ) |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |