mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
fix: Mural payout status schema (#7038)
This commit is contained in:
@@ -319,7 +319,7 @@ pub struct FiatPayoutDetails {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
|
||||
#[serde(tag = "type", rename_all = "kebab-case")]
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
pub enum FiatPayoutStatus {
|
||||
Created,
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -999,3 +999,22 @@ pub struct CurrenciesBankDetails {
|
||||
pub struct CurrencyBankDetails {
|
||||
pub bank_names: Vec<String>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::FiatPayoutStatus;
|
||||
|
||||
#[test]
|
||||
fn deserializes_refund_in_progress_status() -> Result<(), serde_json::Error>
|
||||
{
|
||||
let status = serde_json::from_value(serde_json::json!({
|
||||
"type": "refundInProgress",
|
||||
"errorCode": "UNKNOWN",
|
||||
"failureReason": "The receiving bank rejected the payout",
|
||||
"refundInitiatedAt": "2026-08-07T00:00:00Z"
|
||||
}))?;
|
||||
|
||||
assert!(matches!(status, FiatPayoutStatus::RefundInProgress { .. }));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user