Option Strict On
Option Explicit On

Namespace Nexamas.UI.Rendering

    ''' <summary>
    ''' Friend-only final report proving that all Surface Treatment evidence layers read consumer scope
    ''' from MASSurfaceTreatmentConsumerCatalog instead of owning competing consumer lists.
    ''' </summary>
    Friend NotInheritable Class MASSurfaceTreatmentConsumerProofAlignmentReport

        Friend ReadOnly Property Name As String
        Friend ReadOnly Property Status As MASSurfaceTreatmentConsumerProofAlignmentStatus
        Friend ReadOnly Property CatalogOwnershipConsumerCount As Integer
        Friend ReadOnly Property CatalogCurrentVisualCaptureConsumerCount As Integer
        Friend ReadOnly Property CatalogLowRiskRuntimeConsumerCount As Integer
        Friend ReadOnly Property CatalogRuntimeSurfaceVisualConsumerCount As Integer
        Friend ReadOnly Property CatalogFrameRuntimeProofConsumerCount As Integer
        Friend ReadOnly Property MaterialProfileCount As Integer
        Friend ReadOnly Property ExpectedFrameRuntimeProofPlanCount As Integer
        Friend ReadOnly Property InventoryEntryCount As Integer
        Friend ReadOnly Property CurrentVisualCaptureEntryCount As Integer
        Friend ReadOnly Property RuntimeAlignmentEntryCount As Integer
        Friend ReadOnly Property RuntimeSurfaceVisualApplicationEntryCount As Integer
        Friend ReadOnly Property FrameRuntimeProofPlanCount As Integer
        Friend ReadOnly Property InventoryMatchesCatalog As Boolean
        Friend ReadOnly Property CurrentVisualCaptureMatchesCatalog As Boolean
        Friend ReadOnly Property RuntimeAlignmentMatchesCatalog As Boolean
        Friend ReadOnly Property RuntimeSurfaceVisualApplicationMatchesCatalog As Boolean
        Friend ReadOnly Property FrameRuntimeProofMatchesCatalog As Boolean
        Friend ReadOnly Property SurfaceOnlyScopeLocked As Boolean
        Friend ReadOnly Property UsesSingleConsumerCatalog As Boolean
        Friend ReadOnly Property ExcludesInteractiveControls As Boolean
        Friend ReadOnly Property HasNoParallelMaterialOrFramePath As Boolean
        Friend ReadOnly Property IsAligned As Boolean

        Friend Sub New(name As String,
                       status As MASSurfaceTreatmentConsumerProofAlignmentStatus,
                       catalogOwnershipConsumerCount As Integer,
                       catalogCurrentVisualCaptureConsumerCount As Integer,
                       catalogLowRiskRuntimeConsumerCount As Integer,
                       catalogRuntimeSurfaceVisualConsumerCount As Integer,
                       catalogFrameRuntimeProofConsumerCount As Integer,
                       materialProfileCount As Integer,
                       expectedFrameRuntimeProofPlanCount As Integer,
                       inventoryEntryCount As Integer,
                       currentVisualCaptureEntryCount As Integer,
                       runtimeAlignmentEntryCount As Integer,
                       runtimeSurfaceVisualApplicationEntryCount As Integer,
                       frameRuntimeProofPlanCount As Integer,
                       inventoryMatchesCatalog As Boolean,
                       currentVisualCaptureMatchesCatalog As Boolean,
                       runtimeAlignmentMatchesCatalog As Boolean,
                       runtimeSurfaceVisualApplicationMatchesCatalog As Boolean,
                       frameRuntimeProofMatchesCatalog As Boolean,
                       surfaceOnlyScopeLocked As Boolean,
                       usesSingleConsumerCatalog As Boolean,
                       excludesInteractiveControls As Boolean,
                       hasNoParallelMaterialOrFramePath As Boolean)

            Me.Name = Normalize(name, "Surface Treatment Final Consumer/Proof Alignment")
            Me.Status = status
            Me.CatalogOwnershipConsumerCount = catalogOwnershipConsumerCount
            Me.CatalogCurrentVisualCaptureConsumerCount = catalogCurrentVisualCaptureConsumerCount
            Me.CatalogLowRiskRuntimeConsumerCount = catalogLowRiskRuntimeConsumerCount
            Me.CatalogRuntimeSurfaceVisualConsumerCount = catalogRuntimeSurfaceVisualConsumerCount
            Me.CatalogFrameRuntimeProofConsumerCount = catalogFrameRuntimeProofConsumerCount
            Me.MaterialProfileCount = materialProfileCount
            Me.ExpectedFrameRuntimeProofPlanCount = expectedFrameRuntimeProofPlanCount
            Me.InventoryEntryCount = inventoryEntryCount
            Me.CurrentVisualCaptureEntryCount = currentVisualCaptureEntryCount
            Me.RuntimeAlignmentEntryCount = runtimeAlignmentEntryCount
            Me.RuntimeSurfaceVisualApplicationEntryCount = runtimeSurfaceVisualApplicationEntryCount
            Me.FrameRuntimeProofPlanCount = frameRuntimeProofPlanCount
            Me.InventoryMatchesCatalog = inventoryMatchesCatalog
            Me.CurrentVisualCaptureMatchesCatalog = currentVisualCaptureMatchesCatalog
            Me.RuntimeAlignmentMatchesCatalog = runtimeAlignmentMatchesCatalog
            Me.RuntimeSurfaceVisualApplicationMatchesCatalog = runtimeSurfaceVisualApplicationMatchesCatalog
            Me.FrameRuntimeProofMatchesCatalog = frameRuntimeProofMatchesCatalog
            Me.SurfaceOnlyScopeLocked = surfaceOnlyScopeLocked
            Me.UsesSingleConsumerCatalog = usesSingleConsumerCatalog
            Me.ExcludesInteractiveControls = excludesInteractiveControls
            Me.HasNoParallelMaterialOrFramePath = hasNoParallelMaterialOrFramePath
            Me.IsAligned = status = MASSurfaceTreatmentConsumerProofAlignmentStatus.Aligned AndAlso
                           inventoryMatchesCatalog AndAlso
                           currentVisualCaptureMatchesCatalog AndAlso
                           runtimeAlignmentMatchesCatalog AndAlso
                           runtimeSurfaceVisualApplicationMatchesCatalog AndAlso
                           frameRuntimeProofMatchesCatalog AndAlso
                           surfaceOnlyScopeLocked AndAlso
                           usesSingleConsumerCatalog AndAlso
                           excludesInteractiveControls 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
