From 45321810f78e252a091703cc505483613bbc8ad5 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 22 Oct 2025 11:44:18 +0200 Subject: [PATCH] reduce review noise --- backend/src/graphql/resolver/TransactionResolver.ts | 9 +++++---- backend/src/graphql/resolver/UserResolver.test.ts | 8 +++++--- backend/src/graphql/resolver/UserResolver.ts | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 4575a8b3e..359e69b45 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -69,7 +69,7 @@ export const executeTransaction = async ( } try { - logger.info('executeTransaction', memo) + logger.info('executeTransaction', amount, memo, sender, recipient) if (await countOpenPendingTransactions([sender.gradidoID, recipient.gradidoID]) > 0) { throw new LogError( @@ -88,7 +88,7 @@ export const executeTransaction = async ( receivedCallDate, transactionLink, ) - logger.debug(`calculated balance=${sendBalance?.balance.toString()} decay=${sendBalance?.decay.decay.toString()} lastTransactionId=${sendBalance?.lastTransactionId}`) + logger.debug(`calculated Balance=${sendBalance}`) if (!sendBalance) { throw new LogError('User has not enough GDD or amount is < 0', sendBalance) } @@ -147,7 +147,7 @@ export const executeTransaction = async ( // Save linked transaction id for send transactionSend.linkedTransactionId = transactionReceive.id await queryRunner.manager.update(dbTransaction, { id: transactionSend.id }, transactionSend) - logger.debug('send Transaction updated', new TransactionLoggingView(transactionSend).toJSON()) + logger.debug('send Transaction updated', transactionSend) if (transactionLink) { logger.info('transactionLink', transactionLink) @@ -161,8 +161,10 @@ export const executeTransaction = async ( } await queryRunner.commitTransaction() + logger.info(`commit Transaction successful...`) await EVENT_TRANSACTION_SEND(sender, recipient, transactionSend, transactionSend.amount) + await EVENT_TRANSACTION_RECEIVE( recipient, sender, @@ -184,7 +186,6 @@ export const executeTransaction = async ( } finally { await queryRunner.release() } - await sendTransactionReceivedEmail({ firstName: recipient.firstName, lastName: recipient.lastName, diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index 35142e890..cee570c94 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -79,9 +79,11 @@ jest.mock('@/emails/sendEmailVariants', () => { return { __esModule: true, ...originalModule, - sendAccountActivationEmail: jest.fn(), - sendAccountMultiRegistrationEmail: jest.fn(), - sendResetPasswordEmail: jest.fn(), + sendAccountActivationEmail: jest.fn((a) => originalModule.sendAccountActivationEmail(a)), + sendAccountMultiRegistrationEmail: jest.fn((a) => + originalModule.sendAccountMultiRegistrationEmail(a), + ), + sendResetPasswordEmail: jest.fn((a) => originalModule.sendResetPasswordEmail(a)), } }) diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 2398a3a95..70b1642a8 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -25,7 +25,7 @@ import { Root, } from 'type-graphql' import { IRestResponse } from 'typed-rest-client' -import { EntityNotFoundError, In, Point } from 'typeorm' +import { EntityManager, EntityNotFoundError, In, Point } from 'typeorm' import { v4 as uuidv4 } from 'uuid' import { UserArgs } from '@arg//UserArgs'