<?php

namespace App\Modules\HR\Contracts\Services;

use App\Modules\HR\Contracts\Models\ContractTemplate;
use App\Modules\HR\Contracts\Repositories\ContractTemplateRepository;

class ContractTemplateService
{
    public function __construct(private readonly ContractTemplateRepository $templates) {}

    /** @param array<string, mixed> $data */
    public function create(int $tenantId, array $data): ContractTemplate
    {
        return $this->templates->create(array_merge($data, ['tenant_id' => $tenantId]));
    }

    /** @param array<string, mixed> $data */
    public function update(ContractTemplate $template, array $data): ContractTemplate
    {
        return $this->templates->update($template, $data);
    }
}
