<?php

namespace Planaday\Entities\Voucher\DTO;

use DateTime;
use Planaday\Entities\Voucher\VoucherType;

class Voucher {
	protected string $code = '';
	protected VoucherType $type = VoucherType::Percentage;
	protected float $amount = 0;
	protected bool $forCourseTemplate = false;
	protected int $courseTemplate = 0;
	protected ?DateTime $validUntil = null;
	protected ?int $available = null;

	public function getCode(): string {
		return $this->code;
	}

	public function setCode( string $code ): static {
		$this->code = $code;

		return $this;
	}

	public function getType(): VoucherType {
		return $this->type;
	}

	public function setType( VoucherType $type ): static {
		$this->type = $type;

		return $this;
	}

	public function getAmount(): float {
		return $this->amount;
	}

	public function setAmount( float $amount ): static {
		$this->amount = $amount;

		return $this;
	}

	public function isForCourseTemplate(): bool {
		return $this->forCourseTemplate;
	}

	public function setForCourseTemplate( bool $forCourseTemplate ): static {
		$this->forCourseTemplate = $forCourseTemplate;

		return $this;
	}

	public function getCourseTemplate(): int {
		return $this->courseTemplate;
	}

	public function setCourseTemplate( int $courseTemplate ): static {
		$this->courseTemplate = $courseTemplate;

		return $this;
	}

	public function getAvailable(): ?int {
		return $this->available;
	}

	public function setAvailable( int $available ): static {
		$this->available = $available;

		return $this;
	}

	public function getValidUntil(): ?DateTime {
		return $this->validUntil;
	}

	public function setValidUntil( ?DateTime $validUntil ): static {
		$this->validUntil = $validUntil;
		return $this;
	}
}