<?php
declare (strict_types=1);

namespace App\ApiResources\Dolibarr;

use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use App\ApiResources\ApiResourcesInterface;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * Bill of a society, retrieved from dolibarr
 */
#[ApiResource(
    operations: [
        new Get()
    ]
)]
class DolibarrBill implements ApiResourcesInterface
{
    /**
     * Id of the dolibarr bill ( = invoice)
     */
    #[ApiProperty(identifier: true)]
    #[Groups('dolibarr_get')]
    private int $id;

    /**
     * Bill reference
     */
    #[Groups('dolibarr_get')]
    private string $ref;

    /**
     * Date of the bill
     */
    #[Groups('dolibarr_get')]
    private \DateTime $date;

    /**
     * Amount (tax excluded)
     */
    #[Groups('dolibarr_get')]
    private float $taxExcludedAmount;

    /**
     * Amount (tax included)
     */
    #[Groups('dolibarr_get')]
    private float $taxIncludedAmount;

    /**
     * Is the bill paid or not
     */
    #[Groups('dolibarr_get')]
    private bool $paid;

    public function getId(): int
    {
        return $this->id;
    }

    public function setId(int $id): self
    {
        $this->id = $id;
        return $this;
    }

    public function getRef(): string
    {
        return $this->ref;
    }

    public function setRef(string $ref): self
    {
        $this->ref = $ref;
        return $this;
    }

    public function getDate(): \DateTime
    {
        return $this->date;
    }

    public function setDate(\DateTime $date): self
    {
        $this->date = $date;
        return $this;
    }

    /**
     * @return float
     */
    public function getTaxExcludedAmount(): float
    {
        return $this->taxExcludedAmount;
    }

    /**
     * @param float $taxExcludedAmount
     */
    public function setTaxExcludedAmount(float $taxExcludedAmount): self
    {
        $this->taxExcludedAmount = $taxExcludedAmount;
        return $this;
    }

    /**
     * @return float
     */
    public function getTaxIncludedAmount(): float
    {
        return $this->taxIncludedAmount;
    }

    /**
     * @param float $taxIncludedAmount
     */
    public function setTaxIncludedAmount(float $taxIncludedAmount): self
    {
        $this->taxIncludedAmount = $taxIncludedAmount;
        return $this;
    }

    public function getPaid(): bool
    {
        return $this->paid;
    }

    public function setPaid(bool $paid): self
    {
        $this->paid = $paid;
        return $this;
    }
}
