Compare commits

...

2 Commits

Author SHA1 Message Date
firmanr ff44be66e2 Merge pull request 'feat: fixed midtrans' (#69) from fix/bug-firman into development
continuous-integration/drone/tag Build is passing Details
Reviewed-on: #69
2024-08-12 12:27:03 +00:00
Firman Ramdhani b9b1695dc5 feat: fixed midtrans 2024-08-12 19:26:39 +07:00
1 changed files with 5 additions and 5 deletions

View File

@ -99,7 +99,7 @@ export class ChangeStatusBookingHandler
}); });
mappingTransaction(booking); mappingTransaction(booking);
console.log({ dataID, couchData, booking }); console.log('change status', { 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; const dataID = data?.id ?? data?.order_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: data.id, id: dataID,
}, },
relations: ['items'], relations: ['items'],
}); });
console.log({ booking });
mappingTransaction(booking); mappingTransaction(booking);
await this.couchService.updateDoc( await this.couchService.updateDoc(
{ {