fix: compile daily login tracking procedure

This commit is contained in:
2026-05-08 11:55:08 +08:00
parent bdded3d708
commit 98be6eb0e4
5 changed files with 87 additions and 6 deletions

View File

@@ -155,11 +155,10 @@ use module_runtime::{
RuntimeProfileTaskStatus as DomainRuntimeProfileTaskStatus,
RuntimeProfileWalletLedgerEntryRecord, RuntimeReferralInviteCenterRecord,
RuntimeReferralRedeemRecord, RuntimeSettingsRecord, RuntimeSnapshotRecord,
RuntimeTrackingEventProcedureResult, RuntimeTrackingScopeKind as DomainRuntimeTrackingScopeKind,
build_analytics_metric_query_input, build_runtime_browse_history_clear_input,
build_runtime_browse_history_list_input, build_runtime_browse_history_record,
build_runtime_browse_history_sync_input, build_runtime_profile_dashboard_get_input,
build_runtime_profile_dashboard_record,
RuntimeTrackingScopeKind as DomainRuntimeTrackingScopeKind, build_analytics_metric_query_input,
build_runtime_browse_history_clear_input, build_runtime_browse_history_list_input,
build_runtime_browse_history_record, build_runtime_browse_history_sync_input,
build_runtime_profile_dashboard_get_input, build_runtime_profile_dashboard_record,
build_runtime_profile_invite_code_admin_list_input,
build_runtime_profile_invite_code_admin_upsert_input, build_runtime_profile_invite_code_record,
build_runtime_profile_play_stats_get_input, build_runtime_profile_play_stats_record,

View File

@@ -514,6 +514,7 @@ pub mod record_big_fish_like_procedure;
pub mod record_big_fish_play_procedure;
pub mod record_custom_world_profile_like_procedure;
pub mod record_custom_world_profile_play_procedure;
pub mod record_daily_login_tracking_event_and_return_procedure;
pub mod record_puzzle_work_like_procedure;
pub mod redeem_profile_referral_invite_code_procedure;
pub mod redeem_profile_reward_code_procedure;
@@ -643,6 +644,7 @@ pub mod runtime_snapshot_table;
pub mod runtime_snapshot_type;
pub mod runtime_snapshot_upsert_input_type;
pub mod runtime_tracking_scope_kind_type;
pub mod runtime_tracking_event_procedure_result_type;
pub mod save_puzzle_form_draft_procedure;
pub mod save_puzzle_generated_images_procedure;
pub mod seed_analytics_date_dimensions_reducer;
@@ -1248,6 +1250,7 @@ pub use record_big_fish_like_procedure::record_big_fish_like;
pub use record_big_fish_play_procedure::record_big_fish_play;
pub use record_custom_world_profile_like_procedure::record_custom_world_profile_like;
pub use record_custom_world_profile_play_procedure::record_custom_world_profile_play;
pub use record_daily_login_tracking_event_and_return_procedure::record_daily_login_tracking_event_and_return;
pub use record_puzzle_work_like_procedure::record_puzzle_work_like;
pub use redeem_profile_referral_invite_code_procedure::redeem_profile_referral_invite_code;
pub use redeem_profile_reward_code_procedure::redeem_profile_reward_code;
@@ -1377,6 +1380,7 @@ pub use runtime_snapshot_table::*;
pub use runtime_snapshot_type::RuntimeSnapshot;
pub use runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput;
pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
pub use runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProcedureResult;
pub use save_puzzle_form_draft_procedure::save_puzzle_form_draft;
pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images;
pub use seed_analytics_date_dimensions_reducer::seed_analytics_date_dimensions;

View File

@@ -0,0 +1,62 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::runtime_profile_task_center_get_input_type::RuntimeProfileTaskCenterGetInput;
use super::runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct RecordDailyLoginTrackingEventAndReturnArgs {
pub input: RuntimeProfileTaskCenterGetInput,
}
impl __sdk::InModule for RecordDailyLoginTrackingEventAndReturnArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `record_daily_login_tracking_event_and_return`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait record_daily_login_tracking_event_and_return {
fn record_daily_login_tracking_event_and_return(
&self,
input: RuntimeProfileTaskCenterGetInput,
) {
self.record_daily_login_tracking_event_and_return_then(input, |_, _| {});
}
fn record_daily_login_tracking_event_and_return_then(
&self,
input: RuntimeProfileTaskCenterGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl record_daily_login_tracking_event_and_return for super::RemoteProcedures {
fn record_daily_login_tracking_event_and_return_then(
&self,
input: RuntimeProfileTaskCenterGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeTrackingEventProcedureResult>(
"record_daily_login_tracking_event_and_return",
RecordDailyLoginTrackingEventAndReturnArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct RuntimeTrackingEventProcedureResult {
pub ok: bool,
pub error_message: Option<String>,
}
impl __sdk::InModule for RuntimeTrackingEventProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -498,7 +498,7 @@ pub fn record_daily_login_tracking_event_and_return(
input: RuntimeProfileTaskCenterGetInput,
) -> RuntimeTrackingEventProcedureResult {
match ctx.try_with_tx(|tx| {
let validated_input = build_runtime_profile_task_center_get_input(input.user_id)
let validated_input = build_runtime_profile_task_center_get_input(input.user_id.clone())
.map_err(|error| error.to_string())?;
ensure_default_profile_task_config(tx);
record_daily_login_tracking_event(tx, &validated_input.user_id)