Skip to content

Conversation

@naaz-josh
Copy link
Contributor

  • 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

@naaz-josh naaz-josh requested a review from Selectus2 September 10, 2025 09:22
@Selectus2 Selectus2 requested a review from Copilot September 10, 2025 09:38

This comment was marked as outdated.

@Selectus2 Selectus2 requested a review from Copilot September 10, 2025 10:17
Copy link

Copilot AI left a 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-leads and /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")
Copy link

Copilot AI Sep 10, 2025

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.

Suggested change
logger.info(f"{street}= streetstreetstreetstreet")
logger.info(f"CRM: Using street address: {street}")

Copilot uses AI. Check for mistakes.
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}
Copy link

Copilot AI Sep 10, 2025

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.

Copilot uses AI. Check for mistakes.
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}
Copy link

Copilot AI Sep 10, 2025

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.

Copilot uses AI. Check for mistakes.
@app.post("/upload-audio")
async def upload_audio(body: Body):
try:

Copy link

Copilot AI Sep 10, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
street = contact_info.get("street")
logger.info(f"CRM: - Street: '{street}'")


Copy link

Copilot AI Sep 10, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +263 to +268
# Make the API call
response = requests.post(
f"{api_base_url}/api/crm-leads",
json=crm_lead_data,
headers={"Content-Type": "application/json"}
)
Copy link

Copilot AI Sep 10, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +271 to +272
logger.info(f"CRM lead data saved successfully for lead_id={lead_id}")
return response.json()
Copy link

Copilot AI Sep 10, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@bito-code-review
Copy link

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants