feat(customer_v2): add customer create v2 endpoint (#5444)

Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: Prajjwal Kumar <prajjwal.kumar@juspay.in>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-08-07 13:12:10 +05:30
committed by GitHub
parent c6a960766d
commit 52cada015e
47 changed files with 1474 additions and 160 deletions

View File

@ -1,14 +1,18 @@
#[cfg(feature = "olap")]
use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl};
use common_utils::ext_traits::Encode;
#[cfg(all(
feature = "olap",
any(feature = "v1", feature = "v2"),
not(feature = "customer_v2")
))]
use diesel::JoinOnDsl;
#[cfg(feature = "olap")]
use diesel::{associations::HasTable, ExpressionMethods, JoinOnDsl, QueryDsl};
use diesel::{associations::HasTable, ExpressionMethods, QueryDsl};
#[cfg(feature = "olap")]
use diesel_models::{
customers::Customer as DieselCustomer,
payout_attempt::PayoutAttempt as DieselPayoutAttempt,
query::generics::db_metrics,
schema::{customers::dsl as cust_dsl, payout_attempt::dsl as poa_dsl, payouts::dsl as po_dsl},
customers::Customer as DieselCustomer, query::generics::db_metrics,
schema::payouts::dsl as po_dsl,
};
use diesel_models::{
enums::MerchantStorageScheme,
@ -18,6 +22,15 @@ use diesel_models::{
PayoutsUpdate as DieselPayoutsUpdate,
},
};
#[cfg(all(
feature = "olap",
any(feature = "v1", feature = "v2"),
not(feature = "customer_v2")
))]
use diesel_models::{
payout_attempt::PayoutAttempt as DieselPayoutAttempt,
schema::{customers::dsl as cust_dsl, payout_attempt::dsl as poa_dsl},
};
use error_stack::ResultExt;
#[cfg(feature = "olap")]
use hyperswitch_domain_models::payouts::PayoutFetchConstraints;
@ -517,7 +530,11 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
})
}
#[cfg(feature = "olap")]
#[cfg(all(
any(feature = "v1", feature = "v2"),
feature = "olap",
not(feature = "customer_v2")
))]
#[instrument(skip_all)]
async fn filter_payouts_and_attempts(
&self,
@ -651,6 +668,18 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
})
}
#[cfg(feature = "olap")]
#[cfg(all(feature = "v2", feature = "customer_v2"))]
#[instrument(skip_all)]
async fn filter_payouts_and_attempts(
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_filters: &PayoutFetchConstraints,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<(Payouts, PayoutAttempt, DieselCustomer)>, StorageError> {
todo!()
}
#[cfg(feature = "olap")]
#[instrument(skip_all)]
async fn filter_payouts_by_time_range_constraints(