<?php
/**
 * Environment Interface
 *
 * Defines the contract for environment-specific operations.
 * Both Production and Test environments must implement this interface.
 *
 * @package Freefactu
 * @since 0.5.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Interface Freefactu_Environment_Interface
 *
 * Defines methods for environment-specific operations that must be implemented
 * by all environment classes (Production, Test).
 */
interface Freefactu_Environment_Interface {

	/**
	 * Get the AEAT SOAP endpoint URL.
	 *
	 * @return string SOAP endpoint URL.
	 */
	public function get_soap_endpoint(): string;

	/**
	 * Get the AEAT QR validation base URL.
	 *
	 * @return string QR validation base URL.
	 */
	public function get_qr_base_url(): string;

	/**
	 * Generate the Verifactu QR code URL.
	 *
	 * @param WC_Order $order WooCommerce order.
	 * @param string   $invoice_number Invoice number.
	 * @param string   $company_nif Company NIF.
	 * @return string QR code validation URL.
	 */
	public function generate_qr_url( $order, string $invoice_number, string $company_nif ): string;

	/**
	 * Generate QR code image as base64.
	 *
	 * @param string $url URL to encode in QR code.
	 * @param int    $size QR code size in pixels.
	 * @return string Base64 encoded image or empty string on failure.
	 */
	public function generate_qr_image( string $url, int $size = 150 ): string;



	/**
	 * Get environment name.
	 *
	 * @return string 'production' or 'test'.
	 */
	public function get_environment_name(): string;
}
