add: coin purchases + donator badge

This commit is contained in:
trisua 2025-08-08 13:25:47 -04:00
parent fd529d3847
commit 44f9edd67e
21 changed files with 345 additions and 38 deletions

View file

@ -95,6 +95,12 @@ pub struct User {
/// The number of coins the user has.
#[serde(default)]
pub coins: i32,
/// The IDs of Stripe checkout sessions that this user has successfully completed.
///
/// This should be checked BEFORE applying purchases to ensure that the user hasn't
/// already applied this purchase.
#[serde(default)]
pub checkouts: Vec<String>,
}
pub type UserConnections =
@ -407,6 +413,7 @@ impl User {
is_deactivated: false,
ban_expire: 0,
coins: 0,
checkouts: Vec::new(),
}
}