<?php

declare(strict_types=1);

namespace App\Observers;

use App\Models\HomepageAnnouncement;
use App\Services\HomepageAnnouncementService;

class HomepageAnnouncementObserver
{
    public function saved(HomepageAnnouncement $announcement): void
    {
        app(HomepageAnnouncementService::class)->clearActiveCache();
    }

    public function deleted(HomepageAnnouncement $announcement): void
    {
        app(HomepageAnnouncementService::class)->clearActiveCache();
    }

    public function restored(HomepageAnnouncement $announcement): void
    {
        app(HomepageAnnouncementService::class)->clearActiveCache();
    }

    public function forceDeleted(HomepageAnnouncement $announcement): void
    {
        app(HomepageAnnouncementService::class)->clearActiveCache();
    }
}