Supporting documents for Mural payouts (#4721)

* wip: gotenberg

* Generate and provide supporting docs for Mural payouts

* Correct docs

* shear

* update cargo lock because r-a complains otherwise

* Remove local Gotenberg queue and use Redis instead

* Store platform_id in database correctly

* Address PR comments

* Fix up CI

* fix rebase

* Add timeout to default env vars
This commit is contained in:
aecsocket
2025-11-08 15:27:31 -08:00
committed by GitHub
parent f8a5a77daa
commit 9706f1597b
15 changed files with 409 additions and 81 deletions

View File

@@ -32,6 +32,8 @@ impl MuralPay {
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct Body {
// if we submit `null`, Mural errors; we have to explicitly exclude this field
#[serde(skip_serializing_if = "Option::is_none")]
filter: Option<PayoutStatusFilter>,
}
@@ -48,7 +50,7 @@ impl MuralPay {
&self,
id: PayoutRequestId,
) -> Result<PayoutRequest, MuralError> {
self.http_get(|base| format!("{base}/api/payouts/{id}"))
self.http_get(|base| format!("{base}/api/payouts/payout/{id}"))
.send_mural()
.await
}
@@ -606,6 +608,26 @@ pub enum PayoutRecipientInfo {
},
}
impl PayoutRecipientInfo {
pub fn email(&self) -> &str {
match self {
PayoutRecipientInfo::Individual { email, .. } => email,
PayoutRecipientInfo::Business { email, .. } => email,
}
}
pub fn physical_address(&self) -> &PhysicalAddress {
match self {
PayoutRecipientInfo::Individual {
physical_address, ..
} => physical_address,
PayoutRecipientInfo::Business {
physical_address, ..
} => physical_address,
}
}
}
#[derive(Debug, Display, Clone, Copy, SerializeDisplay, DeserializeFromStr)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[display("{year:04}-{month:02}-{day:02}")]