fix transaction seed

This commit is contained in:
Moriz Wahl 2022-03-04 14:11:18 +01:00
parent 1840878513
commit b6618d1ffa

View File

@ -2,6 +2,7 @@ import Faker from 'faker'
import { define } from 'typeorm-seeding'
import { Transaction } from '../../entity/Transaction'
import { TransactionContext } from '../interface/TransactionContext'
import Decimal from 'decimal.js-light'
define(Transaction, (faker: typeof Faker, context?: TransactionContext) => {
if (!context) {
@ -12,6 +13,8 @@ define(Transaction, (faker: typeof Faker, context?: TransactionContext) => {
transaction.typeId = context.typeId // || 2
transaction.userId = context.userId
transaction.amount = context.amount
transaction.balance = context.balance
transaction.decay = new Decimal(0) // context.decay
transaction.memo = context.memo
transaction.creationDate = context.creationDate || new Date()
// transaction.sendReceiverPublicKey = context.sendReceiverPublicKey || null