<?php

namespace Modules\Mall\Listeners;

use Illuminate\Contracts\Queue\ShouldQueue;
use Modules\Mall\Events\OrderCreated;
use Modules\Mall\Jobs\CloseOrder;

class OrderCreatedListener implements ShouldQueue
{

    public string $queue = 'LISTENER';

    /**
     * Handle the event.
     * @param  OrderCreated  $event
     * @return void
     */
    public function handle(OrderCreated $event): void
    {
        CloseOrder::dispatch($event->order);
    }

}
