82 lines
2.8 KiB
C#
82 lines
2.8 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace LaDOSE.DTO
|
|
{
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public class SheetExportRequestDTO
|
|
{
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public List<SheetTableDTO> Tabs { get; set; }
|
|
}
|
|
|
|
/// <summary>One tab: a players x games grid with a Total column, as built by buildRanking().</summary>
|
|
public class SheetTableDTO
|
|
{
|
|
/// <summary>Desired tab title, e.g. "Ranking #1301". Sanitised server-side.</summary>
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>Provenance and logging only; tabs are addressed by title.</summary>
|
|
public int EventId { get; set; }
|
|
|
|
/// <summary>["Players", <game names...>, "Total"].</summary>
|
|
public List<string> Header { get; set; }
|
|
|
|
public List<SheetRowDTO> Rows { get; set; }
|
|
|
|
/// <summary>Provenance lines written below the grid.</summary>
|
|
public List<string> Footer { get; set; }
|
|
}
|
|
|
|
public class SheetRowDTO
|
|
{
|
|
public string Player { get; set; }
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
public List<int> 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<SheetTabResultDTO> Tabs { get; set; }
|
|
public List<string> 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; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Response of GET /api/Sheets/Config. Never carries the credentials path or any secret —
|
|
/// only what the export panel needs to render itself.
|
|
/// </summary>
|
|
public class SheetsConfigDTO
|
|
{
|
|
/// <summary>"ServiceAccount" | "Logging" | "Disabled".</summary>
|
|
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; }
|
|
}
|
|
}
|