using BomLocalService.Models;
using BomLocalService.Services.Interfaces.Registration;
namespace BomLocalService.Services.Interfaces;
///
/// Main service interface for BOM radar screenshot operations.
/// Orchestrates cache management, browser automation, and web scraping to provide radar screenshots for Australian locations.
///
public interface IBomRadarService : ISingletonService
{
///
/// Gets cached radar data for a location.
/// Returns the radar response with all frames if available in cache, otherwise returns null.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// Radar response with frames and metadata, or null if not cached
Task GetCachedRadarAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Triggers a cache update for a location.
/// If cache is missing or expired, initiates a background update and returns status information.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// Status information about the cache update operation
Task TriggerCacheUpdateAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Gets metadata about the cached radar data for a location.
/// Returns observation time, forecast time, weather station, and distance information.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// Last updated information, or null if no cached data exists
Task GetLastUpdatedInfoAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Gets the file system path to the cached screenshot for a location.
/// Returns empty string if no cached screenshot exists.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// File system path to the cached screenshot, or empty string if not found
Task GetCachedScreenshotPathAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Deletes all cached folders (containing frames and metadata) for a location.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// True if folders were deleted, false if no cached folders existed
Task DeleteCachedLocationAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Gets all cached frames for a location.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Cancellation token to cancel the operation
/// List of cached frames with URLs, or null if no frames exist
Task?> GetCachedFramesAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Gets a specific cached frame for a location.
///
/// The suburb name (e.g., "Pomona", "Brisbane")
/// The Australian state abbreviation (e.g., "QLD", "NSW", "VIC")
/// Frame index (0-6)
/// Cancellation token to cancel the operation
/// The cached frame, or null if not found
Task GetCachedFrameAsync(string suburb, string state, int frameIndex, CancellationToken cancellationToken = default);
///
/// Gets information about the available cache range for a location (oldest and newest cache folders).
///
Task GetCacheRangeAsync(string suburb, string state, CancellationToken cancellationToken = default);
///
/// Gets historical radar data (frames from multiple cache folders) between specified timestamps.
/// Radar frames can be joined across cache folders because they represent a historical time series.
///
Task GetRadarTimeSeriesAsync(
string suburb,
string state,
DateTime? startTime,
DateTime? endTime,
CancellationToken cancellationToken = default);
///
/// Gets a specific radar frame from a specific cache folder.
///
Task GetFrameFromCacheFolderAsync(
string suburb,
string state,
string cacheFolderName,
int frameIndex,
CancellationToken cancellationToken = default);
}