<?php

namespace Planaday\Entities\Booking\DTO;

use Planaday\Entities\Booking\Enum\BookingStatus;
use Planaday\Entities\DatabaseID;

class Booking {
	use DatabaseID;

	protected ?string $bookingId = null;
	protected ?BookingForm $bookingForm = null;
	protected BookingStatus $bookingStatus = BookingStatus::Pending;
	protected ?Transaction $transaction = null;

	public function setBookingId( ?string $bookingId ): self {
		$this->bookingId = $bookingId;

		return $this;
	}

	public function setBookingForm( BookingForm $bookingForm ): self {
		$this->bookingForm = $bookingForm;

		return $this;
	}

	public function setBookingStatus( BookingStatus $bookingStatus ): self {
		$this->bookingStatus = $bookingStatus;

		return $this;
	}

	public function setTransaction( ?Transaction $transaction ): self {
		$this->transaction = $transaction;

		return $this;
	}

	public function getBookingId(): ?string {
		return $this->bookingId;
	}

	public function getBookingForm(): BookingForm {
		if ( $this->bookingForm === null ) {
			$this->bookingForm = new BookingForm();
		}

		return $this->bookingForm;
	}

	public function getBookingStatus(): BookingStatus {
		return $this->bookingStatus;
	}

	public function getTransaction(): ?Transaction {
		return $this->transaction;
	}
}