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

fix(router): merchant account delete does not delete the merchant_key_store #2367

Merged
merged 8 commits into from
Oct 3, 2023
Merged

fix(router): merchant account delete does not delete the merchant_key_store #2367

merged 8 commits into from
Oct 3, 2023

Conversation

dalprahcd
Copy link
Contributor

@dalprahcd dalprahcd commented Sep 26, 2023

Type of Change

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

Description

Closes #2154 by calling delete_merchant_key_store_by_merchant_id at merchant_account_delete

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?

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

@dalprahcd dalprahcd requested review from a team as code owners September 26, 2023 05:34
crates/router/src/db/merchant_key_store.rs Outdated Show resolved Hide resolved
crates/router/src/core/admin.rs Outdated Show resolved Hide resolved
@SanchithHegde SanchithHegde added A-core Area: Core flows C-bug Category: Bug S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Sep 26, 2023
.delete_merchant_key_store_by_merchant_id(&merchant_id)
.await
.to_not_found_response(errors::ApiErrorResponse::MerchantAccountNotFound)?;
is_deleted = is_merchant_account_deleted && is_merchant_key_store_deleted;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I realised that this could be simplified to is_deleted = is_merchant_key_store_deleted;, but I prefer to leave explicit that is_deleted depends on both.

Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Thanks for the PR, @dalprahcd!

@SanchithHegde SanchithHegde added this pull request to the merge queue Oct 3, 2023
@SanchithHegde SanchithHegde removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 3, 2023
Merged via the queue into juspay:main with commit 35f7ce0 Oct 3, 2023
9 of 10 checks passed
@dalprahcd dalprahcd deleted the fix_delete_merchant_key_store branch October 3, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] merchant account delete does not delete the merchant_key_store
4 participants