Merge branch 'development' into 'devops-staging'
fix: ppob callback See merge request empatnusabangsa/ppob/ppob-backend!172
This commit is contained in:
		@@ -43,6 +43,9 @@ export class CheckBillHistory extends BaseModel {
 | 
				
			|||||||
  @Column()
 | 
					  @Column()
 | 
				
			||||||
  product_code: string;
 | 
					  product_code: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Column()
 | 
				
			||||||
 | 
					  status: string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @ManyToOne(() => ProductHistoryPrice, (product) => product.id)
 | 
					  @ManyToOne(() => ProductHistoryPrice, (product) => product.id)
 | 
				
			||||||
  product_price: ProductHistoryPrice;
 | 
					  product_price: ProductHistoryPrice;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -158,14 +158,19 @@ export class TransactionController {
 | 
				
			|||||||
  @Get('check-bill-history')
 | 
					  @Get('check-bill-history')
 | 
				
			||||||
  async getCheckBillHistory(
 | 
					  async getCheckBillHistory(
 | 
				
			||||||
    @Param('id') id: string,
 | 
					    @Param('id') id: string,
 | 
				
			||||||
 | 
					    @Query('page') page: number,
 | 
				
			||||||
 | 
					    @Query('pageSize') pageSize: number,
 | 
				
			||||||
    @Request() req,
 | 
					    @Request() req,
 | 
				
			||||||
  ) {
 | 
					  ) {
 | 
				
			||||||
    const data = await this.transactionService.findAll(
 | 
					    const [data, count] = await this.transactionService.findAll(
 | 
				
			||||||
      req.user.userId,
 | 
					      req.user.userId,
 | 
				
			||||||
 | 
					      page,
 | 
				
			||||||
 | 
					      pageSize,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      ...data,
 | 
					      data,
 | 
				
			||||||
 | 
					      count,
 | 
				
			||||||
      statusCode: HttpStatus.OK,
 | 
					      statusCode: HttpStatus.OK,
 | 
				
			||||||
      message: 'success',
 | 
					      message: 'success',
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -887,6 +887,7 @@ export class TransactionService {
 | 
				
			|||||||
          product_code: orderTransactionDto.productCode,
 | 
					          product_code: orderTransactionDto.productCode,
 | 
				
			||||||
          partner_trx_id: orderTransactionDto.trx_id,
 | 
					          partner_trx_id: orderTransactionDto.trx_id,
 | 
				
			||||||
          product_price: product_price,
 | 
					          product_price: product_price,
 | 
				
			||||||
 | 
					          status: 'PENDING',
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
@@ -1399,9 +1400,9 @@ export class TransactionService {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async findAll(user: string) {
 | 
					  async findAll(user: string, page, pageSize?) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      return this.checkBillHistoryRepository.find({
 | 
					      return await this.checkBillHistoryRepository.findAndCount({
 | 
				
			||||||
        where: {
 | 
					        where: {
 | 
				
			||||||
          user: user,
 | 
					          user: user,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
@@ -1414,6 +1415,8 @@ export class TransactionService {
 | 
				
			|||||||
          'partner_trx_id',
 | 
					          'partner_trx_id',
 | 
				
			||||||
          'createdAt',
 | 
					          'createdAt',
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
 | 
					        skip: page * (pageSize || 10),
 | 
				
			||||||
 | 
					        take: pageSize || 10,
 | 
				
			||||||
        order: {
 | 
					        order: {
 | 
				
			||||||
          createdAt: 'DESC',
 | 
					          createdAt: 'DESC',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -1859,6 +1862,7 @@ export class TransactionService {
 | 
				
			|||||||
      {
 | 
					      {
 | 
				
			||||||
        amount: amount + product_price.partner_fee + product_price.mark_up_price,
 | 
					        amount: amount + product_price.partner_fee + product_price.mark_up_price,
 | 
				
			||||||
        admin_price: admin,
 | 
					        admin_price: admin,
 | 
				
			||||||
 | 
					        status: status ? 'SUCCESS' : 'FAILED',
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user