Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gsm): add error_category and error_sub_category columns to gsm table #6648

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Chethan-rao
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR adds error_category and error_sub_category columns to gsm table which is an enum in application. These could be used to take multiple decisions in future but currently these are required for elimination routing in which these categories will serve as bucket name.
Additionally it fixes the last_modified column not being updated in gsm table during /update

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Added 2 new columns to GSM tables. (error_category, error_sub_category)

curl --location 'http://localhost:8080/gsm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
  "connector": "stripe",
  "flow" : "flow1",
  "sub_flow": "sub_flow",
  "code": "incorrect_cvc",
  "status": "status1",
  "decision": "retry",
  "message": "xyz",
  "step_up_possible": false,
  "error_category": "technical_error_with_processor",
  "error_sub_category": "server_error"
}'

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Chethan-rao Chethan-rao added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels Nov 24, 2024
@Chethan-rao Chethan-rao self-assigned this Nov 24, 2024
@Chethan-rao Chethan-rao requested review from a team as code owners November 24, 2024 12:45
Copy link

semanticdiff-com bot commented Nov 24, 2024

@Chethan-rao Chethan-rao added this to the November 2024 Release milestone Nov 24, 2024
@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Nov 24, 2024
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Nov 24, 2024
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum ErrorCategory {
IssuerDecline,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have ConnectorErrorType which is used for different purpose in auto retries flow, and has the following values
UserError, BusinessError, TechnicalError, UnknownError

Should we follow the same here? @Chethan-rao
cc: @jarnura

crates/api_models/src/gsm.rs Outdated Show resolved Hide resolved
crates/diesel_models/src/gsm.rs Outdated Show resolved Hide resolved
crates/router/src/core/gsm.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: Refactor M-api-contract-changes Metadata: This PR involves API contract changes M-database-changes Metadata: This PR involves database schema changes S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] add error_category and error_sub_category columns to gsm table
2 participants