<?php

namespace Lc\SovBundle\Factory\Ticket;

use App\Entity\Ticket\Ticket;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\Ticket\TicketInterface;
use Lc\SovBundle\Model\Ticket\TicketModel;

class TicketFactory extends AbstractFactory implements TicketFactoryInterface
{
    public function create(): TicketInterface
    {
        $ticket = new Ticket();

        $ticketMessageFactory = new TicketMessageFactory();
        $ticketMessage = $ticketMessageFactory->create($ticket) ;

        $ticket->setStatus(TicketModel::TICKET_STATUS_OPEN);
        $ticket->addTicketMessage($ticketMessage) ;

        return $ticket;
    }
}
