using SatelliteProvider.Common.DTO;

namespace SatelliteProvider.Common.Interfaces;

public interface ITileService
{
    Task<List<TileMetadata>> DownloadAndStoreTilesAsync(double latitude, double longitude, double sizeMeters, int zoomLevel, CancellationToken cancellationToken = default);
    Task<TileMetadata?> GetTileAsync(Guid id);
    Task<IEnumerable<TileMetadata>> GetTilesByRegionAsync(double latitude, double longitude, double sizeMeters, int zoomLevel);
    Task<TileBytes> GetOrDownloadTileAsync(int z, int x, int y, CancellationToken cancellationToken = default);
    Task<TileMetadata> DownloadAndStoreSingleTileAsync(double latitude, double longitude, int zoomLevel, CancellationToken cancellationToken = default);
    // AZ-505: bulk-list / inventory endpoint. Maps every request entry to its
    // location_hash, queries the repository in one round-trip, and returns one
    // response entry per request entry — in the same order. Callers are
    // expected to validate the request shape (`Tiles` XOR `LocationHashes`,
    // entry count cap) BEFORE invoking this method.
    Task<TileInventoryResponse> GetInventoryAsync(TileInventoryRequest request, CancellationToken cancellationToken = default);
}

