Option Strict On
Option Explicit On

Namespace Nexamas.UI.Quality

    ''' <summary>
    ''' One friend-only commercial readiness finding. The finding is intentionally small
    ''' and data-only so the readiness gate can be consumed by certification tooling
    ''' without exposing diagnostics or mutable runtime state as public API.
    ''' </summary>
    Friend NotInheritable Class MASCommercialReadinessFinding

        Friend Sub New(componentId As String,
                       evidenceKey As String,
                       severity As MASCommercialReadinessFindingSeverity,
                       message As String)
            Me.ComponentId = Normalize(componentId)
            Me.EvidenceKey = Normalize(evidenceKey)
            Me.Severity = severity
            Me.Message = Normalize(message)
        End Sub

        Friend ReadOnly Property ComponentId As String
        Friend ReadOnly Property EvidenceKey As String
        Friend ReadOnly Property Severity As MASCommercialReadinessFindingSeverity
        Friend ReadOnly Property Message As String

        Friend ReadOnly Property IsError As Boolean
            Get
                Return Severity = MASCommercialReadinessFindingSeverity.Error
            End Get
        End Property

        Friend ReadOnly Property IsWarning As Boolean
            Get
                Return Severity = MASCommercialReadinessFindingSeverity.Warning
            End Get
        End Property

        Private Shared Function Normalize(value As String) As String
            If value Is Nothing Then Return String.Empty
            Return value.Trim()
        End Function

    End Class

End Namespace
