<?php

namespace App\Listeners;

use App\Modules\SalesChannels\CarGuru;

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

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