fix(SPG-745) Data booking status active dan settled (tipe pembayaran selain counter) belum masuk PoS
parent
239e2d778a
commit
8eee99fce5
|
@ -38,8 +38,12 @@ export class BookingHandler
|
||||||
const old_data = event.data.old;
|
const old_data = event.data.old;
|
||||||
const data = event.data.data;
|
const data = event.data.data;
|
||||||
|
|
||||||
if (data.payment_type != TransactionPaymentType.COUNTER) return;
|
if (
|
||||||
|
data.payment_type == TransactionPaymentType.COUNTER ||
|
||||||
|
([STATUS.ACTIVE, STATUS.SETTLED].includes(data.status) &&
|
||||||
|
data.payment_type != TransactionPaymentType.COUNTER)
|
||||||
|
) {
|
||||||
|
console.log(data, 'data', old_data);
|
||||||
const booking = await this.bookingService.getOneByOptions({
|
const booking = await this.bookingService.getOneByOptions({
|
||||||
where: {
|
where: {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
@ -50,9 +54,11 @@ export class BookingHandler
|
||||||
mappingTransaction(booking);
|
mappingTransaction(booking);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
old_data?.status != data.status &&
|
(old_data?.status != data.status ||
|
||||||
[STATUS.PENDING, STATUS.ACTIVE].includes(data.status)
|
data.payment_type != TransactionPaymentType.COUNTER) &&
|
||||||
|
[STATUS.PENDING, STATUS.ACTIVE, STATUS.SETTLED].includes(data.status)
|
||||||
) {
|
) {
|
||||||
|
console.log('here');
|
||||||
await this.couchService.createDoc(
|
await this.couchService.createDoc(
|
||||||
{
|
{
|
||||||
_id: booking.id,
|
_id: booking.id,
|
||||||
|
@ -71,3 +77,4 @@ export class BookingHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue