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(routing): Refactor api v2 routes for deactivating and retrieving the routing config #5478

Merged
merged 54 commits into from
Aug 5, 2024

Conversation

Aprabhat19
Copy link
Contributor

@Aprabhat19 Aprabhat19 commented Jul 30, 2024

Type of Change

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

Description

Refactor api v2 routes for deactivating and retrieving the routing config

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?

  • To deactivate the routing config
curl --location --request PATCH 'http://localhost:8080/v2/profiles/pro_VirB3AxB3qItFTnLsuA2/deactivate_routing_algorithm' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_CMjrHy1A62kEwdzCDoLWRBta6xBZalgupmamFfdKfJdMjklfCil5S1wqAZ0F4Jw5' \
--data '
'
  • To retrieve the routing config
curl --location 'http://localhost:8080/v2/routing_algorithm/routing_merchant_1722847196_EiushCG51H' \
--header 'api-key: dev_CMjrHy1A62kEwdzCDoLWRBta6xBZalgupmamFfdKfJdMjklfCil5S1wqAZ0F4Jw5'

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

Aprabhat19 and others added 30 commits July 22, 2024 13:15
Base automatically changed from api-v2-routing to main August 1, 2024 09:53
@likhinbopanna likhinbopanna dismissed jarnura’s stale review August 1, 2024 09:53

The base branch was changed.

@Aprabhat19 Aprabhat19 requested a review from a team as a code owner August 1, 2024 09:53
@Aprabhat19 Aprabhat19 requested review from jarnura and removed request for a team August 5, 2024 05:48
jarnura
jarnura previously approved these changes Aug 5, 2024
.change_context(errors::ApiErrorResponse::MissingRequiredField {
field_name: "algorithm",
})
.attach_printable("Algorithm of config not given")?;

let business_profile = core_utils::validate_and_get_business_profile(
Copy link
Member

Choose a reason for hiding this comment

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

we can have a separate function without the Option, just taking the value. Take this changes in next pull requests

RoutingAlgorithmUpdate::fetch_routing_algo(merchant_account.get_id(), &algorithm_id.0, db)
.await?;
// TODO: Move to domain types of Business Profile
core_utils::validate_and_get_business_profile(
Copy link
Member

Choose a reason for hiding this comment

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

we can have a separate function without the Option, just taking the value. Take this changes in next pull requests

Narayanbhat166
Narayanbhat166 previously approved these changes Aug 5, 2024
@Aprabhat19 Aprabhat19 linked an issue Aug 5, 2024 that may be closed by this pull request
2 tasks
@Aprabhat19 Aprabhat19 dismissed stale reviews from Narayanbhat166 and jarnura via 76d322b August 5, 2024 08:45
@pixincreate pixincreate added this pull request to the merge queue Aug 5, 2024
Merged via the queue into main with commit 3fea00c Aug 5, 2024
17 of 18 checks passed
@pixincreate pixincreate deleted the api-v2-routes branch August 5, 2024 10:21
pixincreate added a commit that referenced this pull request Aug 5, 2024
* 'main' of github.com:juspay/hyperswitch: (37 commits)
  fix(connector): Fixed status mapping for Plaid (#5525)
  feat(core): accept profile_id in merchant_account, connectors and customers core functions (#5505)
  refactor(auth): Pass `profile_id` from the auth to core functions (#5520)
  refactor(routing): Refactor api v2 routes for deactivating and retrieving the routing config (#5478)
  refactor(cypress): pass `connector_type` externally (#5522)
  refactor(router): refactor merchant_connector update v2 flow (#5484)
  feat(router): add accept language header middleware  (#5500)
  chore(version): 2024.08.05.0
  chore(postman): update Postman collection files
  fix(pm_auth): Added mca status check in pml (#5421)
  refactor(payment_methods): List the Payment Methods for Merchant , based on the connector  type (#4909)
  fix(router): [Iatapay] make error status and error message optional (#5382)
  chore(version): 2024.08.02.0
  feat(business_profile): introduce domain models for business profile v1 and v2 APIs (#5497)
  feat(auth): Add `profile_id` in `AuthenticationData` (#5492)
  feat(core): accept business profile in core functions for payments, refund, payout and disputes (#5498)
  refactor(router): domain and diesel model changes for merchant_connector_account create v2 flow (#5462)
  fix(open_payment_links): send displaySavedPaymentMethods as false explicitly for open payment links (#5501)
  refactor(role): determine level of role entity (#5488)
  feat(cypress): add corner cases (#5481)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Refactor deactivating and retrieve apis for routing v2
6 participants