<?php

namespace App\Listeners;

use App\Crm\SendToEnquiryMax;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class AddEnquiryMaxDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly SendToEnquiryMax $enquiryMax)
    {
        //
    }

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