type of ledger entry

This commit is contained in:
Brandon Thomas committed 2026-03-05 10:30:40 -05:00
1 parent 41ae46e5ea
commit 4bbcc315d7
2 files changed
+5 -3

No files matched your search

@@ -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),
@@ -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?;