<?php

namespace Planaday\Entities\Booking\DTO;

use ArrayAccess;
use Countable;
use Planaday\Entities\DatabaseID;
use Planaday\Utility\DataGrouping\Collection;
use Planaday\Utility\DataGrouping\Map;
use Traversable;

class BookingForm {
	use DatabaseID;

	protected int $courseId = 0;
	protected bool $termsAndConditions = false;
	protected bool $payWithInvoice = false;
	protected ?BookingCompany $company = null;
	/** @var ArrayAccess<int|string, int>&Traversable<int|string, int>&Countable */
	protected ArrayAccess&Traversable&Countable $materials;
	/** @var ArrayAccess<string, string|string[]>&Traversable<string, string|string[]>&Countable */
	protected ArrayAccess&Traversable&Countable $attributes;
	/** @var ArrayAccess<int|string, BookingStudent>&Traversable<int|string, BookingStudent>&Countable */
	protected ArrayAccess&Traversable&Countable $students;
	/** @var ArrayAccess<int|string, int>&Traversable<int|string, int>&Countable */
	protected ArrayAccess&Traversable&Countable $dayParts;
	protected ?string $voucherCode = null;
	protected ?int $companyId = null;
	protected ?string $nonce = null;

	public function __construct() {
		$this->materials = new Collection();
		$this->attributes = new Map();
		$this->students = new Collection();
		$this->dayParts = new Collection();
	}

	public function setCourseId( int $courseId ): self {
		$this->courseId = $courseId;

		return $this;
	}

	public function setTermsAndConditions( bool $termsAndConditions ): self {
		$this->termsAndConditions = $termsAndConditions;

		return $this;
	}

	public function setCompany( ?BookingCompany $company ): self {
		$this->company = $company;

		return $this;
	}

	/**
	 * @param ArrayAccess<int|string, int>&Traversable<int|string, int>&Countable $materials
	 *
	 * @return $this
	 */
	public function setMaterials( ArrayAccess&Traversable&Countable $materials ): self {
		$this->materials = $materials;

		return $this;
	}

	/**
	 * @param ArrayAccess<string, string|string[]>&Traversable<string, string|string[]>&Countable $attributes
	 *
	 * @return $this
	 */
	public function setAttributes( ArrayAccess&Traversable&Countable $attributes ): self {
		$this->attributes = $attributes;

		return $this;
	}

	/**
	 * @param ArrayAccess<int|string, BookingStudent>&Traversable<int|string, BookingStudent>&Countable $students
	 *
	 * @return $this
	 */
	public function setStudents( ArrayAccess&Traversable&Countable $students ): self {
		$this->students = $students;

		return $this;
	}

	/**
	 * @param ArrayAccess<int|string, int>&Traversable<int|string, int>&Countable $dayParts
	 *
	 * @return $this
	 */
	public function setDayParts(ArrayAccess&Traversable&Countable $dayParts): self {
		$this->dayParts = $dayParts;
		return $this;
	}

	public function setVoucherCode( ?string $voucherCode ): self {
		$this->voucherCode = $voucherCode;

		return $this;
	}

	public function setCompanyId( ?int $companyId): static {
		$this->companyId = $companyId;
		return $this;
	}

	public function setPayWithInvoice( bool $payWithInvoice ): static {
		$this->payWithInvoice = $payWithInvoice;
		return $this;
	}

	public function setNonce( ?string $nonce ): static {
		$this->nonce = $nonce;
		return $this;
	}

	public function getNonce(): ?string {
		return $this->nonce;
	}

	public function getCourseId(): int {
		return $this->courseId;
	}

	/**
	 * @return ArrayAccess<int>&Traversable<int>&Countable
	 */
	public function getMaterials(): ArrayAccess&Traversable&Countable{
		return $this->materials;
	}

	public function getCompany(): ?BookingCompany {
		return $this->company;
	}

	public function getCompanyId(): ?int {
		return $this->companyId;
	}

	/**
	 * @return ArrayAccess<string, string|string[]>&Traversable<string, string|string[]>&Countable
	 */
	public function getAttributes(): ArrayAccess&Traversable&Countable{
		return $this->attributes;
	}

	/**
	 * @return ArrayAccess<BookingStudent>&Traversable<BookingStudent>&Countable
	 */
	public function getStudents(): ArrayAccess&Traversable&Countable{
		return $this->students;
	}

	public function isTermsAndConditions(): bool {
		return $this->termsAndConditions;
	}

	/**
	 * @return ArrayAccess<int>&Traversable<int>&Countable
	 */
	public function getDayParts(): ArrayAccess&Traversable&Countable{
		return $this->dayParts;
	}

	public function getVoucherCode(): ?string {
		return $this->voucherCode;
	}

	public function getPayWithInvoice(): bool {
		return $this->payWithInvoice;
	}
}