<?php

namespace Simplyin\Simplyin_W_Plugin\Shipping_Mapping\Integration\Dhl_Polska;

class Dhl_Polska_Parcel_Point_Integration extends Abstract_Dhl_Polska_Integration {

	private const LOGISTIC_PROVIDER = 'dhl';

	private string $method_id;
	private int $instance_id;
	private string $title;

	public function __construct(
		string $method_id,
		int $instance_id,
		string $title
	) {
		$this->method_id   = $method_id;
		$this->title       = $title;
		$this->instance_id = $instance_id;
	}

	public function get_method(): string {
		return $this->method_id;
	}

	public function get_instance_id(): int {
		return $this->instance_id;
	}

	public function get_paired_method(): ?string {
		return null;
	}

	public function get_paired_logistic_plugin(): ?string {
		return null;
	}

	public function get_logistic_provider(): ?string {
		return self::LOGISTIC_PROVIDER;
	}

	public function get_title(): string {
		return $this->title;
	}

	public function to_array(): array {
		return [
			'methodId'         => $this->get_method(),
			'instanceId'       => $this->get_instance_id(),
			'title'            => $this->get_title(),
			'pairedMethod'     => $this->get_paired_method(),
			'logisticProvider' => $this->get_logistic_provider(),
			'logisticPlugin'   => $this->get_logistic_plugin(),
		];
	}
}
