mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
type of ledger entry
This commit is contained in:
1 parent
41ae46e5ea
commit
4bbcc315d7
2 files changed
+5
-3
No files matched your search
+2
-1
@@ -10,6 +10,7 @@ pub async fn add_durable_banked_balance_to_wallet(
|
||||
wallet_token: &WalletToken,
|
||||
amount_to_add: u64,
|
||||
maybe_ledger_ref: Option<&str>,
|
||||
wallet_ledger_entry_type_override: Option<WalletLedgerEntryType>,
|
||||
transaction: &mut sqlx::Transaction<'_, MySql>,
|
||||
) -> anyhow::Result<WalletUpdateSummary> {
|
||||
|
||||
@@ -38,7 +39,7 @@ pub async fn add_durable_banked_balance_to_wallet(
|
||||
|
||||
let record = InsertWalletLedgerEntry {
|
||||
wallet_token,
|
||||
entry_type: WalletLedgerEntryType::CreditBanked,
|
||||
entry_type: wallet_ledger_entry_type_override.unwrap_or(WalletLedgerEntryType::CreditBanked),
|
||||
maybe_entity_ref: maybe_ledger_ref.map(|t| t.to_string()),
|
||||
|
||||
credits_delta: amount_to_add.to_i64().unwrap_or(0),
|
||||
|
||||
+3
-2
@@ -38,9 +38,10 @@ pub async fn complete_credits_pack_purchase(
|
||||
info!("Adding {} credits to wallet: {}", credits_purchased, wallet_token.as_str());
|
||||
|
||||
let _result = add_durable_banked_balance_to_wallet(
|
||||
&wallet_token,
|
||||
credits_purchased,
|
||||
&wallet_token,
|
||||
credits_purchased,
|
||||
maybe_ledger_ref,
|
||||
None,
|
||||
transaction,
|
||||
).await?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user