Add partner subscription type

This commit is contained in:
fetch
2025-08-04 21:07:55 -04:00
parent 1fd21e99c3
commit 158f5171fc
2 changed files with 21 additions and 0 deletions

View File

@@ -24,6 +24,12 @@ pub enum ProductMetadata {
swap: u32,
storage: u32,
},
Medal {
cpu: u32,
ram: u32,
swap: u32,
storage: u32,
},
}
#[derive(Serialize, Deserialize)]

View File

@@ -1706,6 +1706,17 @@ pub async fn stripe_webhook(
// Provision subscription
match metadata.product_item.metadata {
ProductMetadata::Medal {
cpu: _,
ram: _,
swap: _,
storage: _,
} => {
todo!(
"Promote Medal subscription to Pyro subscription"
)
}
ProductMetadata::Midas => {
let badges =
metadata.user_item.badges | Badges::MIDAS;
@@ -2186,6 +2197,10 @@ pub async fn index_subscriptions(pool: PgPool, redis: RedisPool) {
};
let unprovisioned = match product.metadata {
ProductMetadata::Medal { .. } => {
todo!("Unprovision Medal subscription")
}
ProductMetadata::Midas => {
let badges = user.badges - Badges::MIDAS;