package com.correx.testing.fixtures

import com.correx.core.approvals.Tier
import com.correx.core.approvals.model.DomainApprovalRequest
import com.correx.core.events.types.ApprovalRequestId
import com.correx.core.events.types.RiskSummaryId
import com.correx.core.events.types.ValidationReportId
import com.correx.core.validation.model.ValidationIssue
import com.correx.core.validation.model.ValidationSection
import com.correx.core.validation.model.ValidationSeverity
import com.correx.core.validation.pipeline.Validator
import kotlinx.datetime.Instant

fun request(
    id: String,
    tier: Tier,
    timestamp: Instant = Instant.parse("2026-01-01T00:00:00Z"),
) = DomainApprovalRequest(
    id = ApprovalRequestId(id),
    tier = tier,
    validationReportId = ValidationReportId("vr"),
    riskSummaryId = RiskSummaryId("rs"),
    timestamp = timestamp,
    causationId = null,
    correlationId = null,
    userSteering = null,
)

fun cyclePolicyMissingValidator(): Validator = Validator {
    ValidationSection(name = "cycle policy", issues = listOf(
        ValidationIssue(
            severity = ValidationSeverity.WARNING,
            code = "CYCLE_POLICY_MISSING",
            message = "forced for testing"
        )
    ))
}

