namespace CashLineERP.Application.Internal;

internal static class HypercareRunbookCatalog
{
    internal static IReadOnlyCollection<HypercareRunbookDefinition> Definitions { get; } =
    [
        new(
            "HYPERCARE_TRIAGE",
            "Hypercare Triage Runbook",
            "OPERATIONS",
            "Primary triage path for day-one support, alert review, and escalation decisions.",
            "ops/hypercare/HYPERCARE_TRIAGE_RUNBOOK.md",
            ["GET /api/v1/internal/hypercare/console", "GET /api/v1/internal/hypercare/incidents"]),
        new(
            "INTEGRATION_RECOVERY",
            "Integration Recovery Runbook",
            "INTEGRATION",
            "Replay and recovery path for inbox, outbox, callback, and dead-letter incidents.",
            "ops/hypercare/INTEGRATION_RECOVERY_RUNBOOK.md",
            ["GET /api/v1/integrations/dead-letters", "POST /api/v1/integrations/outbox/{id}/replay", "POST /api/v1/integrations/inbox/{id}/replay"]),
        new(
            "ETA_EINVOICING",
            "ETA E-Invoicing Runbook",
            "COMPLIANCE",
            "Operational path for ETA auth, callbacks, notification reconciliation, and workflow-monitoring follow-up.",
            "ops/hypercare/ETA_EINVOICING_RUNBOOK.md",
            ["GET /api/v1/integrations/eta/auth/health", "GET /api/v1/finance/eta-notifications/monitoring", "GET /api/v1/internal/workflow-monitoring"]),
        new(
            "ETA_AUTH_CONNECTIVITY",
            "ETA Authority Connectivity Qualification Checklist",
            "COMPLIANCE",
            "Qualification checklist for ETA auth, status retrieval, callback reachability, and target-environment evidence.",
            "ops/hypercare/ETA_AUTHORITY_CONNECTIVITY_QUALIFICATION_CHECKLIST.md",
            ["GET /api/v1/integrations/eta/auth/health", "GET /api/v1/finance/ar-invoices/{id}/eta-submissions/{submissionId}/authority-status", "PUT /api/v1/integrations/eta/ping"]),
        new(
            "PAYMENT_GATEWAYS",
            "Paymob And Fawry Gateway Runbook",
            "PAYMENTS",
            "Operational path for provider contracts, callbacks, settlement handling, and workflow-monitoring follow-up.",
            "ops/hypercare/PAYMOB_FAWRY_GATEWAY_RUNBOOK.md",
            ["GET /api/v1/finance/customer-payments/{id}/provider-contract", "POST /api/v1/finance/payment-executions/dispatch-batch", "POST /api/v1/finance/payment-channels/{id}/callbacks/process-batch"]),
        new(
            "PAYMENT_GATEWAY_QUALIFICATION",
            "Paymob And Fawry Target-Environment Qualification Checklist",
            "PAYMENTS",
            "Qualification checklist for payment endpoint alignment, payment-channel readiness, callback topology, and target-environment evidence.",
            "ops/hypercare/PAYMOB_FAWRY_TARGET_ENVIRONMENT_QUALIFICATION_CHECKLIST.md",
            ["GET /api/v1/integrations/endpoints?integrationProviderCode=PAYMOB", "GET /api/v1/integrations/endpoints?integrationProviderCode=FAWRY", "GET /api/v1/finance/payment-channels"]),
        new(
            "FX_USD_EGP",
            "FX USD-EGP Runbook",
            "FINANCE",
            "Operational path for USD-EGP quote readiness, overrides, treasury transfer evidence, revaluation, and reporting follow-up.",
            "ops/hypercare/FX_USD_EGP_RUNBOOK.md",
            ["GET /api/v1/finance/fx-quotes/latest", "POST /api/v1/finance/fx-overrides", "POST /api/v1/finance/fx-revaluations/{id}/post"]),
        new(
            "CUTOVER",
            "Cutover Runbook",
            "RELEASE",
            "Controlled cutover and readiness execution path for the governed release baseline.",
            "ops/cutover/CUTOVER_RUNBOOK.md",
            ["python3 ops/cutover/run_production_readiness.py", "python3 ops/cutover/build_cutover_package.py"]),
        new(
            "CUTOVER_AUTOMATION",
            "Cutover Automation Notes",
            "RELEASE",
            "Operational notes for the automated readiness and packaging scripts.",
            "ops/cutover/README.md",
            ["python3 ops/cutover/run_production_readiness.py", "python3 ops/cutover/build_cutover_package.py"]),
        new(
            "FLYWAY_OPERATIONS",
            "Flyway Operations Notes",
            "DATABASE",
            "Database migration guardrails for SQL Server and Oracle compatibility tracks.",
            "ops/flyway/README.md",
            ["flyway validate", "flyway migrate"]),
        new(
            "DEVELOPER_PORTAL_PUBLICATION",
            "Developer Portal Publication Pipeline",
            "PUBLICATION",
            "Partner-facing developer portal packaging and governed publication process.",
            "ops/developer-portal/README.md",
            ["python3 ops/developer-portal/publish_partner_portal.py"]),
        new(
            "BACKGROUND_WORKERS",
            "Background Worker Baseline",
            "OPERATIONS",
            "Worker-host scope for notification dispatch, ETA processing, and callback recovery.",
            "src/backend/CashLineERP.Workers/README.md",
            ["Review worker backlog surfaces in /api/v1/internal/operations/dashboard"]),
        new(
            "SUPPORT_MODEL",
            "Partner Support And Operating Model",
            "SUPPORT",
            "Governed partner-support boundaries, publication operating model, and support posture.",
            "docs/api-developer-portal/support-and-operating-model.md",
            ["GET /api/v1/build-info"])
    ];
}

internal sealed record HypercareRunbookDefinition(
    string RunbookCode,
    string Title,
    string CategoryCode,
    string Summary,
    string RelativePath,
    IReadOnlyCollection<string> CommandHints);
