|
|
|
|
@@ -7,10 +7,10 @@ pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_SNAPSHOT_SYNC: &str = "snapshot_sync
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_POINTS_RECHARGE: &str = "points_recharge";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_INVITE_INVITER_REWARD: &str = "invite_inviter_reward";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_INVITE_INVITEE_REWARD: &str = "invite_invitee_reward";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_CONSUME: &str =
|
|
|
|
|
"asset_generation_consume";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_REFUND: &str =
|
|
|
|
|
"asset_generation_refund";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_CONSUME: &str =
|
|
|
|
|
"asset_operation_consume";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_REFUND: &str = "asset_operation_refund";
|
|
|
|
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_REDEEM_CODE_REWARD: &str = "redeem_code_reward";
|
|
|
|
|
pub const BROWSE_HISTORY_THEME_MODE_MARTIAL: &str = "martial";
|
|
|
|
|
pub const BROWSE_HISTORY_THEME_MODE_ARCANE: &str = "arcane";
|
|
|
|
|
pub const BROWSE_HISTORY_THEME_MODE_MACHINA: &str = "machina";
|
|
|
|
|
@@ -267,6 +267,60 @@ pub struct RedeemProfileReferralInviteCodeResponse {
|
|
|
|
|
pub inviter_balance_after: u64,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct RedeemProfileRewardCodeRequest {
|
|
|
|
|
pub code: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct RedeemProfileRewardCodeResponse {
|
|
|
|
|
pub wallet_balance: u64,
|
|
|
|
|
pub amount_granted: u64,
|
|
|
|
|
pub ledger_entry: ProfileWalletLedgerEntryResponse,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct AdminUpsertProfileRedeemCodeRequest {
|
|
|
|
|
pub code: String,
|
|
|
|
|
pub mode: String,
|
|
|
|
|
pub reward_points: u64,
|
|
|
|
|
pub max_uses: u32,
|
|
|
|
|
#[serde(default = "default_true")]
|
|
|
|
|
pub enabled: bool,
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
pub allowed_user_ids: Vec<String>,
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
pub allowed_public_user_codes: Vec<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct AdminDisableProfileRedeemCodeRequest {
|
|
|
|
|
pub code: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ProfileRedeemCodeAdminResponse {
|
|
|
|
|
pub code: String,
|
|
|
|
|
pub mode: String,
|
|
|
|
|
pub reward_points: u64,
|
|
|
|
|
pub max_uses: u32,
|
|
|
|
|
pub global_used_count: u32,
|
|
|
|
|
pub enabled: bool,
|
|
|
|
|
pub allowed_user_ids: Vec<String>,
|
|
|
|
|
pub created_by: String,
|
|
|
|
|
pub created_at: String,
|
|
|
|
|
pub updated_at: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn default_true() -> bool {
|
|
|
|
|
true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
pub struct ProfilePlayedWorkSummaryResponse {
|
|
|
|
|
@@ -828,7 +882,7 @@ mod tests {
|
|
|
|
|
id: "ledger-5".to_string(),
|
|
|
|
|
amount_delta: -1,
|
|
|
|
|
balance_after: 199,
|
|
|
|
|
source_type: PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_CONSUME
|
|
|
|
|
source_type: PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_CONSUME
|
|
|
|
|
.to_string(),
|
|
|
|
|
created_at: "2026-04-22T10:04:00Z".to_string(),
|
|
|
|
|
},
|
|
|
|
|
@@ -836,7 +890,7 @@ mod tests {
|
|
|
|
|
id: "ledger-6".to_string(),
|
|
|
|
|
amount_delta: 1,
|
|
|
|
|
balance_after: 200,
|
|
|
|
|
source_type: PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_REFUND
|
|
|
|
|
source_type: PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_REFUND
|
|
|
|
|
.to_string(),
|
|
|
|
|
created_at: "2026-04-22T10:05:00Z".to_string(),
|
|
|
|
|
},
|
|
|
|
|
@@ -864,11 +918,11 @@ mod tests {
|
|
|
|
|
);
|
|
|
|
|
assert_eq!(
|
|
|
|
|
payload["entries"][4]["sourceType"],
|
|
|
|
|
json!(PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_CONSUME)
|
|
|
|
|
json!(PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_CONSUME)
|
|
|
|
|
);
|
|
|
|
|
assert_eq!(
|
|
|
|
|
payload["entries"][5]["sourceType"],
|
|
|
|
|
json!(PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_GENERATION_REFUND)
|
|
|
|
|
json!(PROFILE_WALLET_LEDGER_SOURCE_TYPE_ASSET_OPERATION_REFUND)
|
|
|
|
|
);
|
|
|
|
|
assert_eq!(
|
|
|
|
|
payload["entries"][0]["createdAt"],
|
|
|
|
|
|