Skip to content

Commit ed9be14

Browse files
authored
Merge pull request #2933 from DFXswiss/develop
Release: develop -> main
2 parents eba8aa1 + e3a7d91 commit ed9be14

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/subdomains/supporting/bank-tx/bank-tx/services/bank-tx.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ export class BankTxService implements OnModuleInit {
226226

227227
if (await this.bankTxRepo.existsBy({ id: tx.id, type: Not(IsNull()) })) continue;
228228

229-
await this.updateInternal(
230-
tx,
231-
tx.name === 'Payward Trading Ltd.' ? { type: BankTxType.KRAKEN } : { type: BankTxType.GSHEET },
232-
);
229+
await this.updateInternal(tx, { type: this.getType(tx) ?? BankTxType.GSHEET });
233230
} catch (e) {
234231
this.logger.error(`Error during bankTx ${tx.id} assign:`, e);
235232
}
@@ -294,6 +291,7 @@ export class BankTxService implements OnModuleInit {
294291
throw new ConflictException(`There is already a bank tx with the accountServiceRef: ${bankTx.accountServiceRef}`);
295292

296293
entity = this.createTx(bankTx, multiAccounts);
294+
entity.type = this.getType(entity);
297295

298296
entity.transaction = await this.transactionService.create({ sourceType: TransactionSourceType.BANK_TX });
299297

@@ -490,7 +488,7 @@ export class BankTxService implements OnModuleInit {
490488
}
491489

492490
private getType(tx: BankTx): BankTxType | null {
493-
if (tx.name?.includes('Payward Ltd.')) {
491+
if (tx.name?.includes('Payward Trading')) {
494492
return BankTxType.KRAKEN;
495493
}
496494

0 commit comments

Comments
 (0)