<?php

namespace App\Listeners;

use App\Modules\SalesChannels\Carzone;

class AddCarzoneDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly Carzone $carzone)
    {
        //
    }

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