Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
8943cf5
feature: add feature flagged domain model and diesel model
Narayanbhat166 Jul 12, 2024
8a5e771
refactor: change order of mirations
Narayanbhat166 Jul 15, 2024
311b59d
chore: create justfile for running commands for v1 and v2 migrations
hrithikesh026 Jul 15, 2024
ab327cd
add support for extra params in migration
hrithikesh026 Jul 15, 2024
fd9dd8e
refactor: add feature flag and make code compile
Narayanbhat166 Jul 16, 2024
e8aa634
Merge branch 'main' into change_mercant_account_domain_model_v2
Narayanbhat166 Jul 17, 2024
df9939e
chore: merge fixes
Narayanbhat166 Jul 17, 2024
0488e98
chore: cargo fmt
Narayanbhat166 Jul 17, 2024
03e43ef
chore: cargo c with merchant_account_v2 feature
Narayanbhat166 Jul 17, 2024
0ac1bc1
chore: cargo clippy
Narayanbhat166 Jul 17, 2024
05083b7
refactor(core): added refactors for v2 customer api
sahkal Jul 17, 2024
a59af16
refactor(core): fixed unused imports and clippy warnings
sahkal Jul 17, 2024
e35a94f
chore: include storage_impl in router
Narayanbhat166 Jul 17, 2024
b36a2d0
refactor(customer): fixed ci checks
sahkal Jul 17, 2024
17017de
refactor(customer):
sahkal Jul 17, 2024
3466b43
chore: add few more just commands
Narayanbhat166 Jul 17, 2024
c26ef09
chore: add comments to justfile
Narayanbhat166 Jul 17, 2024
e02c306
refactor(customer): fixed ci check and multi lifetime issue
sahkal Jul 18, 2024
c2e1431
Merge branch 'main' of https://github.com/juspay/hyperswitch into 584…
sahkal Jul 18, 2024
f605666
chore: fmt
Narayanbhat166 Jul 18, 2024
42362f9
refactor(customer): added new customer_v2 feature flag
sahkal Jul 18, 2024
e6571c7
Refactor(customer): fixed compile issue on result
sahkal Jul 18, 2024
fe6d063
ci: add support for compilation of code changes under v2 feature flag…
prajjwalkumar17 Jul 18, 2024
16a447d
Merge branch 'main' into change_mercant_account_domain_model_v2
Narayanbhat166 Jul 18, 2024
230cd2e
Merge branch 'main' into change_mercant_account_domain_model_v2
Narayanbhat166 Jul 18, 2024
462cc5f
refactor(customer): added extra flags
sahkal Jul 18, 2024
fb6cbf4
refactor(customer): removed oltp
sahkal Jul 18, 2024
245068e
refactor(customer): resolved merge conflicts
sahkal Jul 18, 2024
800edbc
refactor: remove unwanted migrations
Narayanbhat166 Jul 18, 2024
3bb7460
refactor(customer): merged merchant account v2 changes
sahkal Jul 18, 2024
47e10e3
chore: revert hsdev changes
Narayanbhat166 Jul 18, 2024
7ef542c
chore: remove the -c option from jq
Narayanbhat166 Jul 18, 2024
f404db5
chore: add print statement in ci
Narayanbhat166 Jul 18, 2024
bfd2095
chore: add debug statement
Narayanbhat166 Jul 18, 2024
1dc54d6
refactor: refactor script to increase readability
Narayanbhat166 Jul 18, 2024
844515e
chore(ci-checks): simplify if conditions
SanchithHegde Jul 18, 2024
1f3f908
ci(CI-pr): try out Ubuntu 24.04 runners for running MSRV checks
SanchithHegde Jul 18, 2024
6d2cd99
ci(CI-pr): try out Ubuntu 24.04 runners for running stable toolchain …
SanchithHegde Jul 18, 2024
6d5ae58
chore: add v1 in default features for api models
Narayanbhat166 Jul 19, 2024
a9d92ef
chore: remove unused config file
Narayanbhat166 Jul 19, 2024
7b5c2a2
refactor: add v1 feature to hyperswitch interfaces
Narayanbhat166 Jul 19, 2024
4115fe3
chore: add feature flags to openapi
Narayanbhat166 Jul 19, 2024
d69b15a
refactor(customer): added ci checks for customer
sahkal Jul 19, 2024
d1ebdc4
ci: install latest release of `jq` from GitHub releases
SanchithHegde Jul 19, 2024
290bab5
fix: migrations
Narayanbhat166 Jul 19, 2024
128a79b
Merge branch 'main' into change_mercant_account_domain_model_v2
Narayanbhat166 Jul 19, 2024
74393e9
chore: run formatter
hyperswitch-bot[bot] Jul 19, 2024
b2ea69d
fix: merge fixes
Narayanbhat166 Jul 19, 2024
5b33db3
refactor(customer): resolved merge conflicts
sahkal Jul 19, 2024
1b7f0a3
refactor(customer): fixed schema.rs file
sahkal Jul 19, 2024
40fa698
refactor(customer): fixed schema.rs file
sahkal Jul 19, 2024
efca359
refactor(customer): fixed schema file
sahkal Jul 19, 2024
9bc7976
refactor(customer): merged with merchant account v2 branch
sahkal Jul 19, 2024
17ab820
chore: exclude customer_v2 in ci check
sahkal Jul 19, 2024
f9a30e7
chore: fixed ci check failures for payment intent
sahkal Jul 19, 2024
46dc18c
chore: fixed just file for customer_v2 feature
sahkal Jul 19, 2024
b195937
chore: fixed ci checks
sahkal Jul 19, 2024
b5ebf56
Merge branch 'main' into 5841-customer-v2-refactor-customer-create-en…
sahkal Jul 19, 2024
cf7e2aa
chore: fixed merge conflicts
sahkal Jul 22, 2024
052e5fc
chore: fixed merge conflicts
sahkal Jul 22, 2024
418dfb5
chore: fixed Ci apiv2 error
sahkal Jul 22, 2024
696aaaf
chore: fixed ci check errors
sahkal Jul 22, 2024
3ef9915
chore: fixed ci checks
sahkal Jul 22, 2024
c87277e
chore: fixed ci check failures
sahkal Jul 22, 2024
140cd85
chore: fixed ci script error
sahkal Jul 22, 2024
086ad86
refactor(customer): addressed pr comments
sahkal Jul 22, 2024
6379ee7
chore: made v2 customer api compile
sahkal Jul 22, 2024
1f8d794
chore: made v1 import compile
sahkal Jul 22, 2024
e58892f
feat(customer_v2): added diesel model for customer_v2 create
sahkal Jul 24, 2024
7a4174d
feat(customer_v2): added customer_v2 diesel finally made it compile
sahkal Jul 25, 2024
bc70e3c
chore: made diesel model encryption changes
sahkal Jul 25, 2024
aa48c25
chore: resolved merge conflicts
sahkal Jul 25, 2024
1e7f242
refactor
sahkal Jul 26, 2024
6847260
chore: resolved merge conflicts
sahkal Jul 26, 2024
75be67d
chore: fixed migration issue
sahkal Jul 26, 2024
4513c66
chore: fixed migration inconsistency
sahkal Jul 26, 2024
552bd54
chore: fixed schema issue
sahkal Jul 26, 2024
553cc31
chore: fixed migration redo failures
sahkal Jul 26, 2024
3c2722e
chore: fixed clippy issue
sahkal Jul 26, 2024
84110e1
chore: added resurrect for migration ci checks
sahkal Jul 26, 2024
5abf996
chore:added delay for db connection
sahkal Jul 26, 2024
ee1d889
Merge branch 'main' into customer-v2-domain-model
sahkal Jul 26, 2024
f1da670
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
724a5fb
Merge branch 'customer-v2-domain-model' of https://github.com/juspay/…
sahkal Jul 26, 2024
045f0cf
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
1d0c539
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
039b680
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
e1e8136
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
0ba34a2
chore: fixed ci checks for v2 migrations:
sahkal Jul 26, 2024
c0fe975
chore: fixed schema error consistency
sahkal Jul 26, 2024
29bfc45
chore: fixed schema consistency issue
sahkal Jul 26, 2024
c72cfd8
chore: fixed schema issue
sahkal Jul 26, 2024
9ae6b47
chore: fixed something hopefully it works crying out loud
sahkal Jul 26, 2024
a07777a
chore: moved customer_v2_endpoint db migration into a single file
sahkal Jul 30, 2024
9b24b1c
feat(customer_v2): added route for customer_v2 update flow
sahkal Jul 31, 2024
7cc3f1b
chore: resolved pr comments
sahkal Aug 1, 2024
7b732ab
chore: unused import fixed for v2
sahkal Aug 1, 2024
ea916cf
chore: resolved merge conflicts
sahkal Aug 1, 2024
8ce9fab
chore: fixed clippy errors
sahkal Aug 1, 2024
ad8b03b
chore: resolved pr comments
sahkal Aug 1, 2024
0a57252
Merge branch 'main' into customer-v2-domain-model
sahkal Aug 1, 2024
251edfb
chore: fixed postman run failures and ci checks
sahkal Aug 2, 2024
ccadd2b
Merge branch 'customer-v2-domain-model' of https://github.com/juspay/…
sahkal Aug 2, 2024
ac23f5a
chore: removed expose_reference function
sahkal Aug 2, 2024
04cd0b5
chore: syned with latest changes
sahkal Aug 2, 2024
dbd1e11
chore: fixed db queries for both v1, and v2
sahkal Aug 2, 2024
6ff9ebc
chore: fixed ci checks
sahkal Aug 2, 2024
5bdcae0
feat(customer_v2): added route for customer_retrieve v2
sahkal Aug 2, 2024
8c284cb
chore: added list customer v2 endpoint
sahkal Aug 2, 2024
3924807
refactor(customer_v2): fixed merge conflicts
sahkal Aug 22, 2024
64715fa
chore: resolved conflicts
sahkal Aug 23, 2024
c58f9f2
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Aug 23, 2024
abc4ab6
chore: fixed clippy_v2 errors
sahkal Aug 23, 2024
4f6138d
Merge branch '6219-customer-v2-list-customer-v2-end-point' of https:/…
sahkal Aug 23, 2024
16572d0
chore: resolved unnecessary comments
sahkal Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -10283,17 +10283,6 @@
}
}
},
{
"type": "object",
"required": [
"paypal"
],
"properties": {
"paypal": {
"type": "object"
}
}
},
{
"type": "object",
"required": [
Expand Down
1 change: 0 additions & 1 deletion crates/diesel_models/src/query/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl Customer {
generics::generic_find_by_id::<<Self as HasTable>::Table, _, _>(conn, id.to_owned()).await
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
pub async fn list_by_merchant_id(
conn: &PgPooledConn,
merchant_id: &id_type::MerchantId,
Expand Down
9 changes: 7 additions & 2 deletions crates/router/src/core/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ pub async fn retrieve_customer(
))
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[instrument(skip(state))]
pub async fn list_customers(
state: SessionState,
Expand All @@ -499,17 +498,23 @@ pub async fn list_customers(
key_store: domain::MerchantKeyStore,
) -> errors::CustomerResponse<Vec<customers::CustomerResponse>> {
let db = state.store.as_ref();

let domain_customers = db
.list_customers_by_merchant_id(&(&state).into(), &merchant_id, &key_store)
.await
.switch()?;

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
let customers = domain_customers
.into_iter()
.map(|domain_customer| customers::CustomerResponse::foreign_from((domain_customer, None)))
.collect();

#[cfg(all(feature = "v2", feature = "customer_v2"))]
let customers = domain_customers
.into_iter()
.map(customers::CustomerResponse::foreign_from)
.collect();

Ok(services::ApplicationResponse::Json(customers))
}

Expand Down
1 change: 0 additions & 1 deletion crates/router/src/core/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,6 @@ pub async fn make_payout_data(
.await
.transpose()?
.and_then(|c| c);

let profile_id = payout_attempt.profile_id.clone();

// Validate whether profile_id passed in request is valid and is linked to the merchant
Expand Down
7 changes: 1 addition & 6 deletions crates/router/src/db/customers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use common_utils::{ext_traits::AsyncExt, id_type, types::keymanager::KeyManagerState};
use error_stack::ResultExt;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use futures::future::try_join_all;
use hyperswitch_domain_models::customer;
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
Expand Down Expand Up @@ -84,7 +83,6 @@ where
storage_scheme: MerchantStorageScheme,
) -> CustomResult<customer::Customer, errors::StorageError>;

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
async fn list_customers_by_merchant_id(
&self,
state: &KeyManagerState,
Expand Down Expand Up @@ -129,7 +127,6 @@ mod storage {
use common_utils::{ext_traits::AsyncExt, id_type, types::keymanager::KeyManagerState};
use diesel_models::kv;
use error_stack::{report, ResultExt};
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
use futures::future::try_join_all;
use hyperswitch_domain_models::customer;
use masking::PeekInterface;
Expand Down Expand Up @@ -511,7 +508,6 @@ mod storage {
}
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[instrument(skip_all)]
async fn list_customers_by_merchant_id(
&self,
Expand Down Expand Up @@ -919,6 +915,7 @@ mod storage {
})
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[instrument(skip_all)]
#[cfg(all(feature = "v2", feature = "customer_v2"))]
async fn find_optional_by_merchant_id_merchant_reference_id(
Expand Down Expand Up @@ -1052,7 +1049,6 @@ mod storage {
}
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[instrument(skip_all)]
async fn list_customers_by_merchant_id(
&self,
Expand Down Expand Up @@ -1244,7 +1240,6 @@ impl CustomerInterface for MockDb {
.transpose()
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
async fn list_customers_by_merchant_id(
&self,
state: &KeyManagerState,
Expand Down
1 change: 0 additions & 1 deletion crates/router/src/db/kafka_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ impl CustomerInterface for KafkaStore {
.await
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
async fn list_customers_by_merchant_id(
&self,
state: &KeyManagerState,
Expand Down
6 changes: 5 additions & 1 deletion crates/router/src/routes/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,14 @@ impl Customers {
.service(web::resource("").route(web::post().to(customers_create)))
.service(
web::resource("/{id}")
.route(web::put().to(customers_update))
.route(web::post().to(customers_update))
.route(web::post().to(customers_retrieve)),
)
}
#[cfg(all(feature = "olap", feature = "v2", feature = "customer_v2"))]
{
route = route.service(web::resource("/list").route(web::get().to(customers_list)))
}
#[cfg(all(feature = "oltp", feature = "v2", feature = "payment_methods_v2"))]
{
route = route.service(
Expand Down
1 change: 0 additions & 1 deletion crates/router/src/routes/customers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ pub async fn customers_retrieve(
.await
}

#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[instrument(skip_all, fields(flow = ?Flow::CustomersList))]
pub async fn customers_list(state: web::Data<AppState>, req: HttpRequest) -> HttpResponse {
let flow = Flow::CustomersList;
Expand Down
10 changes: 7 additions & 3 deletions crates/storage_impl/src/payouts/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ use async_bb8_diesel::{AsyncConnection, AsyncRunQueryDsl};
#[cfg(feature = "olap")]
use common_utils::errors::ReportSwitchExt;
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, NullableExpressionMethods, QueryDsl,
};
use diesel::{associations::HasTable, ExpressionMethods, NullableExpressionMethods, QueryDsl};
#[cfg(all(
feature = "olap",
any(feature = "v1", feature = "v2"),
Expand Down
Loading