Merge pull request 'feat(SPG-818): fix condition transaction status change handler' (#58) from fix/bug-firman into development
continuous-integration/drone/tag Build is passing Details

Reviewed-on: #58
pull/59/head devel_20.1.15
firmanr 2024-08-07 11:47:44 +00:00
commit 1d8a3d7ff9
1 changed files with 26 additions and 26 deletions

View File

@ -91,36 +91,36 @@ export class ChangeStatusBookingHandler
const isFromCounter = data.payment_type == TransactionPaymentType.COUNTER;
const dataID = data?.id;
if (!isFromCounter) {
const couchData = await this.couchService.getDoc(dataID, 'booking');
// if (!isFromCounter) {
const couchData = await this.couchService.getDoc(dataID, 'booking');
const booking = await this.bookingService.getOneByOptions({
where: {
id: data.id,
const booking = await this.bookingService.getOneByOptions({
where: {
id: data.id,
},
relations: ['items'],
});
mappingTransaction(booking);
if (!couchData) {
await this.couchService.createDoc(
{
_id: booking.id,
...booking,
},
relations: ['items'],
});
mappingTransaction(booking);
if (!couchData) {
await this.couchService.createDoc(
{
_id: booking.id,
...booking,
},
'booking',
);
} else {
await this.couchService.updateDoc(
{
_id: booking.id,
...booking,
},
'booking',
);
}
'booking',
);
} else {
await this.couchService.updateDoc(
{
_id: booking.id,
...booking,
},
'booking',
);
}
}
// }
}
@EventsHandler(TransactionUpdatedEvent)