<?php

declare(strict_types=1);

namespace App\Repositories\QzCertificate;

use App\Models\QzCertificate;

interface QzCertificateRepositoryInterface
{
    /**
     * Get the active certificate.
     */
    public function getActive(): ?QzCertificate;

    /**
     * Find a certificate by name.
     */
    public function findByName(string $name): ?QzCertificate;

    /**
     * Create a new certificate record.
     */
    public function create(array $data): QzCertificate;

    /**
     * Update an existing certificate record.
     */
    public function update(QzCertificate $certificate, array $data): bool;

    /**
     * Delete a certificate record.
     */
    public function delete(QzCertificate $certificate): bool;

    /**
     * Mark all other certificates as inactive/deleted when a new active one is generated.
     */
    public function deactivateOthers(int $activeId): void;
}
