<?php

namespace App\Modules\Admin\Tenancy\Listeners;

use App\Modules\Admin\Tenancy\Events\TenantSubscriptionAffected;
use App\Modules\Admin\Tenancy\Services\ModuleAccessService;

class ForgetTenantModuleCache
{
    public function __construct(
        private readonly ModuleAccessService $moduleAccess,
    ) {}

    public function handle(TenantSubscriptionAffected $event): void
    {
        $this->moduleAccess->forgetTenant($event->tenant);
    }
}
