Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors field names across multiple data structures from camelCase to snake_case to follow Rust naming conventions. The changes include:
- Converting struct field names in core domain types (Order, TxnDetail, TxnCardInfo, TxnOfferDetail, DomainDeciderRequest)
- Adding
#[serde(rename_all = "camelCase")]attributes to maintain JSON serialization compatibility - Updating all references throughout the codebase to use the new snake_case field names
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/types/txn_offer_detail.rs | Renamed 8 fields in TxnOfferDetail struct to snake_case |
| src/types/txn_details/types.rs | Converted TxnDetail struct fields and removed individual serde rename attributes in favor of struct-level camelCase conversion |
| src/types/order.rs | Updated Order struct with snake_case fields and added serde rename_all attribute |
| src/types/card/txn_card_info.rs | Renamed TxnCardInfo fields and updated conversion function |
| src/routes/decision_gateway.rs | Updated field references in decision gateway route handler |
| src/feedback/utils.rs | Updated field references in transaction detail creation utilities |
| src/feedback/gateway_selection_scoring_v3/flow.rs | Updated field references in SR v3 scoring logic |
| src/feedback/gateway_scoring_service.rs | Updated field references throughout gateway scoring service |
| src/feedback/gateway_elimination_scoring/flow.rs | Updated field references in elimination scoring flow |
| src/decider/storage/utils/txn_card_info.rs | Updated field references in storage utility |
| src/decider/storage/utils/merchant_gateway_card_info.rs | Updated field references in payment method filtering |
| src/decider/gatewaydecider/validators.rs | Updated field references in API type parsing functions |
| src/decider/gatewaydecider/utils.rs | Updated extensive field references throughout gateway decider utilities |
| src/decider/gatewaydecider/types.rs | Renamed DomainDeciderRequest fields and updated construction logic |
| src/decider/gatewaydecider/runner.rs | Updated field references in decider runner logic |
| src/decider/gatewaydecider/gw_scoring.rs | Updated field references throughout gateway scoring logic |
| src/decider/gatewaydecider/gw_filter.rs | Updated field references in gateway filtering logic |
| src/decider/gatewaydecider/flows.rs | Updated field references in decider flow orchestration |
| src/decider/gatewaydecider/flow_new.rs | Updated field references in new flow implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request standardizes the naming conventions for struct fields and variables in the gateway decider flow code, moving from camelCase to snake_case across multiple functions and files. This improves code readability and consistency, and reduces the risk of errors due to inconsistent naming.
The most important changes are:
Field and Variable Naming Standardization:
txnCardInfo,cardToken,merchantAccount) to snake_case (e.g.,txn_card_info,card_token,merchant_account) in thedecider_full_payload_hs_functionandrun_decider_flowfunctions in bothflow_new.rsandflows.rs. This affects function parameters, struct initializations, and method calls. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28]Logging and Debug Statements:
Comments and Documentation:
Functionality Preservation:
These changes collectively make the codebase more idiomatic to Rust and easier to maintain.