<?php

namespace KupShop\BalikonosBundle\BalikobotAdapters;

class BalikobotToptransAdapter implements IBalikobotAdapter
{
    public function transformOrderData(\Order $order, array $data, array &$custom_data): array
    {
        // Manipulační jednotka = Kus
        $data['mu_type_one'] = 'KUS';

        $pieces_count = $custom_data['packages'] ?? 1;
        if ($pieces_count > 1) {
            $data['pieces_count_one'] = $pieces_count;
            $custom_data['packages'] = 1;
        }

        return $data;
    }
}
