<?php

namespace KupShop\OrderingBundle\Entity\Purchase;

use KupShop\KupShopBundle\Util\Price\Price;
use KupShop\OrderingBundle\Util\Order\OrderItemInfo;

class ChargePurchaseItem extends AbstractPurchaseItem implements PurchaseItemInterface
{
    public $id_charge;
    public $id_discount;

    protected $type = OrderItemInfo::TYPE_CHARGE;

    public function __construct($name, Price $price, $id_charge, $id_discount = null, ?array $note = null)
    {
        $this->name = $name;
        $this->price = $price;
        $this->id_charge = $id_charge;
        $this->id_discount = $id_discount;
        $this->note = $note;
    }

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

    public function getPriceWithVat(): \Decimal
    {
        return $this->price->getPriceWithVat();
    }

    public function getPriceWithoutVat(): \Decimal
    {
        return $this->getPriceWithVat()->removeVat($this->price->getVat());
    }

    public function getIdDiscount()
    {
        return $this->id_discount;
    }

    public function getIdCharge()
    {
        return $this->id_charge;
    }
}
