<?php

namespace App\Listeners;

use App\District;
use App\Events\ResidentialComplexCache;
use App\ResidentialComplex;
use Illuminate\Support\Facades\Cache;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class ResidentialComplexCacheRemove
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
    }

    /**
     * Handle the event.
     *
     * @param  ResidentialComplexCache  $event
     * @return void
     */
    public function handle(ResidentialComplexCache $event)
    {
        Cache::forget(ResidentialComplex::CACHE_KEY_MAIN_PAGE_RESULT);
        Cache::forget(ResidentialComplex::CACHE_KEY_MAIN_PAGE_COUNT);

        Cache::forget(District::CACHE_KEY_MAIN_PAGE_RESULT);
        Cache::forget(District::CACHE_KEY_MAIN_PAGE_COUNT);
    }
}
