Fix Mural API response schema (#5454)
* Fix Mural API response schema * Fix clippy * fix compile * fix compile
This commit is contained in:
@@ -352,13 +352,16 @@ pub async fn sync_failed_mural_payouts_to_labrinth(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn payout_should_be_failed(payout: &muralpay::Payout) -> bool {
|
fn payout_should_be_failed(payout: &muralpay::Payout) -> bool {
|
||||||
|
let muralpay::PayoutDetails::Fiat(b) = &payout.details else {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
matches!(
|
matches!(
|
||||||
payout.details,
|
**b,
|
||||||
muralpay::PayoutDetails::Fiat(muralpay::FiatPayoutDetails {
|
muralpay::FiatPayoutDetails {
|
||||||
fiat_payout_status: muralpay::FiatPayoutStatus::Failed { .. }
|
fiat_payout_status: muralpay::FiatPayoutStatus::Failed { .. }
|
||||||
| muralpay::FiatPayoutStatus::Refunded { .. },
|
| muralpay::FiatPayoutStatus::Refunded { .. },
|
||||||
..
|
..
|
||||||
})
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +397,7 @@ mod tests {
|
|||||||
token_amount: dec!(10.00),
|
token_amount: dec!(10.00),
|
||||||
token_symbol: "USDC".into(),
|
token_symbol: "USDC".into(),
|
||||||
},
|
},
|
||||||
details: PayoutDetails::Fiat(FiatPayoutDetails {
|
details: PayoutDetails::Fiat(Box::new(FiatPayoutDetails {
|
||||||
fiat_and_rail_code: FiatAndRailCode::Usd,
|
fiat_and_rail_code: FiatAndRailCode::Usd,
|
||||||
fiat_payout_status: FiatPayoutStatus::Pending {
|
fiat_payout_status: FiatPayoutStatus::Pending {
|
||||||
initiated_at: chrono::Utc::now(),
|
initiated_at: chrono::Utc::now(),
|
||||||
@@ -414,7 +417,7 @@ mod tests {
|
|||||||
token_symbol: "USDC".into(),
|
token_symbol: "USDC".into(),
|
||||||
},
|
},
|
||||||
developer_fee: None,
|
developer_fee: None,
|
||||||
}),
|
})),
|
||||||
recipient_info: PayoutRecipientInfo::Inline {
|
recipient_info: PayoutRecipientInfo::Inline {
|
||||||
name: "John Smith".into(),
|
name: "John Smith".into(),
|
||||||
details: InlineRecipientDetails::Fiat {
|
details: InlineRecipientDetails::Fiat {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use {
|
|||||||
crate::{
|
crate::{
|
||||||
AccountId, Blockchain, CounterpartyId, CurrencyCode, FiatAccountType,
|
AccountId, Blockchain, CounterpartyId, CurrencyCode, FiatAccountType,
|
||||||
FiatAmount, FiatAndRailCode, PayoutMethodId, TokenAmount,
|
FiatAmount, FiatAndRailCode, PayoutMethodId, TokenAmount,
|
||||||
TransactionId, WalletDetails,
|
WalletDetails,
|
||||||
},
|
},
|
||||||
chrono::{DateTime, Utc},
|
chrono::{DateTime, Utc},
|
||||||
derive_more::{Deref, Display, Error, From},
|
derive_more::{Deref, Display, Error, From},
|
||||||
@@ -297,7 +297,7 @@ pub struct Payout {
|
|||||||
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
|
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
|
||||||
#[serde(tag = "type", rename_all = "camelCase")]
|
#[serde(tag = "type", rename_all = "camelCase")]
|
||||||
pub enum PayoutDetails {
|
pub enum PayoutDetails {
|
||||||
Fiat(FiatPayoutDetails),
|
Fiat(Box<FiatPayoutDetails>),
|
||||||
Blockchain(BlockchainPayoutDetails),
|
Blockchain(BlockchainPayoutDetails),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ pub enum FiatPayoutStatus {
|
|||||||
failure_reason: String,
|
failure_reason: String,
|
||||||
refund_completed_at: DateTime<Utc>,
|
refund_completed_at: DateTime<Utc>,
|
||||||
refund_initiated_at: DateTime<Utc>,
|
refund_initiated_at: DateTime<Utc>,
|
||||||
refund_transaction_id: TransactionId,
|
refund_transaction_id: String,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user