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

feat(api_event_errors): error field in APIEvents #2808

Merged
merged 29 commits into from
Nov 22, 2023

Conversation

ivor11
Copy link
Contributor

@ivor11 ivor11 commented Nov 8, 2023

Type of Change

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

Description

Addition of error field to APIEvent struct

Additional Changes

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

Motivation and Context

Addition of error field to APIEvent struct to log output errors

How did you test it?

run below API twice
2nd request APIEvent response should contain error field with below error
"error\":{\"type\":\"BadRequest\",\"value\":{\"sub_code\":\"HE\",\"error_identifier\":1,\"error_message\":\"The merchant account with the specified details already exists in our records\",\"extra\":null}}

curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "ivor_merchant", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "[email protected]", "primary_phone": "sunt laborum", "secondary_contact_person": "John Test2", "secondary_email": "[email protected]", "secondary_phone": "cillum do dolor id", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://google.com/success", "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "routing_algorithm": { "type": "single", "data": "stripe" }, "sub_merchants_enabled": false, "metadata": { "city": "NY", "unit": "245" } }'

grafana link to test

https://grafana.staging.eu.juspay.net/explore?orgId=1&left=%7B%22datasource%22:%22x5WTfCG4k%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bapp%3D%5C%22bach%5C%22%7D%20%7C%3D%20%60ivor_merchant%60%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22x5WTfCG4k%22%7D,%22editorMode%22:%22builder%22%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D

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
  • I added a CHANGELOG entry if applicable

@ivor11 ivor11 self-assigned this Nov 8, 2023
@ivor11 ivor11 changed the title feat(feat/api_event_errors): init APIEvent struct feat(feat/api_event_errors): error field in APIEvents Nov 10, 2023
@ivor11 ivor11 marked this pull request as ready for review November 10, 2023 07:07
@ivor11 ivor11 requested a review from a team as a code owner November 10, 2023 07:07
@ivor11 ivor11 added the Rust Pull requests that update Rust code label Nov 10, 2023
@lsampras lsampras added A-framework Area: Framework C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 10, 2023
@ivor11
Copy link
Contributor Author

ivor11 commented Nov 16, 2023

Screenshot 2023-11-17 at 12 06 22 AM

crates/router/src/analytics/core.rs Outdated Show resolved Hide resolved
crates/router/src/services/api.rs Outdated Show resolved Hide resolved
@ivor11 ivor11 requested a review from a team as a code owner November 17, 2023 09:13
@ivor11 ivor11 requested a review from lsampras November 17, 2023 18:14
@ivor11 ivor11 added S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Nov 19, 2023
Copy link
Contributor

@lsampras lsampras left a comment

Choose a reason for hiding this comment

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

LGTM...

@ivor11 ivor11 changed the title feat(feat/api_event_errors): error field in APIEvents feat(api_event_errors): error field in APIEvents Nov 20, 2023
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit ce10579 Nov 22, 2023
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the feat/api_event_errors branch November 22, 2023 07:44
@SanchithHegde SanchithHegde removed the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Area: Framework C-feature Category: Feature request or enhancement Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants