<?php

namespace WcElectronInvoice\Providers;

defined( 'ABSPATH' ) || die( 'Not allowed.' );

abstract class TaxProviderAbstract {

	/**
	 * Get tax rates based on the tax class and customer.
	 * @param $tax_class
	 * @param $customer
	 *
	 * @return mixed
	 */
	abstract function get_rates($tax_class = '', $customer = null);

	/**
	 * Get base tax rates.
	 * @return mixed
	 */
	abstract function get_base_tax_rates();

	/**
	 * Get tax rates for a specific tax class.
	 * @param
	 * @return mixed
	 */
	abstract function get_rates_for_tax_class($tax_class);

	/**
	 * Get shipping tax rates.
	 * @return mixed
	 */
	abstract function get_shipping_tax_rates();

	/**
	 * Get tax rate for a shipping item.
	 * Uses tax_rate_id from item taxes data when tax_class is empty.
	 *
	 * @param $item
	 * @return object|null
	 */
	abstract function get_shipping_item_tax_rate($item);

	/**
	 * Get tax rate id for a shipping item.
	 *
	 * @param $item
	 * @return int|null
	 */
	abstract function get_shipping_item_tax_rate_id($item);

	/**
	 * Check if taxes are enabled.
	 * @return mixed
	 */
	abstract function is_tax_enabled();

	/**
	 * Enqueue tax provider
	 * @return mixed
	 */
	public function enqueue(){
		TaxesQuery::instance()->register_provider($this);
	}

	/**
	 * Get provider key
	 * @return mixed
	 */
	abstract function name();

}
