<?php

namespace App\Listeners;

use App\Modules\Stock\Motors;

class AddMotorsDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(private readonly Motors $motors)
    {
        //
    }

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