using System;
using System.Collections.Generic;
namespace StellaOps.Concelier.Merge.Services;
///
/// Canonical conflict detail used to materialize structured payloads for persistence and explainers.
///
public sealed record ConflictDetailPayload(
string Type,
string Reason,
IReadOnlyList PrimarySources,
int PrimaryRank,
IReadOnlyList SuppressedSources,
int SuppressedRank,
string? PrimaryValue,
string? SuppressedValue)
{
public static ConflictDetailPayload FromDetail(MergeConflictDetail detail)
{
ArgumentNullException.ThrowIfNull(detail);
return new ConflictDetailPayload(
detail.ConflictType,
detail.Reason,
detail.PrimarySources,
detail.PrimaryRank,
detail.SuppressedSources,
detail.SuppressedRank,
detail.PrimaryValue,
detail.SuppressedValue);
}
public MergeConflictExplainerPayload ToExplainer() =>
new(
Type,
Reason,
PrimarySources,
PrimaryRank,
SuppressedSources,
SuppressedRank,
PrimaryValue,
SuppressedValue);
}