<?php

namespace App\Listeners;

use App\Modules\SalesChannels\CarGuru;

class AddCarGuruDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private CarGuru $carGuru)
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object  $event
     * @return array
     */
    public function handle($event)
    {
        if ($this->carGuru->enabled() == false) {
            return [];
        }
        return $this->carGuru->dealershipAdditionalDataFields();
    }
}
