fix: Decay Rounded to Ceil

This commit is contained in:
Moriz Wahl 2021-10-18 21:50:42 +02:00
parent dfd4ebf155
commit cffadab4af

View File

@ -24,7 +24,7 @@ import { UserTransaction as dbUserTransaction } from '../../typeorm/entity/UserT
import { Transaction as dbTransaction } from '../../typeorm/entity/Transaction'
import { apiPost } from '../../apis/HttpRequest'
import { roundFloorFrom4 } from '../../util/round'
import { roundFloorFrom4, roundCeilFrom4 } from '../../util/round'
import { calculateDecay, calculateDecayWithInterval } from '../../util/decay'
import { TransactionTypeId } from '../enum/TransactionTypeId'
import { TransactionType } from '../enum/TransactionType'
@ -150,7 +150,7 @@ async function calculateAndAddDecayTransactions(
const decayTransaction = new Transaction()
decayTransaction.type = 'decay'
decayTransaction.balance = roundFloorFrom4(balance)
decayTransaction.balance = roundCeilFrom4(balance)
decayTransaction.decayDuration = decay.decayDuration
decayTransaction.decayStart = decay.decayStart
decayTransaction.decayEnd = decay.decayEnd