<?php

namespace Planaday\Entities\Booking\DTO;

use Planaday\Entities\DatabaseID;

class BookingCompany {
	use DatabaseID;

	protected string $name = '';
	protected ?Address $address = null;
	protected string $email = '';
	protected ?string $phoneNumber = null;
	protected ?BookingInvoice $invoice = null;
	protected ?ContactPerson $contactPerson = null;

	public function setName( string $name ): static {
		$this->name = $name;

		return $this;
	}

	public function setAddress( ?Address $address ): static {
		$this->address = $address;

		return $this;
	}

	public function setEmail( string $email ): static {
		$this->email = $email;

		return $this;
	}

	public function setPhoneNumber( ?string $phoneNumber ): static {
		$this->phoneNumber = $phoneNumber;

		return $this;
	}

	public function setInvoice( ?BookingInvoice $invoice ): static {
		$this->invoice = $invoice;

		return $this;
	}
	
	public function setContactPerson( ?ContactPerson $contactPerson ): static {
		$this->contactPerson = $contactPerson;
		
		return $this;
	}

	public function getName(): string {
		return $this->name;
	}

	public function getAddress(): Address {
		if ( $this->address === null ) {
			$this->address = new Address();
		}
		return $this->address;
	}

	public function getEmail(): string {
		return $this->email;
	}

	public function getPhoneNumber(): ?string {
		return $this->phoneNumber;
	}

	public function getInvoice(): ?BookingInvoice {
		return $this->invoice;
	}

	public function getContactPerson(): ?ContactPerson {
		return $this->contactPerson;
	}
}