mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove more unused code
This commit is contained in:
parent
0b39620f99
commit
0a1bcac450
@ -133,9 +133,7 @@ export class TransactionResolver {
|
|||||||
const finalTransactions: Transaction[] = []
|
const finalTransactions: Transaction[] = []
|
||||||
const involvedUserIds: number[] = []
|
const involvedUserIds: number[] = []
|
||||||
|
|
||||||
const transactionIndiced: dbTransaction[] = []
|
|
||||||
userTransactions.forEach((transaction: dbTransaction) => {
|
userTransactions.forEach((transaction: dbTransaction) => {
|
||||||
transactionIndiced[transaction.id] = transaction
|
|
||||||
involvedUserIds.push(transaction.userId)
|
involvedUserIds.push(transaction.userId)
|
||||||
if (
|
if (
|
||||||
transaction.transactionTypeId === TransactionTypeId.SEND ||
|
transaction.transactionTypeId === TransactionTypeId.SEND ||
|
||||||
@ -153,11 +151,10 @@ export class TransactionResolver {
|
|||||||
|
|
||||||
for (let i = 0; i < userTransactions.length; i++) {
|
for (let i = 0; i < userTransactions.length; i++) {
|
||||||
const userTransaction = userTransactions[i]
|
const userTransaction = userTransactions[i]
|
||||||
const transaction = transactionIndiced[userTransaction.transactionId]
|
|
||||||
const finalTransaction = new Transaction()
|
const finalTransaction = new Transaction()
|
||||||
finalTransaction.transactionId = transaction.id
|
finalTransaction.transactionId = userTransaction.id
|
||||||
finalTransaction.date = transaction.received.toISOString()
|
finalTransaction.date = userTransaction.received.toISOString()
|
||||||
finalTransaction.memo = transaction.memo
|
finalTransaction.memo = userTransaction.memo
|
||||||
finalTransaction.totalBalance = roundFloorFrom4(Number(userTransaction.balance))
|
finalTransaction.totalBalance = roundFloorFrom4(Number(userTransaction.balance))
|
||||||
const previousTransaction = i > 0 ? userTransactions[i - 1] : null
|
const previousTransaction = i > 0 ? userTransactions[i - 1] : null
|
||||||
|
|
||||||
@ -184,18 +181,15 @@ export class TransactionResolver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const otherUser = userIndiced.find((u) => u.id === transaction.linkedUserId)
|
finalTransaction.balance = roundFloorFrom4(Number(userTransaction.amount)) // Todo unsafe conversion
|
||||||
|
|
||||||
|
const otherUser = userIndiced.find((u) => u.id === userTransaction.linkedUserId)
|
||||||
switch (userTransaction.transactionTypeId) {
|
switch (userTransaction.transactionTypeId) {
|
||||||
case TransactionTypeId.CREATION:
|
case TransactionTypeId.CREATION:
|
||||||
// creation
|
|
||||||
finalTransaction.name = 'Gradido Akademie'
|
finalTransaction.name = 'Gradido Akademie'
|
||||||
finalTransaction.type = TransactionType.CREATION
|
finalTransaction.type = TransactionType.CREATION
|
||||||
// finalTransaction.targetDate = creation.targetDate
|
|
||||||
finalTransaction.balance = roundFloorFrom4(Number(transaction.amount)) // Todo unsafe conversion
|
|
||||||
break
|
break
|
||||||
case TransactionTypeId.SEND:
|
case TransactionTypeId.SEND:
|
||||||
// send coin
|
|
||||||
finalTransaction.balance = roundFloorFrom4(Number(transaction.amount)) // Todo unsafe conversion
|
|
||||||
finalTransaction.type = TransactionType.SEND
|
finalTransaction.type = TransactionType.SEND
|
||||||
if (otherUser) {
|
if (otherUser) {
|
||||||
finalTransaction.name = otherUser.firstName + ' ' + otherUser.lastName
|
finalTransaction.name = otherUser.firstName + ' ' + otherUser.lastName
|
||||||
@ -203,7 +197,6 @@ export class TransactionResolver {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case TransactionTypeId.RECEIVE:
|
case TransactionTypeId.RECEIVE:
|
||||||
finalTransaction.balance = roundFloorFrom4(Number(transaction.amount)) // Todo unsafe conversion
|
|
||||||
finalTransaction.type = TransactionType.RECIEVE
|
finalTransaction.type = TransactionType.RECIEVE
|
||||||
if (otherUser) {
|
if (otherUser) {
|
||||||
finalTransaction.name = otherUser.firstName + ' ' + otherUser.lastName
|
finalTransaction.name = otherUser.firstName + ' ' + otherUser.lastName
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user