Files
LaDOSE/LaDOSE.Src/LaDOSE.Service/Interface/ISheetsExportService.cs
T
darkstack 937b8554dd
Build App / Build (push) Failing after 3s
Docker Compose bot + Google Api
2026-08-06 16:23:50 +02:00

43 lines
1.6 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
using LaDOSE.Entity;
namespace LaDOSE.Business.Interface
{
public interface ISheetsExportService
{
/// <summary>What the export panel needs to render. Never includes a secret.</summary>
SheetsConfig GetConfig();
/// <summary>
/// Resolves the target spreadsheet from configuration, validates the tables, sanitises
/// and de-duplicates the tab titles, then hands off to the configured
/// <see cref="ISheetsWriter"/>. Throws <see cref="SheetsExportException"/> for anything
/// the caller can act on.
/// </summary>
Task<SheetExportResult> ExportAsync(SheetExportRequest request, CancellationToken ct = default);
}
/// <summary>
/// A failure with a message meant for the person who pressed the button, plus the status
/// the API should answer with. The API has no exception middleware, so anything that escapes
/// reaches the browser as an HTML developer page the client can only report as a bare status
/// — hence every foreseeable failure is raised as one of these instead.
/// </summary>
public class SheetsExportException : Exception
{
public SheetsExportException(int statusCode, string message) : base(message)
{
StatusCode = statusCode;
}
public SheetsExportException(int statusCode, string message, Exception inner) : base(message, inner)
{
StatusCode = statusCode;
}
public int StatusCode { get; }
}
}