<?php
namespace App\ImportedOrder;

/**
 * The class stores info about SSR
 * @author Oana Stan
 */
class Itinerary_SSRRecord extends EntityAbstract
{
	/**
	 * The SSR category (Eg: MEAL)
	 * @var String
	 */
	public $category;

	/**
	 * The SSR code
	 * @var String
	 */
	public $code;

	/**
	 * The SSR description
	 * @var String
	 */
	public $description;

	/**
	 * The SSR free text in the external system
	 * @var String
	 */
	public $freeText;

	/**
	 * (non-PHPdoc)
	 * @see \App\ImportedOrder\EntityAbstract::validateEntityFields()
	 */
	protected function validateEntityFields(\App\MessagesCollector $messagesCollector): void
	{
		// check code
		if (!$this->code) {
			$messagesCollector->addError('The SSR record does not have a correct code attached.');
		}
	}
}