<?php
namespace WorkbloomERP\Module\v0\Contato\Factories;

use WorkbloomERP\Services\DBService;
use WorkbloomERP\Module\v0\Empresa\Repos\EmpresaRepo;
use WorkbloomERP\Module\v0\Contato\Repos\ContatoRepo;
use WorkbloomERP\Module\v0\Empresa\Models\EmpresaModel;
use WorkbloomERP\Module\v0\Contato\DTOs\ContatoCreateDTO;
use WorkbloomERP\Module\v0\Contato\Services\ContatoService;

class ContatoServiceFactory {
    public static function makeContatoService(): ContatoService {
        $db = new DBService();
        return new ContatoService(
            db: $db,
            contatoRepo: new ContatoRepo(db: $db),
            empresaRepo: new EmpresaRepo(db: $db),
        );
    }

    public static function makeContratoFactory(EmpresaModel $empresaModel, ContatoCreateDTO $contatoCreateDTO): ContatoFactory {
        $db = new DBService();
        return new ContatoFactory(
            db: $db,
            empresaModel: $empresaModel,
            contatoCreateDTO: $contatoCreateDTO,
            contatoRepo: new ContatoRepo(db: $db),
            empresaRepo: new EmpresaRepo(db: $db),
        );
    }
}