Skip to content

feat(csi-1953): optimize post/put quotes handling#444

Open
geka-evk wants to merge 8 commits intomainfrom
feat/csi-1953
Open

feat(csi-1953): optimize post/put quotes handling#444
geka-evk wants to merge 8 commits intomainfrom
feat/csi-1953

Conversation

@geka-evk
Copy link
Copy Markdown
Contributor

@geka-evk geka-evk commented Jan 9, 2026

No description provided.

Copy link
Copy Markdown
Contributor

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 pull request optimizes quote handling in the POST/PUT operations by parallelizing database operations and improving logging efficiency.

Key Changes:

  • Parallelized multiple database operations using Promise.all to improve performance in quote creation and update flows
  • Replaced JSON.stringify with Util.getCircularReplacer() calls with the fast-safe-stringify library for safer and more efficient serialization
  • Extracted quote creation logic into a private method #createQuoteInDb for better code organization

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/model/quotes.js Optimized database operations with Promise.all and created private method for quote creation; replaced circular-safe JSON.stringify with fast-safe-stringify
src/model/fxQuotes.js Replaced JSON.stringify with circular replacer calls with fast-safe-stringify
src/model/bulkQuotes.js Replaced JSON.stringify with circular replacer calls with fast-safe-stringify
src/lib/util.js Updated calculateRequestHash to use fast-safe-stringify
src/handlers/QuotingHandler.js Improved logging format to use structured logging instead of JSON.stringify
src/data/database.js Enhanced logging to include both quoteId and transactionReferenceId
test/unit/model/quotes.test.js Updated test data to use consistent transactionId variable; commented out two test cases and one assertion count
package-lock.json Removed "dev": true markers from development dependencies (unintended change)

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

Comment thread test/unit/model/quotes.test.js Outdated
Comment thread test/unit/model/quotes.test.js Outdated
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants