<?php
/**
 * REST API: CRUD for Popup Upsell campaigns.
 *
 * @package PRECO
 */

namespace PRECO\Includes\Admin\Rest;

defined( 'ABSPATH' ) || exit;

/**
 * Popup Upsell REST controller.
 *
 * All CRUD behavior lives in CampaignRest; this subclass only names the
 * option, routes and payload keys.
 */
class PopupUpsellRest extends CampaignRest {
	/**
	 * Option name where popup upsells are stored.
	 */
	const OPTION_NAME = 'preco_popup_upsells';

	/**
	 * {@inheritDoc}
	 */
	protected function option_name() {
		return self::OPTION_NAME;
	}

	/**
	 * {@inheritDoc}
	 */
	protected function rest_base() {
		return 'popup-upsells';
	}

	/**
	 * {@inheritDoc}
	 */
	protected function item_key() {
		return 'popup';
	}

	/**
	 * {@inheritDoc}
	 */
	protected function collection_key() {
		return 'popups';
	}

	/**
	 * {@inheritDoc}
	 */
	protected function saved_action() {
		return 'preco_popup_upsell_saved';
	}

	/**
	 * {@inheritDoc}
	 */
	protected function item_label() {
		return 'Popup';
	}
}
