Task to retroactively update Mural statuses (#4769)

* Task to retroactively update Mural statuses

* cargo sqlx prepare

* wip: add tests

* Prepare

* Fix up test

* start on muralpay mock

* Move mocking to muralpay crate
This commit is contained in:
aecsocket
2025-11-13 18:16:41 +00:00
committed by GitHub
parent 70e2138248
commit c27f787c91
24 changed files with 906 additions and 10 deletions

View File

@@ -14,6 +14,8 @@ impl MuralPay {
&self,
params: Option<SearchParams<CounterpartyId>>,
) -> Result<SearchResponse<CounterpartyId, Counterparty>, MuralError> {
mock!(self, search_counterparties(params));
self.http_post(|base| format!("{base}/api/counterparties/search"))
.query(&params.map(|p| p.to_query()).unwrap_or_default())
.send_mural()
@@ -24,6 +26,8 @@ impl MuralPay {
&self,
id: CounterpartyId,
) -> Result<Counterparty, MuralError> {
mock!(self, get_counterparty(id));
self.http_get(|base| {
format!("{base}/api/counterparties/counterparty/{id}")
})
@@ -35,6 +39,8 @@ impl MuralPay {
&self,
counterparty: &CreateCounterparty,
) -> Result<Counterparty, MuralError> {
mock!(self, create_counterparty(counterparty));
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct Body<'a> {
@@ -54,6 +60,8 @@ impl MuralPay {
id: CounterpartyId,
counterparty: &UpdateCounterparty,
) -> Result<Counterparty, MuralError> {
mock!(self, update_counterparty(id, counterparty));
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct Body<'a> {