diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index 95d1e8c78b..bca3501aa0 100644 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -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", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 615310fbd9..7c43cbdc88 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -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 diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs index aea737007d..e36be6c84b 100644 --- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs +++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs @@ -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, } } diff --git a/frontend/rust-lib/flowy-sqlite/src/schema.rs b/frontend/rust-lib/flowy-sqlite/src/schema.rs index 24290ea5d8..b1737d85eb 100644 --- a/frontend/rust-lib/flowy-sqlite/src/schema.rs +++ b/frontend/rust-lib/flowy-sqlite/src/schema.rs @@ -68,10 +68,10 @@ diesel::table! { } diesel::allow_tables_to_appear_in_same_query!( - chat_message_table, - chat_table, - collab_snapshot, - user_data_migration_records, - user_table, - user_workspace_table, + chat_message_table, + chat_table, + collab_snapshot, + user_data_migration_records, + user_table, + user_workspace_table, ); diff --git a/frontend/rust-lib/flowy-user-pub/src/entities.rs b/frontend/rust-lib/flowy-user-pub/src/entities.rs index b06e67c9da..ae4f85d71a 100644 --- a/frontend/rust-lib/flowy-user-pub/src/entities.rs +++ b/frontend/rust-lib/flowy-user-pub/src/entities.rs @@ -439,6 +439,7 @@ pub struct WorkspaceSubscription { pub subscription_plan: SubscriptionPlan, pub recurring_interval: RecurringInterval, pub is_active: bool, + pub canceled_at: Option, } pub struct WorkspaceUsage { diff --git a/frontend/rust-lib/flowy-user/src/entities/workspace.rs b/frontend/rust-lib/flowy-user/src/entities/workspace.rs index 5073dc9cc1..1af4f2b020 100644 --- a/frontend/rust-lib/flowy-user/src/entities/workspace.rs +++ b/frontend/rust-lib/flowy-user/src/entities/workspace.rs @@ -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 for WorkspaceSubscriptionPB { @@ -308,6 +314,8 @@ impl From 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(), } } }