{
  "env_id": "env_174_rl",
  "env_class_name": "EmployeeBenefitsEnrollmentPortal",
  "task_id": "env_174_rl-task_29",
  "init_config": {
    "employees": {
      "E1001": {
        "employee_id": "E1001",
        "name": "Alice Chan",
        "employment_status": "active",
        "department": "Finance",
        "eligibility_profile": "FT_EMP"
      },
      "E1002": {
        "employee_id": "E1002",
        "name": "Rahul Desai",
        "employment_status": "active",
        "department": "Human Resources",
        "eligibility_profile": "FT_EMP"
      },
      "E1003": {
        "employee_id": "E1003",
        "name": "Jillian Kim",
        "employment_status": "inactive",
        "department": "Engineering",
        "eligibility_profile": "PT_EMP"
      },
      "E1004": {
        "employee_id": "E1004",
        "name": "Roberto Garcia",
        "employment_status": "active",
        "department": "Operations",
        "eligibility_profile": "MGMT"
      },
      "E1005": {
        "employee_id": "E1005",
        "name": "Maya Henderson",
        "employment_status": "active",
        "department": "Marketing",
        "eligibility_profile": "PT_EMP"
      }
    },
    "benefit_plans": {
      "PLAN-HI-01": {
        "plan_id": "PLAN-HI-01",
        "plan_type": "health insurance",
        "name": "Blue Horizon Medical Basic",
        "coverage_details": "Core medical, prescription, wellness visits.",
        "premiums": 250.5,
        "eligibility_criteria": "FT_EMP"
      },
      "PLAN-HI-02": {
        "plan_id": "PLAN-HI-02",
        "plan_type": "health insurance",
        "name": "Blue Horizon Medical Enhanced",
        "coverage_details": "Comprehensive medical, dental, vision, specialist care.",
        "premiums": 390.75,
        "eligibility_criteria": "MGMT"
      },
      "PLAN-DN-01": {
        "plan_id": "PLAN-DN-01",
        "plan_type": "dental",
        "name": "FreshSmile Dental",
        "coverage_details": "Preventive, basic and major dental; orthodontics for dependents.",
        "premiums": 35.4,
        "eligibility_criteria": "FT_EMP"
      },
      "PLAN-VN-01": {
        "plan_id": "PLAN-VN-01",
        "plan_type": "vision",
        "name": "ClearView Vision Plan",
        "coverage_details": "Annual eye exams, glasses/lens coverage.",
        "premiums": 14.8,
        "eligibility_criteria": "PT_EMP"
      },
      "PLAN-LF-01": {
        "plan_id": "PLAN-LF-01",
        "plan_type": "life insurance",
        "name": "SecureLife Basic",
        "coverage_details": "Natural and accidental death coverage up to $50,000.",
        "premiums": 18,
        "eligibility_criteria": "FT_EMP"
      }
    },
    "enrollment_periods": {
      "EP-2022-SPRING": {
        "enrollment_period_id": "EP-2022-SPRING",
        "start_date": "2022-03-01",
        "end_date": "2022-03-31",
        "is_active": false
      },
      "EP-2023-FALL": {
        "enrollment_period_id": "EP-2023-FALL",
        "start_date": "2023-09-15",
        "end_date": "2023-10-15",
        "is_active": false
      },
      "EP-2024-MIDYEAR": {
        "enrollment_period_id": "EP-2024-MIDYEAR",
        "start_date": "2024-06-01",
        "end_date": "2024-06-30",
        "is_active": true
      },
      "EP-2024-LATE": {
        "enrollment_period_id": "EP-2024-LATE",
        "start_date": "2024-11-01",
        "end_date": "2024-11-30",
        "is_active": false
      }
    },
    "employee_plan_selections": {
      "E1001_EP-2024-MIDYEAR": {
        "employee_id": "E1001",
        "plan_id": "PLAN-HI-01",
        "enrollment_period_id": "EP-2024-MIDYEAR",
        "selection_date": "2024-06-04"
      },
      "E1002_EP-2024-MIDYEAR": {
        "employee_id": "E1002",
        "plan_id": "PLAN-DN-01",
        "enrollment_period_id": "EP-2024-MIDYEAR",
        "selection_date": "2024-06-10"
      },
      "E1005_EP-2024-MIDYEAR": {
        "employee_id": "E1005",
        "plan_id": "PLAN-VN-01",
        "enrollment_period_id": "EP-2024-MIDYEAR",
        "selection_date": "2024-06-13"
      },
      "E1004_EP-2023-FALL": {
        "employee_id": "E1004",
        "plan_id": "PLAN-HI-02",
        "enrollment_period_id": "EP-2023-FALL",
        "selection_date": "2023-09-18"
      },
      "E1003_EP-2022-SPRING": {
        "employee_id": "E1003",
        "plan_id": "PLAN-VN-01",
        "enrollment_period_id": "EP-2022-SPRING",
        "selection_date": "2022-03-05"
      },
      "E1001_EP-2023-FALL": {
        "employee_id": "E1001",
        "plan_id": "PLAN-LF-01",
        "enrollment_period_id": "EP-2023-FALL",
        "selection_date": "2023-09-17"
      }
    },
    "init_config": {}
  },
  "task": "Perform midyear adjustments in the currently active enrollment period as follows:\n- Add a new health insurance plan:\n  - plan_id: PLAN-HI-03\n  - plan_type: health insurance\n  - name: GreenShield Medical Standard\n  - coverage_details: Core medical, telehealth, urgent care, generic prescriptions.\n  - premiums: 310.25\n  - eligibility_criteria: FT_EMP\n- Update the existing dental plan PLAN-DN-01 to reflect new rates and coverage:\n  - Set premiums to 37.0\n  - Update coverage_details to: Preventive, basic and major dental; orthodontics for dependents; periodontal maintenance.\n- For employee E1001, change their current plan selection in the active enrollment period from PLAN-HI-01 to PLAN-HI-03.\n- For employee E1002, change their current plan selection in the active enrollment period from PLAN-DN-01 to PLAN-LF-01.\n- For employee E1005, withdraw their current plan selection in the active enrollment period.\n- Enroll employee E1004 into PLAN-HI-02 in the active enrollment period.",
  "checklist_with_func": [
    {
      "check_item": "Has the new health-insurance plan PLAN-HI-03 been created?",
      "check_func": "def check_func(final_state):\n    plans = final_state.get(\"benefit_plans\", {})\n    plan = plans.get(\"PLAN-HI-03\")\n    if not plan:\n        return False\n    return plan.get(\"plan_type\") == \"health insurance\""
    },
    {
      "check_item": "Has the plan_type of PLAN-HI-03 been set to \"health insurance\"?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-HI-03\")\n    if not plan:\n        return False\n    return plan.get(\"plan_type\") == \"health insurance\""
    },
    {
      "check_item": "Has the name of PLAN-HI-03 been set to \"GreenShield Medical Standard\"?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-HI-03\")\n    if not plan:\n        return False\n    return plan.get(\"name\") == \"GreenShield Medical Standard\""
    },
    {
      "check_item": "Has the coverage_details of PLAN-HI-03 been set to \"Core medical, telehealth, urgent care, generic prescriptions.\"?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-HI-03\")\n    if not plan:\n        return False\n    return plan.get(\"coverage_details\") == \"Core medical, telehealth, urgent care, generic prescriptions.\""
    },
    {
      "check_item": "Has the premiums of PLAN-HI-03 been set to 310.25?",
      "check_func": "def check_func(final_state):\n    # Check that PLAN-HI-03 exists in benefit_plans\n    if \"PLAN-HI-03\" not in final_state.get(\"benefit_plans\", {}):\n        return False\n    plan = final_state[\"benefit_plans\"][\"PLAN-HI-03\"]\n    # Verify the premiums field is exactly 310.25\n    return plan.get(\"premiums\") == 310.25"
    },
    {
      "check_item": "Has the eligibility_criteria of PLAN-HI-03 been set to \"FT_EMP\"?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-HI-03\")\n    if not plan:\n        return False\n    return plan.get(\"eligibility_criteria\") == \"FT_EMP\""
    },
    {
      "check_item": "Has the premiums of dental plan PLAN-DN-01 been updated to 37.0?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-DN-01\")\n    if not plan:\n        return False\n    return plan.get(\"premiums\") == 37.0"
    },
    {
      "check_item": "Has the coverage_details of dental plan PLAN-DN-01 been updated to \"Preventive, basic and major dental; orthodontics for dependents; periodontal maintenance.\"?",
      "check_func": "def check_func(final_state):\n    plan = final_state.get(\"benefit_plans\", {}).get(\"PLAN-DN-01\")\n    if not plan:\n        return False\n    expected = \"Preventive, basic and major dental; orthodontics for dependents; periodontal maintenance.\"\n    return plan.get(\"coverage_details\") == expected"
    },
    {
      "check_item": "Has employee E1001’s plan selection in the active enrollment period been changed from PLAN-HI-01 to PLAN-HI-03?",
      "check_func": "def check_func(final_state):\n    key = \"E1001_EP-2024-MIDYEAR\"\n    if key not in final_state.get(\"employee_plan_selections\", {}):\n        return False\n    selection = final_state[\"employee_plan_selections\"][key]\n    return selection.get(\"plan_id\") == \"PLAN-HI-03\""
    },
    {
      "check_item": "Has employee E1002’s plan selection in the active enrollment period been changed from PLAN-DN-01 to PLAN-LF-01?",
      "check_func": "def check_func(final_state):\n    key = \"E1002_EP-2024-MIDYEAR\"\n    if key not in final_state.get(\"employee_plan_selections\", {}):\n        return False\n    selection = final_state[\"employee_plan_selections\"][key]\n    return selection.get(\"plan_id\") == \"PLAN-LF-01\""
    },
    {
      "check_item": "Has employee E1005’s current plan selection in the active enrollment period been withdrawn?",
      "check_func": "def check_func(final_state):\n    eps = final_state.get(\"employee_plan_selections\", {})\n    for key, record in eps.items():\n        if record.get(\"employee_id\") == \"E1005\" and record.get(\"enrollment_period_id\") == \"EP-2024-MIDYEAR\":\n            return False\n    return True"
    },
    {
      "check_item": "Has employee E1004 been enrolled into PLAN-HI-02 in the active enrollment period?",
      "check_func": "def check_func(final_state):\n    active_period = None\n    for period_id, period in final_state.get(\"enrollment_periods\", {}).items():\n        if period.get(\"is_active\") is True:\n            active_period = period_id\n            break\n    if active_period is None:\n        return False\n    \n    for key, selection in final_state.get(\"employee_plan_selections\", {}).items():\n        if (\n            selection.get(\"employee_id\") == \"E1004\"\n            and selection.get(\"plan_id\") == \"PLAN-HI-02\"\n            and selection.get(\"enrollment_period_id\") == active_period\n        ):\n            return True\n    return False"
    }
  ]
}
