<?php

namespace Alsendo\AlsendoWrapper\Api\Apaczka\Wrapper;

use Alsendo\AlsendoWrapper\Api\Apaczka\Model\Order\Valuation\ApaczkaOrderValuation;
use Alsendo\AlsendoWrapper\Model\Order\Valuation\PriceTableItem;

class ApaczkaOrderValuationWrapper
{
    /**
     * @param $serviceId
     * @param array $price
     * @return ApaczkaOrderValuation
     */
    public static function wrap($serviceId, array $price): ApaczkaOrderValuation
    {
        $apaczkaOrderValuation = new ApaczkaOrderValuation();
        $apaczkaOrderValuation->serviceId = $serviceId;

        $priceTable = new PriceTableItem();
        $priceTable->price = $price['price'];
        $priceTable->priceGross = $price['price_gross'];
        $apaczkaOrderValuation->priceTable = $priceTable;

        return $apaczkaOrderValuation;
    }
}