Skip to content

Standardize child passenger indicator to isChild#685

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/sort-child-indication-logic
Draft

Standardize child passenger indicator to isChild#685
Copilot wants to merge 2 commits intomasterfrom
copilot/sort-child-indication-logic

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 12, 2026

Two different property names were used interchangeably to flag a child passenger — child (marked // quickfix) in the search/price path and isChild in the booking path — making the data model inconsistent and error-prone.

Changes

  • convert-passengers-object-to-array.js — rename childisChild, drop the // quickfix comment
  • Handlebars templates (AIR_AVAILABILTIY_REQUEST, AIR_LOW_FARE_SEARCH_REQUEST, AIR_PRICE_REQ) — update conditionals from {{#if child}}{{#if isChild}}
  • convert-passengers-object-to-array.test.js — update assertions to match

Before:

// convert-passengers-object-to-array.js
list.push({ ageCategory, child: (ageCategory === 'CNN') }); // quickfix

// add-meta-passengers-booking.js
item.isChild = true;

After:

// both paths now use the same property
list.push({ ageCategory, isChild: (ageCategory === 'CNN') });
item.isChild = true;
Original prompt

This section details on the original issue you should resolve

<issue_title>Which way to indicate child? isChild or child?</issue_title>
<issue_description>There's two way to indicate a passenger is a children,

in Air/Services/transformer/add-meta-passengers-booking.js

      item.isChild = true;

in Air/Services/transformer/convert-passengers-object-to-array.js

          child: (ageCategory === 'CNN'), // quickfix

This makes really confusing, to them or to implement other features. Can you sort them out? </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Smotrov <7815789+Smotrov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inconsistent child indication in passenger booking Standardize child passenger indicator to isChild Mar 12, 2026
@Smotrov Smotrov requested a review from Copilot March 12, 2026 09:44
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

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 standardizes the Air passenger “child” indicator to a single boolean property name (isChild) across the search/price request-building path and the booking path, removing the prior inconsistency (child vs isChild) that could lead to mismatched template behavior.

Changes:

  • Updated convert-passengers-object-to-array transformer to emit isChild instead of child.
  • Updated Air request Handlebars templates to check {{#if isChild}} instead of {{#if child}}.
  • Updated the transformer unit test assertions to align with the new property name.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Air/transformers/convert-passengers-object-to-array.test.js Aligns test expectations with the standardized isChild flag.
src/Services/Air/transformers/convert-passengers-object-to-array.js Emits isChild for CNN passengers to standardize the passenger model.
src/Services/Air/templates/AIR_PRICE_REQ.handlebars.js Uses isChild for child-age conditional rendering in pricing requests.
src/Services/Air/templates/AIR_LOW_FARE_SEARCH_REQUEST.handlebars.js Uses isChild for child-age conditional rendering in low-fare search requests.
src/Services/Air/templates/AIR_AVAILABILTIY_REQUEST.handlebars.js Uses isChild for child-age conditional rendering in availability requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Smotrov Smotrov requested a review from dchertousov March 12, 2026 09:50
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.

Which way to indicate child? isChild or child?

3 participants