Skip to content

Feat/whatsapp integration#213

Open
vvshk wants to merge 6 commits into
mainfrom
feat/whatsapp-integration
Open

Feat/whatsapp integration#213
vvshk wants to merge 6 commits into
mainfrom
feat/whatsapp-integration

Conversation

@vvshk
Copy link
Copy Markdown
Collaborator

@vvshk vvshk commented Oct 16, 2025

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @vvshk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement by integrating WhatsApp notifications into the Utsav booking management system. The core change involves modifying the createUtsavBookingByAdmin controller to dispatch templated WhatsApp messages to users after their bookings are successfully processed and committed to the database. This feature aims to improve communication with users by providing timely updates via a widely used messaging platform, while also ensuring the robustness of the booking process by handling notification failures gracefully.

Highlights

  • WhatsApp Integration: Implemented functionality to send WhatsApp notifications to mumukshus upon successful Utsav booking.
  • Robust Notification Handling: Refactored notification sending (email and new WhatsApp) to occur after the database transaction commits, with individual error handling for each notification type to prevent booking failures due to notification issues.
  • Dedicated WhatsApp Utility: Introduced a new utility function sendWhatsAppMessage for sending templated WhatsApp messages, configurable via environment variables.
  • WhatsApp Test Script: Added a standalone script test-whatsapp.js to facilitate testing and verification of the WhatsApp integration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces WhatsApp integration for sending notifications upon Utsav booking creation by an admin. While the feature is a valuable addition, the current implementation has several critical and high-severity issues that need to be addressed. These include a security vulnerability due to a hardcoded phone number in a test file, a critical error handling bug where exceptions are swallowed, significant performance problems from N+1 database queries in a loop, and maintainability issues with hardcoded values. I have provided specific comments and suggestions to resolve these problems.

Comment thread test-whatsapp.js
Comment thread utils/sendWhatsAppMessage.js
Comment thread controllers/admin/utsavManagement.controller.js
Comment thread controllers/admin/utsavManagement.controller.js
Comment thread controllers/admin/utsavManagement.controller.js Outdated
Comment thread utils/sendWhatsAppMessage.js
Comment thread controllers/helper.js Outdated

}

async function sendUnifiedWhatsApp(cardno, bookedBy, bookingStatus = null, bookingIds) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to modify this.. We can implement Factory pattern based on user preference , we select which kind communication they want . we have a helper method which prepares the data & then select the communicationhelper.

Comment thread controllers/helper.js Outdated

}

async function sendUnifiedWhatsApp(cardno, bookedBy, bookingStatus = null, bookingIds) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to modify this.. We can implement Factory pattern based on user preference , we select which kind communication they want . we have a helper method which prepares the data & then select the communicationhelper.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this method into it's own whatsapp.helper.js

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't have to pass bookingids.. pass actual objects as they are already loaded withh all details...roomBookingDetails,
adhyanBookingDetails,
travelBookingDetails,
flatBookingDetails,
utsavBookingDetails

Comment thread controllers/helper.js Outdated
}


async function sendAdhyayanWhatsApp(user, bookingStatus, bookingIds) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to whatsapp.helper.js

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