Add partner subscription type
This commit is contained in:
@@ -24,6 +24,12 @@ pub enum ProductMetadata {
|
||||
swap: u32,
|
||||
storage: u32,
|
||||
},
|
||||
Medal {
|
||||
cpu: u32,
|
||||
ram: u32,
|
||||
swap: u32,
|
||||
storage: u32,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user