remove reservation table
This commit is contained in:
@@ -4,7 +4,7 @@ import { Payment } from '../entities/payment.entity';
|
||||
import { EntityManager } from '@mikro-orm/postgresql';
|
||||
import { Order } from '../../orders/entities/order.entity';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { GatewayManager } from './gateway.manager';
|
||||
import { GatewayManager } from '../gateways/gateway.manager';
|
||||
import { UserWallet } from 'src/modules/users/entities/user-wallet.entity';
|
||||
import { OrderPaymentContext } from '../interface/payment';
|
||||
import { InventoryService } from 'src/modules/inventory/inventory.service';
|
||||
@@ -209,8 +209,7 @@ export class PaymentsService {
|
||||
}
|
||||
this.markPaid(payment);
|
||||
this.confirmOrder(payment.order);
|
||||
await this.confirmStock(orderId, em);
|
||||
|
||||
|
||||
await em.flush();
|
||||
return payment;
|
||||
});
|
||||
@@ -241,9 +240,7 @@ export class PaymentsService {
|
||||
order.status = OrderStatus.PAID;
|
||||
}
|
||||
|
||||
private async confirmStock(orderId: string, em: EntityManager) {
|
||||
await this.inventoryService.confirmReservationByOrderId(em, orderId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async getOrCreateLatestPendingPayment(
|
||||
|
||||
Reference in New Issue
Block a user