order entity modification
This commit is contained in:
@@ -222,8 +222,8 @@ export class PaymentService {
|
||||
payment.transactionId = referenceId;
|
||||
// TODO : use decimal js
|
||||
// does need persist or not
|
||||
payment.order.paidAmount! += payment.amount
|
||||
payment.order.balance! -= payment.amount
|
||||
// payment.order.paidAmount! += payment.amount
|
||||
// payment.order.balance! -= payment.amount
|
||||
|
||||
await em.flush();
|
||||
return payment;
|
||||
@@ -261,8 +261,8 @@ export class PaymentService {
|
||||
payment.failedAt = null;
|
||||
|
||||
// TODO : use decimal js
|
||||
payment.order.paidAmount! += payment.amount
|
||||
payment.order.balance! -= payment.amount
|
||||
// payment.order.paidAmount! += payment.amount
|
||||
// payment.order.balance! -= payment.amount
|
||||
|
||||
em.persist(payment);
|
||||
em.persist(payment.order);
|
||||
@@ -286,8 +286,8 @@ export class PaymentService {
|
||||
}
|
||||
|
||||
if (payment.status == PaymentStatusEnum.Paid) {
|
||||
payment.order.paidAmount! -= payment.amount
|
||||
payment.order.balance! += payment.amount
|
||||
// payment.order.paidAmount! -= payment.amount
|
||||
// payment.order.balance! += payment.amount
|
||||
|
||||
em.persistAndFlush(payment.order)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user