using System.Globalization;
namespace ZB.MOM.WW.ScadaBridge.CLI.Commands;
///
/// Helpers for the audit verify-chain subcommand. v1 is a no-op: hash-chain
/// tamper-evidence is deferred to v1.x (see Component-AuditLog.md). The command still
/// validates its --month argument so the surface is stable for v1.x.
///
public static class AuditVerifyChainHelpers
{
///
/// Returns true if is a well-formed YYYY-MM value
/// with a real month (01-12). A malformed month (e.g. 2026-13) is rejected.
///
/// The month string to validate in YYYY-MM format.
/// true if the string is a well-formed YYYY-MM value with a real month; otherwise false.
public static bool IsValidMonth(string? month)
=> !string.IsNullOrWhiteSpace(month)
&& DateTime.TryParseExact(month, "yyyy-MM", CultureInfo.InvariantCulture,
DateTimeStyles.None, out _);
}