Merge branch 'development' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-staging

This commit is contained in:
Fadli 2022-08-03 22:48:41 +07:00
commit 0f24e89bf0

View File

@ -456,6 +456,21 @@ export class TransactionService {
orderTransactionDto: OrderTransactionDto, orderTransactionDto: OrderTransactionDto,
currentUser: any, currentUser: any,
) { ) {
const productData = await this.productService.findOne(
orderTransactionDto.productCode,
'prepaid',
);
if (productData.status == 'NOT ACTIVE') {
throw new HttpException(
{
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
error: `Transaction Failed because product is not active`,
},
HttpStatus.INTERNAL_SERVER_ERROR,
);
} else {
let status; let status;
const amount = 0; const amount = 0;
//GET USER DATA //GET USER DATA
@ -550,12 +565,12 @@ export class TransactionService {
const newHitSupplier = { const newHitSupplier = {
success: hitSupplier.includes('diproses'), success: hitSupplier.includes('diproses'),
harga: parseInt( harga: parseInt(
parsingResponse[parsingResponse.length - 2].replace(/\./g,' '), parsingResponse[parsingResponse.length - 2].replace(/\./g, ' '),
), ),
msg: hitSupplier, msg: hitSupplier,
}; };
hitSupplier = newHitSupplier; hitSupplier = newHitSupplier;
if(orderTransactionDto.bill_trx_id !== null){ if (orderTransactionDto.bill_trx_id !== null) {
hitSupplier.harga = product_price.price; hitSupplier.harga = product_price.price;
} }
} }
@ -669,6 +684,7 @@ export class TransactionService {
status: status, status: status,
}; };
} }
}
async orderTransactionBillProd( async orderTransactionBillProd(
orderTransactionDto: OrderTransactionDto, orderTransactionDto: OrderTransactionDto,