import { Injectable } from '@nestjs/common';
import { BaseUpdateManager } from 'src/core/modules/domain/usecase/managers/base-update.manager';
import { {{pascalCase name}}Entity } from '../../entities/{{dashCase name}}.entity';
import { {{pascalCase name}}Model } from '../../../data/models/{{dashCase name}}.model';
import { {{pascalCase name}}UpdatedEvent } from '../../entities/event/{{dashCase name}}-updated.event';
import { EventTopics, columnUniques, validateRelations } from 'src/core/strings/constants/interface.constants';

@Injectable()
export class Update{{pascalCase name}}Manager extends BaseUpdateManager<{{pascalCase name}}Entity> {
  async validateProcess(): Promise<void> {
    return;
  }

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

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

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

  get uniqueColumns(): columnUniques[] {
    return [];
  }

  get entityTarget(): any {
    return {{pascalCase name}}Model;
  }

  get eventTopics(): EventTopics[] {
    return [
      {
        topic: {{pascalCase name}}UpdatedEvent,
        data: this.data,
      },
    ];
  }
}
