"""SP33 regression test: ``PayerConfig.co_medicaid()`` emits CO_TXIX.

The HCPF 837P Companion Guide (June 2025 - Version 2.5) requires
``NM1*PR NM108=PI, NM109=CO_TXIX`` for the Payer Name loop (2010BB).
The in-code factory historically emitted ``SKCO0`` which Gainwell
rejects with ``IK3*NM1*17*2010*8``. This test pins the corrected value.
See ``docs/superpowers/specs/2026-07-02-cyclone-co-txix-payer-fix-design.md``.
"""
from __future__ import annotations


def test_co_medicaid_factory_emits_CO_TXIX():
    """Per HCPF 837P Companion Guide, NM1*PR NM109 must equal CO_TXIX."""
    from cyclone.parsers.payer import PayerConfig
    cfg = PayerConfig.co_medicaid()
    assert cfg.payer_id == "CO_TXIX", (
        f"co_medicaid().payer_id must be 'CO_TXIX' (HCPF guide), got {cfg.payer_id!r}"
    )
    assert cfg.payer_name == "CO_TXIX", (
        f"co_medicaid().payer_name must be 'CO_TXIX' (matches docs/goodclaim.x12), got {cfg.payer_name!r}"
    )


def test_skco0_not_present_in_factory():
    """Hard guard: SKCO0 must never be emitted by the factory again."""
    from cyclone.parsers.payer import PayerConfig
    cfg = PayerConfig.co_medicaid()
    assert "SKCO0" not in cfg.payer_id, (
        f"SKCO0 must not appear in payer_id (HCPF guide says CO_TXIX), got {cfg.payer_id!r}"
    )
    assert "SKCO0" not in cfg.payer_name, (
        f"SKCO0 must not appear in payer_name, got {cfg.payer_name!r}"
    )
