<?php

namespace App\Listeners;

use App\Crm\SendToRapidRTC;
use App\Modules\Sales\Services\SilverBullet;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class AddSilverBulletDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private SilverBullet $service)
    {
        //
    }

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