Merge branch 'development' into 'devops-staging'
Feat add get by id check bill history See merge request empatnusabangsa/ppob/ppob-backend!164
This commit is contained in:
		| @@ -155,6 +155,23 @@ export class TransactionController { | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   @Get('check-bill-history/:id') | ||||
|   async getCheckBillHistory( | ||||
|     @Param('id') id: string, | ||||
|     @Request() req, | ||||
|   ) { | ||||
|     const data = await this.transactionService.findOne( | ||||
|       req.user.userId, | ||||
|       id, | ||||
|     ); | ||||
|  | ||||
|     return { | ||||
|       ...data, | ||||
|       statusCode: HttpStatus.OK, | ||||
|       message: 'success', | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   @Get('history-user/:id') | ||||
|   async getHistoryTransactionUserByParam( | ||||
|     @Query('page') page: number, | ||||
|   | ||||
| @@ -50,7 +50,7 @@ export class TransactionService { | ||||
|     private commissionService: CommissionService, | ||||
|     private supplierService: SupplierService, | ||||
|     private connection: Connection, | ||||
|   ) { } | ||||
|   ) {} | ||||
|  | ||||
|   async addSupplierSaldo(addSaldoSupplier: AddSaldoSupplier, currentUser: any) { | ||||
|     const supplier = await this.supplierService.findByCode( | ||||
| @@ -316,7 +316,7 @@ export class TransactionService { | ||||
|     //GET PRODUCT | ||||
|     const product = await this.productService.findOne( | ||||
|       orderTransactionDto.productCode, | ||||
|       'prepaid' | ||||
|       'prepaid', | ||||
|     ); | ||||
|  | ||||
|     const product_price = await this.productHistoryPriceService.findOne( | ||||
| @@ -677,7 +677,7 @@ export class TransactionService { | ||||
|       product.supplier.code, | ||||
|     ); | ||||
|  | ||||
|     let product_price = await this.productHistoryPriceService.findOne( | ||||
|     const product_price = await this.productHistoryPriceService.findOne( | ||||
|       product.id, | ||||
|       userData.partner?.id, | ||||
|     ); | ||||
| @@ -852,13 +852,14 @@ export class TransactionService { | ||||
|  | ||||
|     try { | ||||
|       let hitSupplier = await doTransaction( | ||||
|         'CEK' + orderTransactionDto.productCode.slice(3), | ||||
|         `CEK${orderTransactionDto.productCode.slice(3)}`, | ||||
|         orderTransactionDto.destination, | ||||
|         trxId, | ||||
|         supplier, | ||||
|       ); | ||||
|       const parsingResponse = hitSupplier.split(' '); | ||||
|       console.log(hitSupplier,"ini dia") | ||||
|  | ||||
|       console.log(hitSupplier, 'ini dia'); | ||||
|       hitSupplier = { | ||||
|         success: hitSupplier.includes('diproses'), | ||||
|         msg: hitSupplier, | ||||
| @@ -1376,6 +1377,25 @@ export class TransactionService { | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   async findOne(user: string, id: string) { | ||||
|     try { | ||||
|       return this.checkBillHistoryRepository.findOneOrFail({ | ||||
|         where: { | ||||
|           trx_id: id, | ||||
|           user: user, | ||||
|         }, | ||||
|       }); | ||||
|     } catch (e) { | ||||
|         throw new HttpException( | ||||
|             { | ||||
|               statusCode: HttpStatus.NOT_FOUND, | ||||
|               error: 'Billing not found', | ||||
|             }, | ||||
|             HttpStatus.NOT_FOUND, | ||||
|         ); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async topUpHistoryByUser( | ||||
|     page: number, | ||||
|     user: string, | ||||
| @@ -1825,7 +1845,7 @@ export class TransactionService { | ||||
|   async findOneBillById(trxId: string) { | ||||
|     try { | ||||
|       return await this.checkBillHistoryRepository.findOneOrFail({ | ||||
|         where:{ | ||||
|         where: { | ||||
|           trx_id: trxId, | ||||
|         }, | ||||
|       }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user