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(core): diesel models and db interface changes for call_back_mapper table #6571

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

Conversation

prasunna09
Copy link
Contributor

@prasunna09 prasunna09 commented Nov 14, 2024

Type of Change

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

Description

Created call_back_mapper table and implemented interface for DB operations.
this is added for network tokenization webhooks feature. Since this is generic, any kind of data (excluding sensitive info) can be stored.

db changes -
Screenshot 2024-11-14 at 4 51 02 PM

Network tokenization webhook feature use case - no merchant id is passed from token requestor, so network_token_requestor_ref_id is stored in this table along with merchant_id

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?

This PR is only meant for creating new call_back_mapper table and doesn't interfere with any existing flows.

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

@prasunna09 prasunna09 added the C-feature Category: Feature request or enhancement label Nov 14, 2024
@prasunna09 prasunna09 added this to the November 2024 Release milestone Nov 14, 2024
@prasunna09 prasunna09 self-assigned this Nov 14, 2024
@prasunna09 prasunna09 requested review from a team as code owners November 14, 2024 11:26
Copy link

semanticdiff-com bot commented Nov 14, 2024

@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Nov 14, 2024
jarnura
jarnura previously approved these changes Nov 14, 2024
pub id: String,
#[serde(rename = "type")]
pub type_: String,
pub data: serde_json::Value,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub data: serde_json::Value,
pub data: pii::SecretSerdeValue,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if there is no sensitive value, is this still needed? Also this table should be used for storing HS entity reference

crates/router/src/db/call_back_mapper.rs Outdated Show resolved Hide resolved
};

#[async_trait::async_trait]
pub trait CallBackMapperInterface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please move the trait CallBackMapperInterface to hyperswitch_domain_models and have the domain models defined for CallBackMapper?

Copy link
Contributor Author

@prasunna09 prasunna09 Nov 15, 2024

Choose a reason for hiding this comment

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

this is a db interface, could you please tell me why db interface needs to be moved to domain model?

ps. checked all other db interface, no interface lies in domain model. please let me know If I m missing something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants