Merge branch 'development' of ssh://git.eigen.co.id:2222/eigen/pos-be into fix/bug-firman
commit
f8618ec0cd
|
@ -3,7 +3,6 @@ import { TransactionDataService } from 'src/modules/transaction/transaction/data
|
||||||
import { TransactionChangeStatusEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-change-status.event';
|
import { TransactionChangeStatusEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-change-status.event';
|
||||||
import { CouchService } from '../../data/services/couch.service';
|
import { CouchService } from '../../data/services/couch.service';
|
||||||
// import { STATUS } from 'src/core/strings/constants/base.constants';
|
// import { STATUS } from 'src/core/strings/constants/base.constants';
|
||||||
import { TransactionPaymentType } from 'src/modules/transaction/transaction/constants';
|
|
||||||
import { mappingTransaction } from 'src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper';
|
import { mappingTransaction } from 'src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper';
|
||||||
import { TransactionDeletedEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-deleted.event';
|
import { TransactionDeletedEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-deleted.event';
|
||||||
import { TransactionUpdatedEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-updated.event';
|
import { TransactionUpdatedEvent } from 'src/modules/transaction/transaction/domain/entities/event/transaction-updated.event';
|
||||||
|
@ -88,10 +87,9 @@ export class ChangeStatusBookingHandler
|
||||||
|
|
||||||
async handle(event: TransactionChangeStatusEvent) {
|
async handle(event: TransactionChangeStatusEvent) {
|
||||||
const data = event.data.data;
|
const data = event.data.data;
|
||||||
const isFromCounter = data.payment_type == TransactionPaymentType.COUNTER;
|
|
||||||
const dataID = data?.id;
|
const dataID = data?.id;
|
||||||
|
|
||||||
// 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({
|
||||||
|
@ -120,7 +118,6 @@ export class ChangeStatusBookingHandler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventsHandler(TransactionUpdatedEvent)
|
@EventsHandler(TransactionUpdatedEvent)
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { TransactionModel } from '../../../data/models/transaction.model';
|
||||||
import { mappingRevertTransaction } from '../managers/helpers/mapping-transaction.helper';
|
import { mappingRevertTransaction } from '../managers/helpers/mapping-transaction.helper';
|
||||||
import { apm } from '../../../../../../core/apm';
|
import { apm } from '../../../../../../core/apm';
|
||||||
import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
|
import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
|
||||||
import { TransactionUpdatedEvent } from '../../entities/event/transaction-updated.event';
|
import { TransactionChangeStatusEvent } from '../../entities/event/transaction-change-status.event';
|
||||||
|
|
||||||
@EventsHandler(ChangeDocEvent)
|
@EventsHandler(ChangeDocEvent)
|
||||||
export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
|
@ -96,7 +96,7 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||||
*/
|
*/
|
||||||
if (data.status == STATUS.PENDING) {
|
if (data.status == STATUS.PENDING) {
|
||||||
this.eventBus.publish(
|
this.eventBus.publish(
|
||||||
new TransactionUpdatedEvent({
|
new TransactionChangeStatusEvent({
|
||||||
id: data.id,
|
id: data.id,
|
||||||
old: event.data.data,
|
old: event.data.data,
|
||||||
data: data,
|
data: data,
|
||||||
|
|
Loading…
Reference in New Issue