<?php

namespace SugarCalendarBookings\Locations;

/**
 * Abstract online location provider.
 *
 * @since 1.0.0
 */
abstract class AbstractOnlineLocationProvider {

	/**
	 * Get the provider display name.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	abstract public function get_display_name();

	/**
	 * Create an online location provider from an array.
	 *
	 * @since 1.0.0
	 *
	 * @param array $data The location data.
	 *
	 * @return AbstractOnlineLocationProvider
	 */
	abstract public static function from_array( $data );

	/**
	 * Convert the provider to an array.
	 *
	 * @since 1.0.0
	 *
	 * @return array
	 */
	abstract public function to_array();

	/**
	 * Get the meeting join URL for a booked appointment.
	 *
	 * Providers that generate meeting URLs at booking time (e.g. Zoom)
	 * should override this to extract the URL from appointment data.
	 * Providers with static URLs (e.g. custom links) return their stored URL.
	 *
	 * @since 1.4.0
	 *
	 * @param array $online_location_data The appointment's online_location meta data.
	 *
	 * @return string The join URL, or empty string if unavailable.
	 */
	public function get_appointment_url( $online_location_data ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found

		return '';
	}
}
