namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Transport;

public sealed record ImportResult(
    Guid BundleImportId,
    int Added,
    int Overwritten,
    int Skipped,
    int Renamed,
    IReadOnlyList<int> StaleInstanceIds,
    string AuditEventCorrelation,
    // Number of legacy inbound API keys found in the bundle that were ignored
    // (keys are not transported; re-create them on this environment).
    // Defaults to 0 so existing positional construction sites stay source-compatible.
    int ApiKeysIgnored = 0,
    // Advisory (non-blocking) import findings surfaced during apply — currently
    // template-script name-resolution references that didn't resolve to a bundled
    // or target SharedScript / ExternalSystem. These are warnings, NOT errors:
    // the deploy-time gate re-validates them authoritatively. ApiMethod-script
    // findings are hard errors instead and surface via SemanticValidationException.
    // Defaulted null → normalized to empty so existing positional callers compile.
    IReadOnlyList<string>? Warnings = null)
{
    /// <summary>Advisory, non-blocking import findings. Never null.</summary>
    public IReadOnlyList<string> Warnings { get; init; } = Warnings ?? Array.Empty<string>();
}
