<?php
/**
 * @author Daniel Knudsen <d.knudsen@spawntree.de>
 * @date 11.07.22
 */


class Product
{
    const VAT = 0.19;

    private $id;
    private $standardSalesPrice;
    private $salesVatCode;
    private $salesVatCodeDescription;
    private $description;
    private $extraDescription;
    private $isWebShopItem;
    private $itemGroup;
    private $itemGroupCode;
    private $stock;
    private $netWeight;
    private $grossWeight;
    private $code;

    public static function getFields()
    {
        return [
            'ID',
            'StandardSalesPrice',
            'SalesVatCode',
            'SalesVatCodeDescription',
            'Description',
            'ExtraDescription',
            'IsWebshopItem',
            'ItemGroup',
            'ItemGroupCode',
            'Stock',
            'NetWeight',
            'GrossWeight',
            'Code',
        ];
    }

    public static function createProductFromApiItem(array $item)
    {
        $res = new self();
        $res->setId($item['ID']);
        $res->setStandardSalesPrice($item['StandardSalesPrice']);
        $res->setSalesVatCode($item['SalesVatCode']);
        $res->setSalesVatCodeDescription($item['SalesVatCodeDescription']);
        $res->setDescription($item['Description']);
        $res->setExtraDescription($item['ExtraDescription']);
        $res->setIsWebShopItem($item['IsWebshopItem']);
        $res->setItemGroup($item['ItemGroup']);
        $res->setItemGroupCode($item['ItemGroupCode']);
        $res->setStock($item['Stock']);
        $res->setNetWeight($item['NetWeight']);
        $res->setGrossWeight($item['GrossWeight']);
        $res->setCode($item['Code']);
        return $res;
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getStandardSalesPrice()
    {
        return $this->standardSalesPrice;
    }

    /**
     * @param mixed $standardSalesPrice
     */
    public function setStandardSalesPrice($standardSalesPrice)
    {
        $this->standardSalesPrice = $standardSalesPrice;
    }

    /**
     * @return mixed
     */
    public function getSalesVatCode()
    {
        return $this->salesVatCode;
    }

    /**
     * @param mixed $salesVatCode
     */
    public function setSalesVatCode($salesVatCode)
    {
        $this->salesVatCode = $salesVatCode;
    }

    /**
     * @return mixed
     */
    public function getSalesVatCodeDescription()
    {
        return $this->salesVatCodeDescription;
    }

    /**
     * @param mixed $salesVatCodeDescription
     */
    public function setSalesVatCodeDescription($salesVatCodeDescription)
    {
        $this->salesVatCodeDescription = $salesVatCodeDescription;
    }

    /**
     * @return mixed
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @param mixed $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

    /**
     * @return mixed
     */
    public function getExtraDescription()
    {
        return $this->extraDescription;
    }

    /**
     * @param mixed $extraDescription
     */
    public function setExtraDescription($extraDescription)
    {
        $this->extraDescription = $extraDescription;
    }

    /**
     * @return mixed
     */
    public function getIsWebShopItem()
    {
        return $this->isWebShopItem;
    }

    /**
     * @param mixed $isWebShopItem
     */
    public function setIsWebShopItem($isWebShopItem)
    {
        $this->isWebShopItem = $isWebShopItem;
    }

    /**
     * @return mixed
     */
    public function getItemGroup()
    {
        return $this->itemGroup;
    }

    /**
     * @param mixed $itemGroup
     */
    public function setItemGroup($itemGroup)
    {
        $this->itemGroup = $itemGroup;
    }

    /**
     * @return mixed
     */
    public function getItemGroupCode()
    {
        return $this->itemGroupCode;
    }

    /**
     * @param mixed $itemGroupCode
     */
    public function setItemGroupCode($itemGroupCode)
    {
        $this->itemGroupCode = $itemGroupCode;
    }

    /**
     * @return mixed
     */
    public function getStock()
    {
        return $this->stock;
    }

    /**
     * @param mixed $stock
     */
    public function setStock($stock)
    {
        $this->stock = $stock;
    }

    /**
     * @return mixed
     */
    public function getNetWeight()
    {
        return $this->netWeight;
    }

    /**
     * @param mixed $netWeight
     */
    public function setNetWeight($netWeight)
    {
        $this->netWeight = $netWeight;
    }

    /**
     * @return mixed
     */
    public function getGrossWeight()
    {
        return $this->grossWeight;
    }

    /**
     * @param mixed $grossWeight
     */
    public function setGrossWeight($grossWeight)
    {
        $this->grossWeight = $grossWeight;
    }

    /**
     * @return mixed
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @param mixed $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }
}