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


@Injectable()
export class Create{{pascalCase name}}Manager extends BaseCreateManager<{{pascalCase name}}Entity> {
    async beforeProcess(): Promise<void> {
        return;
    }

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

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

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

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

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