diff --git a/src/transaction/transaction.controller.ts b/src/transaction/transaction.controller.ts index 98fed2e..9213032 100644 --- a/src/transaction/transaction.controller.ts +++ b/src/transaction/transaction.controller.ts @@ -186,6 +186,7 @@ export class TransactionController { @Query('start') startDate: string, @Query('end') endDate: string, @Query('trxId') trxId: string, + @Query('partnerTrxId') partnerTrxId: string, @Request() req, ) { const data = await this.transactionService.transactionHistoryByUser( @@ -194,6 +195,7 @@ export class TransactionController { startDate == 'null' ? null : startDate, endDate == 'null' ? null : endDate, trxId == 'null' ? null : trxId, + partnerTrxId == 'null' ? null : partnerTrxId, pageSize, ); @@ -232,6 +234,7 @@ export class TransactionController { @Query('start') startDate: string, @Query('end') endDate: string, @Query('trxId') trxId: string, + @Query('partnerTrxId') partnerTrxId: string, @Param('id', ParseUUIDPipe) id: string, ) { const data = await this.transactionService.transactionHistoryByUser( @@ -240,6 +243,7 @@ export class TransactionController { startDate == 'null' ? null : startDate, endDate == 'null' ? null : endDate, trxId == 'null' ? null : trxId, + partnerTrxId == 'null' ? null : partnerTrxId, pageSize, ); diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index cdc062a..dc4ceed 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -1886,6 +1886,7 @@ export class TransactionService { startDate: string, endDate: string, trxId: string, + partnerTrxId: string, pageSize?: number, ) { const userData = await this.userService.findExist(user); @@ -1966,6 +1967,13 @@ export class TransactionService { trxId: trxId }, ); + } else if (partnerTrxId != null) { + baseQuery.andWhere( + 'transaction.partner_trx_id = :partnerTrxId', + { + partnerTrxId: partnerTrxId + }, + ); } const data = await baseQuery