using System.Collections.Generic;
namespace LaDOSE.DTO
{
///
/// Body of POST /api/Sheets/Export. The target spreadsheet is deliberately absent: it comes
/// from server configuration only, so a caller cannot redirect the export.
///
public class SheetExportRequestDTO
{
///
/// One tab per selected event, oldest first. Tab N holds events 1..N merged, so the last
/// tab is the full cumulative ranking for the selection.
///
public List Tabs { get; set; }
}
/// One tab: a players x games grid with a Total column, as built by buildRanking().
public class SheetTableDTO
{
/// Desired tab title, e.g. "Ranking #1301". Sanitised server-side.
public string Name { get; set; }
/// Provenance and logging only; tabs are addressed by title.
public int EventId { get; set; }
/// ["Players", <game names...>, "Total"].
public List Header { get; set; }
public List Rows { get; set; }
/// Provenance lines written below the grid.
public List Footer { get; set; }
}
public class SheetRowDTO
{
public string Player { get; set; }
///
/// Index-aligned with Header[1..^1]. Typed int, not string, so the values land in the
/// sheet as numbers and existing formulas and conditional formatting keep working.
///
public List Points { get; set; }
public int Total { get; set; }
}
public class SheetExportResultDTO
{
public string SpreadsheetId { get; set; }
public string SpreadsheetUrl { get; set; }
public string Writer { get; set; }
public List Tabs { get; set; }
public List Warnings { get; set; }
}
public class SheetTabResultDTO
{
public string RequestedName { get; set; }
public string Name { get; set; }
public int Rows { get; set; }
public int Columns { get; set; }
public bool Created { get; set; }
}
///
/// Response of GET /api/Sheets/Config. Never carries the credentials path or any secret —
/// only what the export panel needs to render itself.
///
public class SheetsConfigDTO
{
/// "ServiceAccount" | "Logging" | "Disabled".
public string Writer { get; set; }
public bool Configured { get; set; }
public string SpreadsheetId { get; set; }
public int MaxTabs { get; set; }
public int MaxRowsPerTab { get; set; }
}
}