<?php
/**
 * Pickup point validators factory for checkout blocks.
 *
 * @package DhlPolska\CheckoutBlocks
 */

namespace DhlPolska\CheckoutBlocks;

use DhlPolska\Integration\FlexibleShipping\FlexibleShippingIntegration;
use DhlPolska\Shipment\DhlServices;
use DhlPolska\Shipment\ShipmentData;
use DhlPolska\ShippingMethod\DhlInstanceSettings;
use DhlPolska\ShippingMethod\DhlShippingMethod;
use DhlPolskaVendor\Octolize\Blocks\PickupPoint\PickupPointValidatorForFsIntegration;
use DhlPolskaVendor\Octolize\Blocks\PickupPoint\PickupPointValidatorForShippingMethod;

class PickupPointValidatorsFactory {

	/**
	 * @return array<object>
	 */
	public function get_validators(): array {
		$error_message = sprintf(
			// Translators: open strong tag, close strong tag.
			__( '%1$sPunkt odbioru DHL%2$s jest wymagany. Wybierz punkt odbioru z mapy i spróbuj ponownie.', 'dhl-polska' ),
			'',
			''
		);

		return [
			new PickupPointValidatorForFsIntegration(
				FlexibleShippingIntegration::INTEGRATION_ID,
				FlexibleShippingIntegration::INTEGRATION_ID . '_' . ShipmentData::OPTION_SERVICE,
				DhlServices::SERVICE_POINT,
				$error_message
			),
			new PickupPointValidatorForShippingMethod(
				DhlShippingMethod::SHIPPING_METHOD_ID,
				DhlInstanceSettings::OPTION_SERVICE,
				DhlServices::SERVICE_POINT,
				$error_message
			),
		];
	}
}
