{
  "name": "dialog/productivity_report/map.json",
  "definition": {
    "wlg_header": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "wlg_header"},
      "map": [
        ["wlg_header", "=", ["concat", [", ", "wlg_name"]]]
      ]
    },
    "capacity": {},
    "reclamation": {
      "filterX": {"name": "dialog/productivity_report/filter.json", "definition": "reclamation"},
      "map": [
        ["reclamation_row_dimmed", "=", [
          ["rcl_state", "==", 0],
          "or",
          ["rcl_finished_date", "<", "param.start_date"],
          "or",
          ["rcl_finished_date", ">", "param.end_date"]
         ]]
      ]
    },
    "track_time": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "track_time_map"},
      "map": [
        ["previous_batch_number", "=", 1],
        ["track_time_asked", "=", [["wpa_track_time_status", ">=", 1], "and", ["wpa_track_time_status", "<=", 4]]],
        ["track_time_measured", "=", [["wpa_track_time_status", ">=", 2], "and", ["wpa_track_time_status", "<=", 3]]],
        ["previous_measured_track_time", "=", ["reduce", ["previous_measured_track_time"]]],
        ["track_time_change", "=", ["wpa_measured_track_time", "-", "previous_measured_track_time"]],
        ["track_time_change_percent", "=", [["track_time_change", "/", "previous_measured_track_time"],"*", 100]]
      ],
      "map_fix": [
        ["previous_batch_number", "=", ["reduce", ["previous_batch_number"]]]
      ]
    },
    "speed": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed_map"},
      "map": [
        ["wos_finished", "=", ["reduce", ["wos_finished", "wos"]]],
        ["work_time_time_period", "=", ["reduce", ["work_time_all"]]],
        ["work_time_before", "=", ["reduce", ["work_time_all", "wpa_before"]]],
        ["work_time_after", "=", ["reduce", ["work_time_all", "wpa_after"]]],
        ["work_time_all", "=", ["work_time_time_period", "+", ["work_time_before", "+", "work_time_after"]]],
        ["std_time", "=", [["wpa_work_time__amount", "/", "work_time_all"], "*", "wpa_target_time"]],
        ["before_time_period_count", "=", ["reduce", ["before_time_period_count", "wpa_before"]]],
        ["after_time_period_count", "=", ["reduce", ["after_time_period_count", "wpa_after"]]],
        ["wos_produced", "=", ["reduce", ["wos_produced_amount", "wos"]]],
        ["wos_failed", "=", ["reduce", ["wos_failed_amount", "wos"]]],
        ["work_time__unit", "=", ["wpa_work_time__amount", "/", ["wos_produced", "+", "wos_failed"]]],
        ["estimated_work_time__unit", "=", ["reduce", ["estimated_work_time__unit", "wpe"]]],
        ["estimated_speed_percent", "=", [["estimated_work_time__unit", "/", "work_time__unit"], "*", 100]],
        ["finished_work_time", "=", ["wpa_work_time__amount", "*", "wos_finished"]],
        ["finished_std_time", "=", ["std_time", "*", "wos_finished"]],
        ["finished_work_time__unit", "=", ["work_time__unit", "*", "wos_finished"]],
        ["finished_estimated_work_time__unit", "=", ["estimated_work_time__unit", "*", "wos_finished"]]
      ],
      "map_Y": [
       ["speed_percent", "=", [["std_time", "/", "wpa_work_time__amount"], "*", 100]],
       ["work_time_all", "=", ["reduce", ["work_time_all"]]],
       ["work_time", "=", ["reduce", ["work_time_fixed"]]],
       ["target_time_fixed", "=", ["reduce", ["target_time_fixed"]]],
       ["std_time", "=", [["work_time", "/", "work_time_all"], "*", "target_time_fixed"]]
      ],
      "map_reduce_remove_test": [
        ["wos_finished", "=", 1],
        ["work_time_all", "=", 1],
        ["work_time", "=", 1],
        ["target_time_fixed", "=", 1],
        ["std_time", "=", [["work_time", "/", "work_time_all"], "*", "target_time_fixed"]],
        ["speed_percent", "=", [["std_time", "/", "wpa_work_time__amount"], "*", 100]],
        ["before_time_period_count", "=", 1],
        ["after_time_period_count", "=", 1],
        ["wos_produced", "=", 1],
        ["wos_failed", "=", 1],
        ["work_time__unit", "=", ["wpa_work_time__amount", "/", ["wos_produced", "+", "wos_failed"]]],
        ["estimated_work_time__unit", "=", 1],
        ["estimated_speed_percent", "=", [["estimated_work_time__unit", "/", "work_time__unit"], "*", 100]]
      ]
    },
    "xxx": {
      "mapXX": [
        ["estimated_speed_percent", "=", ["select", [["a", ">", 3], "x", ["a", "<", 3], "y"]]],
        ["wos_open", "=", ["wpa_production_lot", "wpa_work_phase_est_id"]],
        ["speed", "=", "15"],
        ["emp", "=", ["lowercase", ["wpa_employee_id"]]]
      ]
    }
  }
}
