<?php

namespace Alsendo\AlsendoWrapper\Api\Ecolet\Model;


use Alsendo\AlsendoWrapper\Json;
use Alsendo\AlsendoWrapper\Model\Service\Service;
use Alsendo\AlsendoWrapper\Model\Service\ServiceStructure;


class EcoletServiceStructure extends ServiceStructure
{
    public static function getPropertyTypeMap(): array
    {
        return [
            'services' => [
                'mappedTo' => 'services',
                'type' => Service::class,
                'mapFields' => [
                    'id' => 'service_id',
                    'slug' => 'slug',
                    'full_name' => 'name',
                    'code_name' => 'codeName',
                    'name' => 'name_null',
                    'status' => ['mappedTo' => 'status', 'convert' => Json::BOOLEAN],
                    'is_new' => ['mappedTo' => 'isNew', 'convert' => Json::BOOLEAN],
                    'is_promo' => ['mappedTo' => 'isPromo', 'convert' => Json::BOOLEAN],
                    'courier' => [
                        'mappedTo' => 'courier',
                        'type' => ServiceCourier::class,
                        'mapFields' => [
                            'id' => 'id',
                            'slug' => 'slug',
                            'name' => 'name',
                            'status' => ['mappedTo' => 'status', 'convert' => Json::BOOLEAN],
                        ]
                    ],
                    'conditions' => [
                        'mappedTo' => 'conditions',
                        'type' => Conditions::class,
                        'mapFields' => [
                            "has_pickup_only_today" => ['mappedTo' => 'hasPickupOnlyToday', 'convert' => Json::BOOLEAN],
                            "has_multipacks" => ['mappedTo' => 'hasMultipacks', 'convert' => Json::BOOLEAN],
                            "has_cod" => ['mappedTo' => 'hasCod', 'convert' => Json::BOOLEAN],
                            "has_open_package" => ['mappedTo' => 'hasOpenPackage', 'convert' => Json::BOOLEAN],
                            "has_rod" => ['mappedTo' => 'hasRod', 'convert' => Json::BOOLEAN],
                            "has_rop" => ['mappedTo' => 'hasRop', 'convert' => Json::BOOLEAN],
                            "has_saturday_delivery" => ['mappedTo' => 'hasSaturdayDelivery', 'convert' => Json::BOOLEAN],
                            "has_sms_notify" => ['mappedTo' => 'hasSmsNotify', 'convert' => Json::BOOLEAN],
                            "has_swap" => ['mappedTo' => 'hasSwap', 'convert' => Json::BOOLEAN],
                        ]
                    ]
                ]
            ],
        ];
    }
}