Option Strict On
Option Explicit On

Namespace Nexamas.UI.Rendering

    ''' <summary>
    ''' Friend-only evidence report proving that Surface Treatment remains scoped to broad surfaces,
    ''' chrome, panels, cards, and containers. Interactive controls remain outside this system.
    ''' </summary>
    Friend NotInheritable Class MASSurfaceTreatmentScopeBoundaryReport

        Friend ReadOnly Property Name As String
        Friend ReadOnly Property Status As MASSurfaceTreatmentScopeBoundaryStatus
        Friend ReadOnly Property InventoryEntryCount As Integer
        Friend ReadOnly Property CapturedLowRiskSurfaceCount As Integer
        Friend ReadOnly Property RuntimeAlignedSurfaceCount As Integer
        Friend ReadOnly Property FrameRuntimeProofPlanCount As Integer
        Friend ReadOnly Property MaterialProfileCount As Integer
        Friend ReadOnly Property KeepsMaterialNamesGeneric As Boolean
        Friend ReadOnly Property KeepsInteractiveControlsOutOfSurfaceTreatment As Boolean
        Friend ReadOnly Property HasNoInteractiveControlSurfaceTreatmentPath As Boolean
        Friend ReadOnly Property HasNoParallelMaterialOrFramePath As Boolean
        Friend ReadOnly Property IsSurfaceOnlyScopeLocked As Boolean

        Friend Sub New(name As String,
                       status As MASSurfaceTreatmentScopeBoundaryStatus,
                       inventoryEntryCount As Integer,
                       capturedLowRiskSurfaceCount As Integer,
                       runtimeAlignedSurfaceCount As Integer,
                       frameRuntimeProofPlanCount As Integer,
                       materialProfileCount As Integer,
                       keepsMaterialNamesGeneric As Boolean,
                       keepsInteractiveControlsOutOfSurfaceTreatment As Boolean,
                       hasNoInteractiveControlSurfaceTreatmentPath As Boolean,
                       hasNoParallelMaterialOrFramePath As Boolean)

            Me.Name = Normalize(name, "Surface Treatment Surface-Only Scope Boundary")
            Me.Status = status
            Me.InventoryEntryCount = inventoryEntryCount
            Me.CapturedLowRiskSurfaceCount = capturedLowRiskSurfaceCount
            Me.RuntimeAlignedSurfaceCount = runtimeAlignedSurfaceCount
            Me.FrameRuntimeProofPlanCount = frameRuntimeProofPlanCount
            Me.MaterialProfileCount = materialProfileCount
            Me.KeepsMaterialNamesGeneric = keepsMaterialNamesGeneric
            Me.KeepsInteractiveControlsOutOfSurfaceTreatment = keepsInteractiveControlsOutOfSurfaceTreatment
            Me.HasNoInteractiveControlSurfaceTreatmentPath = hasNoInteractiveControlSurfaceTreatmentPath
            Me.HasNoParallelMaterialOrFramePath = hasNoParallelMaterialOrFramePath
            Me.IsSurfaceOnlyScopeLocked = status = MASSurfaceTreatmentScopeBoundaryStatus.SurfaceOnlyScopeLocked AndAlso
                                            inventoryEntryCount = MASSurfaceTreatmentConsumerCatalog.CurrentOwnershipConsumerCount AndAlso
                                            capturedLowRiskSurfaceCount = MASSurfaceTreatmentConsumerCatalog.CurrentVisualCaptureConsumerCount AndAlso
                                            runtimeAlignedSurfaceCount = MASSurfaceTreatmentConsumerCatalog.LowRiskRuntimeAlignedConsumerCount AndAlso
                                            frameRuntimeProofPlanCount = MASSurfaceTreatmentConsumerCatalog.ExpectedFrameRuntimeProofPlanCount(materialProfileCount) AndAlso
                                            materialProfileCount >= 8 AndAlso
                                            keepsMaterialNamesGeneric AndAlso
                                            keepsInteractiveControlsOutOfSurfaceTreatment AndAlso
                                            hasNoInteractiveControlSurfaceTreatmentPath AndAlso
                                            hasNoParallelMaterialOrFramePath
        End Sub

        Private Shared Function Normalize(value As String, fallback As String) As String
            Dim result As String = If(value, String.Empty).Trim()
            If result.Length = 0 Then Return fallback
            Return result
        End Function

    End Class

End Namespace
