Feat/whatsapp integration#213
Conversation
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
|
|
||
| } | ||
|
|
||
| async function sendUnifiedWhatsApp(cardno, bookedBy, bookingStatus = null, bookingIds) { |
There was a problem hiding this comment.
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.
|
|
||
| } | ||
|
|
||
| async function sendUnifiedWhatsApp(cardno, bookedBy, bookingStatus = null, bookingIds) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Move this method into it's own whatsapp.helper.js
There was a problem hiding this comment.
doesn't have to pass bookingids.. pass actual objects as they are already loaded withh all details...roomBookingDetails,
adhyanBookingDetails,
travelBookingDetails,
flatBookingDetails,
utsavBookingDetails
| } | ||
|
|
||
|
|
||
| async function sendAdhyayanWhatsApp(user, bookingStatus, bookingIds) { |
There was a problem hiding this comment.
move this to whatsapp.helper.js
No description provided.