import { Injectable } from '@nestjs/common'; import { BaseUpdateManager } from 'src/core/modules/domain/usecase/managers/base-update.manager'; import { PaymentMethodEntity } from '../../entities/payment-method.entity'; import { PaymentMethodModel } from '../../../data/models/payment-method.model'; import { PaymentMethodUpdatedEvent } from '../../entities/event/payment-method-updated.event'; import { EventTopics, columnUniques, validateRelations, } from 'src/core/strings/constants/interface.constants'; @Injectable() export class UpdatePaymentMethodManager extends BaseUpdateManager { async validateProcess(): Promise { return; } async beforeProcess(): Promise { return; } async afterProcess(): Promise { return; } get validateRelations(): validateRelations[] { return []; } get uniqueColumns(): columnUniques[] { // return [{ column: 'account_number' }, { column: 'account_name' }]; return [ { column: 'account_number', query: { account_name: this.data.account_name, type: this.data.type }, }, ]; } get entityTarget(): any { return PaymentMethodModel; } get eventTopics(): EventTopics[] { return [ { topic: PaymentMethodUpdatedEvent, }, ]; } }