<?php

namespace App\Modules\HR\Recruitment\Repositories;

use App\Modules\HR\Recruitment\Models\RecruitmentOfferLetterAttachment;

class RecruitmentOfferLetterAttachmentRepository
{
    /** @param  array<string, mixed>  $data */
    public function create(array $data): RecruitmentOfferLetterAttachment
    {
        return RecruitmentOfferLetterAttachment::query()->create($data);
    }

    public function softDelete(RecruitmentOfferLetterAttachment $row): void
    {
        $row->delete();
    }

    public function findForTenant(int $tenantId, int $id): ?RecruitmentOfferLetterAttachment
    {
        return RecruitmentOfferLetterAttachment::query()
            ->where('tenant_id', $tenantId)
            ->whereKey($id)
            ->first();
    }
}
