File tree Expand file tree Collapse file tree
src/subdomains/supporting/bank-tx/bank-tx/services Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments