Merge branch 'development' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-staging
This commit is contained in:
commit
ffdf888d24
|
@ -299,6 +299,22 @@ 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 {
|
||||||
|
|
||||||
const trxId = Array(6)
|
const trxId = Array(6)
|
||||||
.fill(null)
|
.fill(null)
|
||||||
.map(() => {
|
.map(() => {
|
||||||
|
@ -434,6 +450,7 @@ export class TransactionService {
|
||||||
status: statusTransaction[statusTransaction.SUCCESS],
|
status: statusTransaction[statusTransaction.SUCCESS],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async orderTransactionProd(
|
async orderTransactionProd(
|
||||||
orderTransactionDto: OrderTransactionDto,
|
orderTransactionDto: OrderTransactionDto,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user