namespace SolutionErp.Application.Common.Interfaces;

// Abstraction over file storage. LocalFileStorage (Infrastructure) writes to
// a configured root path today; future: S3/AzureBlob by swapping impl.
public interface IFileStorage
{
    // Saves stream to relative path under root. Returns normalized relative path.
    Task<string> SaveAsync(string relativePath, Stream content, CancellationToken ct = default);

    // Opens a readable stream for downloading. Caller must dispose.
    Task<Stream> OpenReadAsync(string relativePath, CancellationToken ct = default);

    // Deletes a file if it exists. No-op if missing.
    Task DeleteAsync(string relativePath, CancellationToken ct = default);

    // True if file exists at relative path.
    bool Exists(string relativePath);
}
