<?php
/**
 * WooCommerce product identity module.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChangesWooCommerce\CoreCompat\WooCommerce\Identity;

use ScheduledChangesWooCommerce\CoreCompat\WooCommerce\ProductSynchronizer;
use ScheduledChangesWooCommerce\CoreCompat\WooCommerce\ProductTypeCapabilities;

/** Owns the minimum product/variation identity and catalog field set. */
final class ProductIdentityModule {
	public const MODULE_ID = 'scheduled-changes-product-identity';

	/** @return string[] */
	public function fieldKeys(): array {
		return array(
			'core.name',
			'core.slug',
			'core.status',
			'core.password',
			'core.author_id',
			'core.publish_date',
			'core.type',
			'core.menu_order',
			'core.reviews_allowed',
			'core.purchase_note',
			'catalog.visibility',
			'catalog.featured',
			'catalog.visible_in_pos',
			'content.description',
			'content.short_description',
			'inventory.sku',
			'inventory.global_unique_id',
			'relationships.parent_id',
		);
	}

	/** Creates installed product-type capability discovery. */
	public function createCapabilities(): ProductTypeCapabilities {
		return new ProductTypeCapabilities();
	}

	/** Creates shared product/parent synchronization and cache invalidation. */
	public function createSynchronizer(): ProductSynchronizer {
		return new ProductSynchronizer();
	}
}
