<?php

namespace Opencart\Extension\Alsendo\Providers;

class DefaultCarrierPickupPointsProvider
{
    public function getDefinitions(string $regionCode): array
    {
        if ($regionCode === 'poland') {
            return $this->getPolishDefinitions();
        }

         if ($regionCode === 'czechia') {
            return $this->getCzechDefinitions();
        }

         if ($regionCode === 'romania') {
            return $this->getRomanianDefinitions();
        }

        return [];
    }

    public function getPolishDefinitions(): array
    {
        return [
            ['key' => 'inpost', 'label_key' => 'text_default_point_inpost', 'selector' => 'inpost'],
            ['key' => 'dhl', 'label_key' => 'text_default_point_dhl', 'selector' => 'dhl'],
            ['key' => 'poczta_polska', 'label_key' => 'text_default_point_poczta_polska', 'selector' => 'poczta-polska'],
            ['key' => 'dpd', 'label_key' => 'text_default_point_dpd', 'selector' => 'dpd'],
            ['key' => 'ups', 'label_key' => 'text_default_point_ups', 'selector' => 'ups'],
        ];
    }

    public function getCzechDefinitions(): array
    {
        return [
            ['key' => 'balikovna', 'label_key' => 'text_default_point_balikovna', 'selector' => 'balikovna'],
            ['key' => 'dpd', 'label_key' => 'text_default_point_dpd', 'selector' => 'dpd'],
            ['key' => 'gls', 'label_key' => 'text_default_point_gls', 'selector' => 'gls'],
            ['key' => 'ppl', 'label_key' => 'text_default_point_ppl', 'selector' => 'ppl'],
            ['key' => 'zasilkovna', 'label_key' => 'text_default_point_zasilkovna', 'selector' => 'zasilkovna'],
        ];
    }

    public function getRomanianDefinitions(): array
    {
        return [
            ['key' => 'dpd', 'label_key' => 'text_default_point_dpd', 'selector' => 'dpd'],
            ['key' => 'sameday', 'label_key' => 'text_default_point_sameday', 'selector' => 'sameday'],
            ['key' => 'fan_courier', 'label_key' => 'text_default_point_fan_courier', 'selector' => 'fan-courier'],
            ['key' => 'cargus', 'label_key' => 'text_default_point_cargus', 'selector' => 'cargus'],
            ['key' => 'gls', 'label_key' => 'text_default_point_gls', 'selector' => 'gls'],
        ];
    }
}
