mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
round decay values in transaction graphql model
This commit is contained in:
parent
ff04cf0cb5
commit
cc86a81117
@ -16,11 +16,18 @@ export class Transaction {
|
|||||||
this.balance = transaction.balance.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN)
|
this.balance = transaction.balance.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN)
|
||||||
this.balanceDate = transaction.balanceDate
|
this.balanceDate = transaction.balanceDate
|
||||||
if (!transaction.decayStart) {
|
if (!transaction.decayStart) {
|
||||||
this.decay = new Decay(transaction.balance, new Decimal(0), null, null, null)
|
// TODO: hot fix, we should separate decay calculation from decay graphql model
|
||||||
|
this.decay = new Decay(
|
||||||
|
transaction.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN),
|
||||||
|
new Decimal(0),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
this.decay = new Decay(
|
this.decay = new Decay(
|
||||||
transaction.balance,
|
transaction.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN),
|
||||||
transaction.decay,
|
transaction.decay.toDecimalPlaces(2, Decimal.ROUND_FLOOR),
|
||||||
transaction.decayStart,
|
transaction.decayStart,
|
||||||
transaction.balanceDate,
|
transaction.balanceDate,
|
||||||
Math.round((transaction.balanceDate.getTime() - transaction.decayStart.getTime()) / 1000),
|
Math.round((transaction.balanceDate.getTime() - transaction.decayStart.getTime()) / 1000),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user