Add FOP parsing for tickets: Invoice, Exchange, and Credit Card#683
Add FOP parsing for tickets: Invoice, Exchange, and Credit Card#683
Conversation
Co-authored-by: Smotrov <7815789+Smotrov@users.noreply.github.com>
|
@copilot check and fix PR comments |
…icketFromEtr Co-authored-by: Smotrov <7815789+Smotrov@users.noreply.github.com>
…esting depth Co-authored-by: Smotrov <7815789+Smotrov@users.noreply.github.com>
Fixed all SonarCloud issues in commit 934b662:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot I did updated firewall rules and now you supposed to have an access to sonarcloud.io |
… S7721 Co-authored-by: Smotrov <7815789+Smotrov@users.noreply.github.com>
Confirmed access to SonarCloud — found 1 remaining issue: rule |
There was a problem hiding this comment.
Pull request overview
This PR adds Form of Payment (FOP) parsing for tickets in the UAPI JSON library, supporting Cash, Invoice (with/without number), Credit Card, Exchange, and Mixed payment types. It also includes several SonarCloud-driven refactors.
Changes:
- Added
parseMiscFormOfPaymenthelper and updatedgetTicketFromEtrto handleMiscFormOfPaymenttypes (Invoice, Exchange, and other categories) - Refactored optional chaining for
VoidResultInfoandDivideDetailschecks, and movedtestPricingInfo/testBookinghelpers to module scope - Added test XML fixtures and unit tests for each FOP type (Invoice, Invoice with number, Credit Card, Exchange, Mixed)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Services/Air/AirParser.js |
Added parseMiscFormOfPayment function, updated FOP mapping logic, and applied optional chaining refactors |
test/Air/AirParser.test.js |
Moved testPricingInfo and testBooking to module scope; added FOP parsing test suite |
test/FakeResponses/Air/getTicket_FOP_*.xml |
New XML fixtures for Invoice, Invoice with number, Credit Card, Exchange, and Mixed FOP types |
.eslintrc |
Updated ecmaVersion to 2020 to support optional chaining syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



parseMiscFormOfPaymentto reduce cognitive complexity ingetTicketFromEtr?.forVoidResultInfo.ResultTypecheck?.forProviderReservationDetails.DivideDetailschecktestPricingInfoandtestBookingto module outer scope (S7721 — "Move function to outer scope").eslintrcwithecmaVersion: 2020to support optional chaining syntaxOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.