- if(stateChangeReason.shouldStoreCalculatedWalletEntries) {
- val newWalletEntry = NewWalletEntry(
- userStateWorker.userID,
- newCreditsDiff,
- oldCredits,
- newCredits,
- TimeHelpers.nowMillis(),
- referenceTimeslot,
- billingMonthInfo.year,
- billingMonthInfo.month,
- if(havePreviousResourceEvent)
- List(currentResourceEvent, previousResourceEventOpt1.get)
- else
- List(currentResourceEvent),
- fullChargeslots,
- dslResource,
- currentResourceEvent.isSynthetic
- )
- clog.debug("New %s", newWalletEntry)
-
- walletEntryRecorder.apply(newWalletEntry)
- } else {
- clog.debug("newCreditsDiff = %s, newCredits = %s", newCreditsDiff, newCredits)
- }
+ val newWalletEntry = NewWalletEntry(
+ userStateWorker.userID,
+ newCreditsDiff,
+ oldCredits,
+ newCredits,
+ TimeHelpers.nowMillis(),
+ referenceTimeslot,
+ billingMonthInfo.year,
+ billingMonthInfo.month,
+ if(havePreviousResourceEvent)
+ List(currentResourceEvent, previousResourceEventOpt1.get)
+ else
+ List(currentResourceEvent),
+ fullChargeslots,
+ dslResource,
+ currentResourceEvent.isSynthetic
+ )
+ clog.debug("%s = %s", shortClassNameOf(newWalletEntry), newWalletEntry)
+
+ walletEntryRecorder.apply(newWalletEntry)