feat: fixed midtrans #69

Merged
firmanr merged 1 commits from fix/bug-firman into development 2024-08-12 12:27:03 +00:00
1 changed files with 5 additions and 5 deletions

View File

@ -99,7 +99,7 @@ export class ChangeStatusBookingHandler
});
mappingTransaction(booking);
console.log({ dataID, couchData, booking });
console.log('change status', { dataID, couchData, booking });
if (!couchData) {
console.log('save data to couch');
@ -134,18 +134,18 @@ export class BookingUpdateHandler
async handle(event: TransactionUpdatedEvent) {
const data = event.data.data;
const dataID = data?.id;
const dataID = data?.id ?? data?.order_id;
const couchData = await this.couchService.getDoc(dataID, 'booking');
console.log('update', { dataID, couchData });
if (couchData) {
const booking = await this.bookingService.getOneByOptions({
where: {
id: data.id,
id: dataID,
},
relations: ['items'],
});
console.log({ booking });
mappingTransaction(booking);
await this.couchService.updateDoc(
{