diff --git a/server-rs/crates/module-runtime/src/application.rs b/server-rs/crates/module-runtime/src/application.rs index 38454c755..ab4f9d49a 100644 --- a/server-rs/crates/module-runtime/src/application.rs +++ b/server-rs/crates/module-runtime/src/application.rs @@ -1132,9 +1132,9 @@ pub fn build_runtime_profile_membership_upgrade_quote_record( snapshot: RuntimeProfileMembershipUpgradeQuoteSnapshot, ) -> RuntimeProfileMembershipUpgradeQuoteRecord { RuntimeProfileMembershipUpgradeQuoteRecord { - current_plan: snapshot.current_plan, - target_plan: snapshot.target_plan, - cycle_kind: snapshot.cycle_kind, + current_plan: snapshot.current_plan.as_str().to_string(), + target_plan: snapshot.target_plan.as_str().to_string(), + cycle_kind: snapshot.cycle_kind.as_str().to_string(), cycle_index: snapshot.cycle_index, cycle_count: snapshot.cycle_count, amount_cents: snapshot.amount_cents, diff --git a/server-rs/crates/module-runtime/src/domain.rs b/server-rs/crates/module-runtime/src/domain.rs index b94aa6476..53dba4bec 100644 --- a/server-rs/crates/module-runtime/src/domain.rs +++ b/server-rs/crates/module-runtime/src/domain.rs @@ -1892,9 +1892,9 @@ pub struct RuntimeProfileMembershipUpgradeQuoteGetInput { #[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RuntimeProfileMembershipUpgradeQuoteSnapshot { - pub current_plan: String, - pub target_plan: String, - pub cycle_kind: String, + pub current_plan: RuntimeProfileMembershipPlan, + pub target_plan: RuntimeProfileMembershipPlan, + pub cycle_kind: RuntimeProfileMembershipCycleKind, pub cycle_index: u32, pub cycle_count: u32, pub amount_cents: u64, diff --git a/server-rs/crates/spacetime-client/src/active/mapper/runtime_profile.rs b/server-rs/crates/spacetime-client/src/active/mapper/runtime_profile.rs index 591dd1209..311352f13 100644 --- a/server-rs/crates/spacetime-client/src/active/mapper/runtime_profile.rs +++ b/server-rs/crates/spacetime-client/src/active/mapper/runtime_profile.rs @@ -2119,9 +2119,9 @@ pub(crate) fn map_runtime_profile_membership_upgrade_quote_procedure_result( Ok(build_runtime_profile_membership_upgrade_quote_record( module_runtime::RuntimeProfileMembershipUpgradeQuoteSnapshot { - current_plan: quote.current_plan, - target_plan: quote.target_plan, - cycle_kind: quote.cycle_kind, + current_plan: map_runtime_profile_membership_plan_back(quote.current_plan), + target_plan: map_runtime_profile_membership_plan_back(quote.target_plan), + cycle_kind: map_runtime_profile_membership_cycle_kind_back(quote.cycle_kind), cycle_index: quote.cycle_index, cycle_count: quote.cycle_count, amount_cents: quote.amount_cents, diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_membership_upgrade_quote_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_membership_upgrade_quote_snapshot_type.rs index 1ffc80dc3..e3a9ddb6b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_membership_upgrade_quote_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_membership_upgrade_quote_snapshot_type.rs @@ -4,12 +4,15 @@ #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::runtime_profile_membership_cycle_kind_type::RuntimeProfileMembershipCycleKind; +use super::runtime_profile_membership_plan_type::RuntimeProfileMembershipPlan; + #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct RuntimeProfileMembershipUpgradeQuoteSnapshot { - pub current_plan: String, - pub target_plan: String, - pub cycle_kind: String, + pub current_plan: RuntimeProfileMembershipPlan, + pub target_plan: RuntimeProfileMembershipPlan, + pub cycle_kind: RuntimeProfileMembershipCycleKind, pub cycle_index: u32, pub cycle_count: u32, pub amount_cents: u64, diff --git a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs index 9309abed6..40d91ceaf 100644 --- a/server-rs/crates/spacetime-module/src/runtime/active/profile.rs +++ b/server-rs/crates/spacetime-module/src/runtime/active/profile.rs @@ -8279,9 +8279,9 @@ fn build_profile_membership_upgrade_quote_record( .map_err(|rejection| format!("会员升级被拒绝: {}", rejection.as_str()))?; Ok(RuntimeProfileMembershipUpgradeQuoteSnapshot { - current_plan: current.plan.as_str().to_string(), - target_plan: target.plan.as_str().to_string(), - cycle_kind: target.cycle_kind.as_str().to_string(), + current_plan: current.plan, + target_plan: target.plan, + cycle_kind: target.cycle_kind, cycle_index: quote.cycle_index, cycle_count: target.cycle_count, amount_cents: quote.amount_cents,