<?php

namespace WcElectronInvoice\Providers;

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


abstract class OrderAbstract {

	/**
	 * @var int
	 */
	public $id;

	/**
	 * @var OrderAbstract
	 */
	protected $order;

	/**
	 * @var array
	 */
	protected $data;

	/**
	 * @var string
	 */
	protected $payment_method;

	/**
	 * @var \WcElectronInvoice\Providers\OrdersProviderAbstract
	 */
	public $provider;

	/**
	 * @var \WcElectronInvoice\Providers\TaxProviderAbstract
	 */
	protected $tax_provider;

	/**
	 * OrderAbstract constructor.
	 *
	 * @param $order
	 * @param $provider
	 */
	function __construct( $order, $provider, $tax_provider ) {
		$this->provider     = $provider;
		$this->tax_provider = $tax_provider;
		$this->order        = $order;
		$this->id           = $this->get_id();


	}

	abstract function set_id();

	abstract function set_order( $order );

	abstract function set_data();

	abstract function set_payment_method();

	abstract function get_data();

	abstract function get_id();

	abstract function get_status();

	abstract function get_meta( $key, $single = true );

	abstract function update_meta( $key, $value );

	abstract function delete_meta( $key );

	abstract function get_total();

	abstract function get_payment_method();

	abstract function get_parent_id();

	abstract function get_invoice_type();

	abstract function get_billing_tax_code();

	abstract function get_sdi_type();

	abstract function get_user_id();

	abstract function get_type();

	abstract function get_type_label( $orderType );

	abstract function get_total_refunded();

	abstract function get_refunds();

	abstract function get_remaining_refund_amount();

	abstract function get_remaining_refund_items();

	abstract function get_total_qty_refunded();

	abstract function get_qty_refunded_for_item();

	abstract function get_refund_payment_method();

	abstract function get_total_refunded_for_item( $item_id, $item_type );

	abstract function get_tax_refunded_for_item( $item_id, $item_type );

	/**
	 * @param $type
	 *
	 * @return OrderItemAbstract[]
	 */
	abstract function get_items( $type = 'line_item' );

	abstract function get_invoice_sent($order_id = '');

	abstract function set_invoice_sent( $sent, $order_id = '' );

	abstract function set_invoice_sent_timestamp($timestamp, $order_id = '' );

	abstract function get_invoice_sent_timestamp($order_id = '');
	abstract function get_vat_number();

	abstract function get_order_number_invoice();

	abstract function get_edit_user_url();
	abstract function get_edit_order_url();

	function refresh_meta_data(): void {}

	function get_provider() {
		return $this->provider->name();
	}

	function get_provider_label() {
		return $this->provider->get_label();
	}

	function get_tax_provider() {
		return $this->tax_provider;
	}

	abstract function get_currency();

	abstract function get_currency_symbol( $currency );

	abstract function get_billing_choice_type();

	abstract function get_nature_rc();

	abstract function get_ref_norm_rc();

	abstract function set_date_completed( $timestamp );

	abstract function get_billing_country();

	abstract function save();
}
