Skip to content

updating guest creation and check endpoint for adding dob#222

Draft
vendz wants to merge 1 commit into
mainfrom
feat/add-guest-dob
Draft

updating guest creation and check endpoint for adding dob#222
vendz wants to merge 1 commit into
mainfrom
feat/add-guest-dob

Conversation

@vendz
Copy link
Copy Markdown
Member

@vendz vendz commented Nov 15, 2025

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @vendz, 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 significant improvements to the guest booking and management system. It ensures data completeness by making the date of birth a mandatory field during guest creation and enhances the guest lookup functionality to provide more detailed information, including the guest's type and date of birth. The underlying guest creation logic has been refactored to support seamless updates for existing guests, alongside minor code formatting and dependency metadata adjustments.

Highlights

  • Mandatory DOB for Guest Creation: The createGuests API now enforces that dob (date of birth) is a required field, along with name, gender, mobno, and type, for each guest being created. Missing fields will result in a 400 ApiError.
  • Enhanced Guest Check Endpoint: The checkGuests endpoint has been updated to return the dob of a guest and also includes their type by querying the GuestRelationship model, providing more comprehensive guest information.
  • Improved Guest Data Management: The createGuestsHelper function now intelligently handles both new and existing guests. It creates new entries for unregistered guests and updates the details (including dob and guest_type) for already registered guests in the CardDb.
  • Dependency Metadata Cleanup: The package-lock.json file has been updated to remove numerous peer: true flags from various AWS SDK and other package dependencies, streamlining dependency resolution metadata.
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 updates the guest creation and checking endpoints to include the date of birth (dob). The changes look good overall. I've identified a performance issue in checkGuests where an extra database query is made, and I've suggested a refactor to use a single query with an include. I also found a minor issue in createGuestsHelper where the returned array contains mixed data types, and I've provided a suggestion to make it consistent.

Comment thread controllers/helper.js
Comment on lines +683 to +686
const allGuests = [
...guestsToUpdate.map((g) => ({ ...g })),
...createdGuests
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The allGuests array is constructed with a mix of plain JavaScript objects from guestsToUpdate and Sequelize model instances from createdGuests. This can lead to inconsistent data structures in the API response. It's better to convert Sequelize instances to plain objects before returning them. Also, the expression ...guestsToUpdate.map((g) => ({ ...g })) is unnecessarily complex and can be simplified.

Suggested change
const allGuests = [
...guestsToUpdate.map((g) => ({ ...g })),
...createdGuests
];
const allGuests = [
...guestsToUpdate,
...createdGuests.map((g) => g.toJSON())
];

const msg = missing
.map((m) => `Guest ${m.index + 1} has missing [${m.fields.join(', ')}]`)
.join('; ');
throw new ApiError(400, msg);
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.

so in frontend we are making dob as required field right? This is thrown only when they don't enter dob

Comment thread package-lock.json
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.

diid you wnated to checkin this?

@vendz vendz marked this pull request as draft December 3, 2025 05:53
Base automatically changed from dev to main April 14, 2026 16:40
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.

3 participants