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
continuous-integration/drone/tag Build is passing
Details
Reviewed-on: #58pull/59/head devel_20.1.15
commit
1d8a3d7ff9
|
@ -91,36 +91,36 @@ export class ChangeStatusBookingHandler
|
||||||
const isFromCounter = data.payment_type == TransactionPaymentType.COUNTER;
|
const isFromCounter = data.payment_type == TransactionPaymentType.COUNTER;
|
||||||
const dataID = data?.id;
|
const dataID = data?.id;
|
||||||
|
|
||||||
if (!isFromCounter) {
|
// if (!isFromCounter) {
|
||||||
const couchData = await this.couchService.getDoc(dataID, 'booking');
|
const couchData = await this.couchService.getDoc(dataID, 'booking');
|
||||||
|
|
||||||
const booking = await this.bookingService.getOneByOptions({
|
const booking = await this.bookingService.getOneByOptions({
|
||||||
where: {
|
where: {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
},
|
||||||
|
relations: ['items'],
|
||||||
|
});
|
||||||
|
mappingTransaction(booking);
|
||||||
|
|
||||||
|
if (!couchData) {
|
||||||
|
await this.couchService.createDoc(
|
||||||
|
{
|
||||||
|
_id: booking.id,
|
||||||
|
...booking,
|
||||||
},
|
},
|
||||||
relations: ['items'],
|
'booking',
|
||||||
});
|
);
|
||||||
mappingTransaction(booking);
|
} else {
|
||||||
|
await this.couchService.updateDoc(
|
||||||
if (!couchData) {
|
{
|
||||||
await this.couchService.createDoc(
|
_id: booking.id,
|
||||||
{
|
...booking,
|
||||||
_id: booking.id,
|
},
|
||||||
...booking,
|
'booking',
|
||||||
},
|
);
|
||||||
'booking',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await this.couchService.updateDoc(
|
|
||||||
{
|
|
||||||
_id: booking.id,
|
|
||||||
...booking,
|
|
||||||
},
|
|
||||||
'booking',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventsHandler(TransactionUpdatedEvent)
|
@EventsHandler(TransactionUpdatedEvent)
|
||||||
|
|
Loading…
Reference in New Issue