namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.TestSupport;

/// <summary>One prerequisite probe's outcome. <see cref="AvevaPrerequisites"/> returns many of these.</summary>
/// <param name="Name">Short diagnostic id — e.g. <c>service:aaBootstrap</c>, <c>sql:ZB</c>, <c>registry:ArchestrA.Framework</c>.</param>
/// <param name="Category">Which subsystem the probe belongs to — lets callers filter (e.g. "Historian warns don't gate the core Galaxy smoke").</param>
/// <param name="Status">Outcome.</param>
/// <param name="Detail">One-line specific message an operator can act on — <c>"aaGR not installed — install the Galaxy Repository role from the System Platform setup"</c> beats <c>"failed"</c>.</param>
public sealed record PrerequisiteCheck(
    string Name,
    PrerequisiteCategory Category,
    PrerequisiteStatus Status,
    string Detail);

public enum PrerequisiteStatus
{
    /// <summary>Prerequisite is met; no action needed.</summary>
    Pass,
    /// <summary>Soft dependency missing — stack still runs but some feature (e.g. logging) is degraded.</summary>
    Warn,
    /// <summary>Hard dependency missing — live tests can't proceed; <see cref="PrerequisiteReport.SkipReason"/> surfaces this.</summary>
    Fail,
    /// <summary>Probe wasn't applicable in this environment (e.g. non-Windows host, Historian not installed).</summary>
    Skip,
}

public enum PrerequisiteCategory
{
    /// <summary>Platform sanity — process bitness, OS platform, DCOM/RPCSS.</summary>
    Environment,
    /// <summary>Hard-required AVEVA Windows services (aaBootstrap, aaGR, NmxSvc).</summary>
    AvevaCoreService,
    /// <summary>Soft-required AVEVA Windows services (aaLogger, aaUserValidator) — warn only.</summary>
    AvevaSoftService,
    /// <summary>ArchestrA Framework install markers (registry + files).</summary>
    AvevaInstall,
    /// <summary>MXAccess COM server registration + file on disk.</summary>
    MxAccessCom,
    /// <summary>SQL Server reachability + ZB database presence + deployed-object count.</summary>
    GalaxyRepository,
    /// <summary>Historian services (optional — only required for HistoryRead IPC paths).</summary>
    AvevaHistorian,
    /// <summary>OtOpcUa-side services (OtOpcUa, OtOpcUaGalaxyHost) + third-party deps (GLAuth).</summary>
    OtOpcUaService,
}
