From 6d48b6f4e39f97ddf05e4fe5241156db8c43d5f4 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 26 Apr 2022 09:27:55 +0200 Subject: [PATCH 01/21] fix: Confirm Creation with Decimal --- backend/src/graphql/resolver/AdminResolver.ts | 5 ++--- backend/src/seeds/graphql/mutations.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 379412cdc..2009af3b0 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -333,8 +333,7 @@ export class AdminResolver { decay = calculateDecay(lastTransaction.balance, lastTransaction.balanceDate, receivedCallDate) newBalance = decay.balance } - // TODO pending creations decimal - newBalance = newBalance.add(new Decimal(Number(pendingCreation.amount)).toString()) + newBalance = newBalance.add(pendingCreation.amount.toString()) const transaction = new DbTransaction() transaction.typeId = TransactionTypeId.CREATION @@ -516,7 +515,7 @@ function isCreationValid(creations: Decimal[], amount: Decimal, creationDate: Da throw new Error(`No Creation found!`) } - if (amount.greaterThan(creations[index])) { + if (amount.greaterThan(creations[index].toString())) { throw new Error( `The amount (${amount} GDD) to be created exceeds the available amount (${creations[index]} GDD) for this month.`, ) diff --git a/backend/src/seeds/graphql/mutations.ts b/backend/src/seeds/graphql/mutations.ts index fc662cf19..601b1fbbf 100644 --- a/backend/src/seeds/graphql/mutations.ts +++ b/backend/src/seeds/graphql/mutations.ts @@ -86,7 +86,7 @@ export const createTransactionLink = gql` export const createPendingCreation = gql` mutation ( $email: String! - $amount: Float! + $amount: Decimal! $memo: String! $creationDate: String! $moderator: Int! From 3c9a12d29311182140cb399e447b70bfd93e5c35 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 26 Apr 2022 11:05:30 +0200 Subject: [PATCH 02/21] open modal only for id --- frontend/src/components/ClipboardCopy.vue | 12 +++++++++++- .../TransactionLinks/TransactionLink.vue | 14 ++++++++++++++ frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/ClipboardCopy.vue b/frontend/src/components/ClipboardCopy.vue index 936f6db1a..e8fb6e084 100644 --- a/frontend/src/components/ClipboardCopy.vue +++ b/frontend/src/components/ClipboardCopy.vue @@ -1,6 +1,6 @@