From b7c271666050bd1c386d15476cd5fe451801c2bd Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Tue, 24 Oct 2023 17:51:37 +0300 Subject: [PATCH] tasks/bank-import: Change bankstatus only if donation is affiliate --- apps/api/src/tasks/bank-import/import-transactions.task.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/src/tasks/bank-import/import-transactions.task.ts b/apps/api/src/tasks/bank-import/import-transactions.task.ts index fb639f276..50d125e10 100644 --- a/apps/api/src/tasks/bank-import/import-transactions.task.ts +++ b/apps/api/src/tasks/bank-import/import-transactions.task.ts @@ -512,7 +512,11 @@ export class IrisTasks { data.map((trx) => this.prisma.bankTransaction.upsert({ where: { id: trx.id }, - update: { bankDonationStatus: trx.bankDonationStatus }, + update: { + bankDonationStatus: trx.description.startsWith('af_') + ? trx.bankDonationStatus + : undefined, + }, create: { ...trx }, }), ),