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 7 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,

@@ -0,0 +1,48 @@
use error_stack::report;
// use diesel_models::call_back_mapper;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this if not required

};

#[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?

@@ -0,0 +1,8 @@
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS call_back_mapper (
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
CREATE TABLE IF NOT EXISTS call_back_mapper (
CREATE TABLE IF NOT EXISTS callback_mapper (

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