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

chore: resolve v2 warnings in diesel_models #7359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion crates/diesel_models/src/merchant_connector_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::enums as storage_enums;
#[cfg(feature = "v1")]
use crate::schema::merchant_connector_account;
#[cfg(feature = "v2")]
use crate::{enums, schema_v2::merchant_connector_account, types};
use crate::schema_v2::merchant_connector_account;

#[cfg(feature = "v1")]
#[derive(
Expand Down
4 changes: 2 additions & 2 deletions crates/diesel_models/src/payment_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ impl PaymentAttemptUpdateInternal {

#[cfg(feature = "v2")]
impl PaymentAttemptUpdate {
pub fn apply_changeset(self, source: PaymentAttempt) -> PaymentAttempt {
pub fn apply_changeset(self, _source: PaymentAttempt) -> PaymentAttempt {
todo!()
// let PaymentAttemptUpdateInternal {
// net_amount,
Expand Down Expand Up @@ -1146,7 +1146,7 @@ impl PaymentAttemptUpdate {

#[cfg(feature = "v2")]
impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
fn from(payment_attempt_update: PaymentAttemptUpdate) -> Self {
fn from(_payment_attempt_update: PaymentAttemptUpdate) -> Self {
todo!()
// match payment_attempt_update {
// PaymentAttemptUpdate::Update {
Expand Down
20 changes: 12 additions & 8 deletions crates/diesel_models/src/query/payment_attempt.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
#[cfg(feature = "v1")]
use std::collections::HashSet;

use async_bb8_diesel::AsyncRunQueryDsl;
#[cfg(feature = "v1")]
use diesel::Table;
use diesel::{
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods,
QueryDsl, Table,
associations::HasTable, debug_query, pg::Pg, BoolExpressionMethods, ExpressionMethods, QueryDsl,
};
use error_stack::{report, ResultExt};
#[cfg(feature = "v1")]
use error_stack::report;
use error_stack::ResultExt;

use super::generics;
#[cfg(feature = "v1")]
use crate::schema::payment_attempt::dsl;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_attempt::dsl;
#[cfg(feature = "v1")]
use crate::{enums::IntentStatus, payment_attempt::PaymentAttemptUpdate, PaymentIntent};
use crate::{
enums::{self, IntentStatus},
enums::{self},
errors::DatabaseError,
payment_attempt::{
PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdate, PaymentAttemptUpdateInternal,
},
payment_attempt::{PaymentAttempt, PaymentAttemptNew, PaymentAttemptUpdateInternal},
query::generics::db_metrics,
PaymentIntent, PgPooledConn, StorageResult,
PgPooledConn, StorageResult,
};

impl PaymentAttemptNew {
Expand Down
6 changes: 4 additions & 2 deletions crates/diesel_models/src/query/user/sample_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ use crate::schema_v2::{
use crate::{
errors,
schema::{dispute::dsl as dispute_dsl, refund::dsl as refund_dsl},
user, Dispute, DisputeNew, PaymentAttempt, PaymentIntent, PaymentIntentNew, PgPooledConn,
Refund, RefundNew, StorageResult,
Dispute, DisputeNew, PaymentAttempt, PaymentIntent, PgPooledConn, Refund, RefundNew,
StorageResult,
};
#[cfg(feature = "v1")]
use crate::{user, PaymentIntentNew};

#[cfg(feature = "v1")]
pub async fn insert_payment_intents(
Expand Down
11 changes: 8 additions & 3 deletions crates/diesel_models/src/user/sample_data.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#[cfg(feature = "v1")]
use common_enums::{
AttemptStatus, AuthenticationType, CaptureMethod, Currency, PaymentExperience, PaymentMethod,
PaymentMethodType,
};
#[cfg(feature = "v1")]
use common_utils::types::{
ConnectorTransactionId, ExtendedAuthorizationAppliedBool, MinorUnit,
RequestExtendedAuthorizationBool,
};
#[cfg(feature = "v1")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "v1")]
use time::PrimitiveDateTime;

#[cfg(feature = "v1")]
use crate::schema::payment_attempt;
#[cfg(feature = "v2")]
use crate::schema_v2::payment_attempt;
use crate::{
enums::{MandateDataType, MandateDetails},
schema::payment_attempt,
ConnectorMandateReferenceId, PaymentAttemptNew,
};

// #[cfg(feature = "v2")]
// use crate::schema_v2::payment_attempt;

// #[cfg(feature = "v2")]
// #[derive(
// Clone, Debug, diesel::Insertable, router_derive::DebugAsDisplay, Serialize, Deserialize,
Expand Down
Loading