Compare commits

..

No commits in common. "ff44be66e2d2c31cc86f06639cc38fab7ffa4cc8" and "617a08e3f2e36fcb4eaf568406ae650713f6adc7" have entirely different histories.

1 changed files with 5 additions and 5 deletions

View File

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