Crud response enhancement#137
Merged
Merged
Conversation
81e5962 to
deaac5c
Compare
jagan-jaya
previously approved these changes
Aug 14, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances API response structures across multiple endpoints to provide more comprehensive and structured responses. It replaces plain string responses with structured JSON objects containing merchant IDs, configuration data, and descriptive messages, improving API consistency and client integration.
- Adds structured response types (
RuleConfigResponse,MerchantAccountCreateResponse,UpdateScoreResponse) to replace plain string responses - Enhances type definitions with
PartialEqderives for routing configuration structs to support testing and comparisons - Improves response traceability by including merchant IDs, gateway information, and payment IDs in API responses
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/routing_configuration.rs | Adds PartialEq derives to configuration structs for equality comparisons |
| src/routes/update_score.rs | Minor import reordering and formatting cleanup |
| src/routes/update_gateway_score.rs | Enhances response with merchant ID, gateway, and payment ID for better traceability |
| src/routes/rule_configuration.rs | Adds structured RuleConfigResponse with merchant ID and config data |
| src/routes/merchant_account_config.rs | Adds MerchantAccountCreateResponse with structured merchant account information |
| src/merchant_config_util.rs | Minor import formatting cleanup |
| src/feedback/types.rs | Adds new fields to UpdateScoreResponse and reorders imports |
| src/feedback/gateway_scoring_service.rs | Minor formatting improvement in function call |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
deaac5c to
c122ef6
Compare
jagan-jaya
requested changes
Aug 20, 2025
jagan-jaya
approved these changes
Aug 20, 2025
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.
Summary:
This PR improves API response structures and enriches request/response handling across merchant account configuration, rule configuration, and gateway score update endpoints. It also enhances type definitions for routing configurations by adding
PartialEqderives for easier testing and comparisons.Changes:
src/feedback/types.rstxn_detailstype imports (minor style change).merchant_id,gateway,payment_id) toUpdateScoreResponse.src/routes/merchant_account_config.rsMerchantAccountCreateResponsestruct to provide a structured API response instead of plain strings.create_merchant_configanddelete_merchant_configto return structured responses with merchant ID and relevant metadata.src/routes/rule_configuration.rsRuleConfigResponsestruct to include merchant ID and config details in responses.create_rule_configandupdate_rule_configto return structured responses.src/routes/update_gateway_score.rsupdate_gateway_scoreto returnUpdateScoreResponsewith merchant ID, gateway, and payment ID for better traceability.src/types/routing_configuration.rsPartialEqderives to multiple config-related structs/enums (ConfigVariant,SuccessRateData,SRSubLevelInputConfig,GatewayWiseExtraScore,EliminationData,DebitRoutingData,TransactionLatencyThreshold).Screenshots: