mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: added subscription plan cancellation information
This commit is contained in:
parent
f11f407564
commit
054dc771d4
2
frontend/rust-lib/Cargo.lock
generated
2
frontend/rust-lib/Cargo.lock
generated
@ -197,7 +197,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "appflowy-cloud-billing-client"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=5a9b151bbb22e9789867b3ca810f7b35f0f7ebb4#5a9b151bbb22e9789867b3ca810f7b35f0f7ebb4"
|
||||
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client?rev=48ab2cc33302caf3bb158636817a4010b1fa711e#48ab2cc33302caf3bb158636817a4010b1fa711e"
|
||||
dependencies = [
|
||||
"client-api",
|
||||
"reqwest",
|
||||
|
@ -94,7 +94,7 @@ yrs = "0.18.8"
|
||||
# scripts/tool/update_client_api_rev.sh new_rev_id
|
||||
# ⚠️⚠️⚠️️
|
||||
client-api = { version = "0.2" }
|
||||
appflowy-cloud-billing-client = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client", rev = "5a9b151bbb22e9789867b3ca810f7b35f0f7ebb4" }
|
||||
appflowy-cloud-billing-client = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud-Billing-Client", rev = "48ab2cc33302caf3bb158636817a4010b1fa711e" }
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 1
|
||||
|
@ -686,5 +686,6 @@ fn to_workspace_subscription(s: WorkspaceSubscriptionStatus) -> WorkspaceSubscri
|
||||
s.subscription_status,
|
||||
appflowy_cloud_billing_client::entities::SubscriptionStatus::Active
|
||||
),
|
||||
canceled_at: s.canceled_at,
|
||||
}
|
||||
}
|
||||
|
@ -439,6 +439,7 @@ pub struct WorkspaceSubscription {
|
||||
pub subscription_plan: SubscriptionPlan,
|
||||
pub recurring_interval: RecurringInterval,
|
||||
pub is_active: bool,
|
||||
pub canceled_at: Option<i64>,
|
||||
}
|
||||
|
||||
pub struct WorkspaceUsage {
|
||||
|
@ -299,6 +299,12 @@ pub struct WorkspaceSubscriptionPB {
|
||||
|
||||
#[pb(index = 4)]
|
||||
pub is_active: bool,
|
||||
|
||||
#[pb(index = 5)]
|
||||
pub has_canceled: bool,
|
||||
|
||||
#[pb(index = 6)]
|
||||
pub canceled_at: i64, // value is valid only if has_canceled is true
|
||||
}
|
||||
|
||||
impl From<WorkspaceSubscription> for WorkspaceSubscriptionPB {
|
||||
@ -308,6 +314,8 @@ impl From<WorkspaceSubscription> for WorkspaceSubscriptionPB {
|
||||
subscription_plan: s.subscription_plan.into(),
|
||||
recurring_interval: s.recurring_interval.into(),
|
||||
is_active: s.is_active,
|
||||
has_canceled: s.canceled_at.is_some(),
|
||||
canceled_at: s.canceled_at.unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user