Avoid spammy payment DMs

This commit is contained in:
Jon Staab
2026-06-01 12:59:19 -07:00
parent f5403b6aef
commit 31c8e596a6
4 changed files with 31 additions and 2 deletions
+13
View File
@@ -422,6 +422,19 @@ pub async fn settle_invoice_via_stripe(
.await
}
/// Stamp an invoice with the time its manual-payment reminder DM was sent, so
/// dunning sends that DM once instead of on every hourly poll.
pub async fn mark_invoice_notified(invoice_id: &str) -> Result<()> {
let notified_at = chrono::Utc::now().timestamp();
sqlx::query("UPDATE invoice SET notified_at = ? WHERE id = ?")
.bind(notified_at)
.bind(invoice_id)
.execute(pool())
.await?;
Ok(())
}
// --- Bolt11 records ---
pub async fn insert_bolt11(