<?php
/**
 * FeaturesServiceProvider class.
 *
 * @package DokanKits\Core\DI\Providers
 * @since   3.0.0
 */

namespace DokanKits\Core\DI\Providers;

use DokanKits\Core\DI\BaseServiceProvider;
use DokanKits\Features\Cart\CartButtons;
use DokanKits\Features\Order\AutoCompleteDigitalOrders;
use DokanKits\Features\Product\HideAddToCartButton;
use DokanKits\Features\Product\ProductFields;
use DokanKits\Features\Product\ProductProFields;
use DokanKits\Features\Product\ProductRemoveOtherOptions;
use DokanKits\Features\Product\ProductTypes;
use DokanKits\Features\Shipping\RemoveSplitShipping;
use DokanKits\Features\Vendor\DefaultSellerRole;
use DokanKits\Features\Vendor\EnableOwnProductPurchase;
use DokanKits\Features\Vendor\EnablePublishProductDirectly;
use DokanKits\Features\Vendor\RemoveBecomeVendorButton;
use DokanKits\Features\Vendor\VendorRegistration;

/**
 * Features Service Provider
 *
 * Registers feature services with the container
 *
 * @package DokanKits\Core\DI\Providers
 */
class FeaturesServiceProvider extends BaseServiceProvider {

	/**
	 * Services provided by this provider
	 *
	 * @var array
	 */
	protected array $services = array(
		// Vendor Features.
		VendorRegistration::class,
		DefaultSellerRole::class,
		RemoveBecomeVendorButton::class,
		EnableOwnProductPurchase::class,
		EnablePublishProductDirectly::class,

		// Product Features.
		ProductTypes::class,
		HideAddToCartButton::class,
		ProductFields::class,
		ProductProFields::class,
		ProductRemoveOtherOptions::class,

		// Cart Features.
		CartButtons::class,

		// Order Features.
		AutoCompleteDigitalOrders::class,

		// Shipping Features.
		RemoveSplitShipping::class,
	);

	/**
	 * Tags for this provider
	 *
	 * @var array
	 */
	protected array $tags = array( 'feature-service' );

	/**
	 * Register services with the container
	 *
	 * @return void
	 */
	public function register(): void {
		foreach ( $this->services as $service ) {
			$definition = $this->share_with_implements_tags( $service );
			$this->add_tags( $definition, $this->tags );
		}
	}
}
