< Summary

Information
Class: Orchestrator.Commands.Operations.Wm26RecentHistory.Wm26RecentHistoryApplyDateMapSettings
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Operations/Wm26RecentHistory/Wm26RecentHistorySettings.cs
Line coverage
81%
Covered lines: 13
Uncovered lines: 3
Coverable lines: 16
Total lines: 139
Line coverage: 81.2%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Validate()100%2276.92%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Operations/Wm26RecentHistory/Wm26RecentHistorySettings.cs

#LineLine coverage
 1using System.Globalization;
 2using System.ComponentModel;
 3using EHonda.KicktippAi.Core;
 4using Spectre.Console;
 5using Spectre.Console.Cli;
 6
 7namespace Orchestrator.Commands.Operations.Wm26RecentHistory;
 8
 9public class Wm26RecentHistorySettings : CommandSettings
 10{
 11}
 12
 13public sealed class Wm26RecentHistoryExportDateMapSettings : Wm26RecentHistorySettings
 14{
 15    [CommandOption("-c|--community-context <COMMUNITY_CONTEXT>")]
 16    [Description("The community context whose latest WM26 recent-history documents should be exported")]
 17    public string CommunityContext { get; set; } = string.Empty;
 18
 19    [CommandOption("--competition <COMPETITION>")]
 20    [Description("Competition identifier")]
 21    public string Competition { get; set; } = CompetitionIds.FifaWorldCup2026;
 22
 23    [CommandOption("-o|--output <OUTPUT>")]
 24    [Description("Canonical date map CSV path")]
 25    public string Output { get; set; } = "data/wm26/recent-history/recent-history-match-dates.csv";
 26
 27    [CommandOption("--verbose")]
 28    [Description("Enable verbose output")]
 29    public bool Verbose { get; set; }
 30
 31    public override ValidationResult Validate()
 32    {
 33        return string.IsNullOrWhiteSpace(CommunityContext)
 34            ? ValidationResult.Error("--community-context is required")
 35            : ValidationResult.Success();
 36    }
 37}
 38
 39public sealed class Wm26RecentHistoryApplyDateMapSettings : Wm26RecentHistorySettings
 40{
 41    [CommandOption("-c|--community-context <COMMUNITY_CONTEXT>")]
 42    [Description("The community context whose latest WM26 recent-history documents should be updated")]
 143    public string CommunityContext { get; set; } = string.Empty;
 44
 45    [CommandOption("--competition <COMPETITION>")]
 46    [Description("Competition identifier")]
 147    public string Competition { get; set; } = CompetitionIds.FifaWorldCup2026;
 48
 49    [CommandOption("-i|--input <INPUT>")]
 50    [Description("Canonical date map CSV path")]
 151    public string Input { get; set; } = "data/wm26/recent-history/recent-history-match-dates.csv";
 52
 53    [CommandOption("--dry-run")]
 54    [Description("Show what would be saved without writing Firestore documents")]
 55    public bool DryRun { get; set; }
 56
 57    [CommandOption("--apply-known-only")]
 58    [Description("Apply exact dates for known map rows while preserving unmapped rows")]
 59    public bool ApplyKnownOnly { get; set; }
 60
 61    [CommandOption("--preserve-collected-on-or-after <DATE>")]
 62    [Description("When applying known rows only, resolve WM tournament rows whose Played_At or legacy Data_Collected_At 
 63    public string? PreserveCollectedOnOrAfter { get; set; }
 64
 65    [CommandOption("--verbose")]
 66    [Description("Enable verbose output")]
 67    public bool Verbose { get; set; }
 68
 69    public override ValidationResult Validate()
 70    {
 171        if (string.IsNullOrWhiteSpace(CommunityContext))
 72        {
 073            return ValidationResult.Error("--community-context is required");
 74        }
 75
 176        if (!string.IsNullOrWhiteSpace(PreserveCollectedOnOrAfter))
 77        {
 178            if (!ApplyKnownOnly)
 79            {
 080                return ValidationResult.Error("--preserve-collected-on-or-after requires --apply-known-only");
 81            }
 82
 183            if (!DateOnly.TryParseExact(
 184                    PreserveCollectedOnOrAfter.Trim(),
 185                    "yyyy-MM-dd",
 186                    CultureInfo.InvariantCulture,
 187                    DateTimeStyles.None,
 188                    out _))
 89            {
 090                return ValidationResult.Error("--preserve-collected-on-or-after must use YYYY-MM-DD");
 91            }
 92        }
 93
 194        return ValidationResult.Success();
 95    }
 96}
 97
 98public sealed class Wm26RecentHistoryProbePredictionLookupSettings : Wm26RecentHistorySettings
 99{
 100    [CommandOption("-c|--community-context <COMMUNITY_CONTEXT>")]
 101    [Description("The community context whose match predictions should be queried")]
 102    public string CommunityContext { get; set; } = string.Empty;
 103
 104    [CommandOption("--competition <COMPETITION>")]
 105    [Description("Competition identifier")]
 106    public string Competition { get; set; } = CompetitionIds.FifaWorldCup2026;
 107
 108    [CommandOption("--home-team <HOME_TEAM>")]
 109    [Description("Home team name to query exactly")]
 110    public string HomeTeam { get; set; } = string.Empty;
 111
 112    [CommandOption("--away-team <AWAY_TEAM>")]
 113    [Description("Away team name to query exactly")]
 114    public string AwayTeam { get; set; } = string.Empty;
 115
 116    [CommandOption("--verbose")]
 117    [Description("Enable verbose output")]
 118    public bool Verbose { get; set; }
 119
 120    public override ValidationResult Validate()
 121    {
 122        if (string.IsNullOrWhiteSpace(CommunityContext))
 123        {
 124            return ValidationResult.Error("--community-context is required");
 125        }
 126
 127        if (string.IsNullOrWhiteSpace(HomeTeam))
 128        {
 129            return ValidationResult.Error("--home-team is required");
 130        }
 131
 132        if (string.IsNullOrWhiteSpace(AwayTeam))
 133        {
 134            return ValidationResult.Error("--away-team is required");
 135        }
 136
 137        return ValidationResult.Success();
 138    }
 139}

Methods/Properties

.ctor()
Validate()