import { Injectable } from '@nestjs/common';
import { BaseUpdateStatusManager } from 'src/core/modules/domain/usecase/managers/base-update-status.manager';
import { PaymentMethodEntity } from '../../entities/payment-method.entity';
import {
  EventTopics,
  validateRelations,
} from 'src/core/strings/constants/interface.constants';
import { PaymentMethodModel } from '../../../data/models/payment-method.model';
import { PaymentMethodChangeStatusEvent } from '../../entities/event/payment-method-change-status.event';

@Injectable()
export class ConfirmPaymentMethodManager extends BaseUpdateStatusManager<PaymentMethodEntity> {
  getResult(): string {
    return `Success active data ${this.result.account_name}`;
  }

  async validateProcess(): Promise<void> {
    return;
  }

  async beforeProcess(): Promise<void> {
    return;
  }

  async afterProcess(): Promise<void> {
    return;
  }

  get validateRelations(): validateRelations[] {
    return [];
  }

  get entityTarget(): any {
    return PaymentMethodModel;
  }

  get eventTopics(): EventTopics[] {
    return [
      {
        topic: PaymentMethodChangeStatusEvent,
        data: this.result,
      },
    ];
  }
}
