{
  "name": "dialog/productivity_report/reduce.json",
  "definition": {
    "wpa_produced_amount": {
      "reduce": "sum",
      "field": "wpa_produced_amount",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed"}
    },
    "wpa_failed_amount": {
      "reduce": "sum",
      "field": "wpa_failed_amount",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed"}
    },
    "wpa_work_time__amount": {
      "reduce": "sum",
      "field": "wpa_work_time__amount",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed"}
    },
    "wlg_header": {
      "map": {"name": "dialog/productivity_report/map.json", "definition": "wlg_header"},
      "reduce": "first",
      "field": "wlg_header",
      "default": ""
    },
    "wos_finished": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "wos_finished"}
    },
    "wos_produced_amount": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "wos_select_phase"},
      "reduce": "first",
      "field": "wos_produced_amount",
      "default": 0
    },
    "wos_failed_amount": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "wos_select_phase"},
      "reduce": "first",
      "field": "wos_failed_amount",
      "default": 0
    },
    "finished_repair_amount": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "finished_reclamation"},
      "reduce": "sum",
      "field": "rcl_repair_amount"
    },
    "finished_rejected_amount": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "finished_reclamation"},
      "reduce": "sum",
      "field": "rcl_rejected_amount"
    },
    "work_time_all": {
      "reduce": "sum",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "work_time_all"},
      "field": "wpa_work_time__amount",
      "round": 1
    },
    "before_time_period_count": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "before_time_period_count"}
    },
    "after_time_period_count": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "after_time_period_count"}
    },
    "capacity": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "capacity"},
      "reduce": "sum",
      "field": "hours"
    },
    "planned_hour": {
      "info": "currently same as capacity",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "capacity"},
      "reduce": "sum",
      "field": "hours"
    },
    "actual_hour": {
      "info": "AGA: fix, map to new field setup time + work time?, MUST divide by shift",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "capacity_work_time"},
      "reduce": "sum",
      "field": "wpa_work_time__amount"
    },
    "actual_machine_hour": {
      "info": "AGA: fix",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "capacity_work_time"},
      "reduce": "sum",
      "field": "wpa_machine_hours"
    },
    "unproductive_hour": {
      "info": "AGA: fix",
      "reduce": "value",
      "value": 0
    },

    "rcl_repair_amount": {
       "reduce": "sum",
       "field": "rcl_repair_amount"
    },
    "rcl_rejected_amount": {
       "filter": {"name": "dialog/productivity_report/filter.json", "definition": "rcl_rejected_amount"},
       "reduce": "sum",
       "field": "rcl_rejected_amount"
    },
    "track_time_asked_counter": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "track_time_asked"}
    },
    "track_time_measured_counter": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "track_time_measured"}
    },
    "track_time_changed_counter": {
      "reduce": "count",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "track_time_changed"}
    },
    "track_time_changed_percent": {
      "reduce": "sum",
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "track_time_changed"},
      "field": "track_time_change_percent"
    },
    "previous_measured_track_time":{
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "previous_measured_track_time"},
      "reduce": "first",
      "field": "wpa_measured_track_time",
      "default": 0
    },
    "work_time_fixed":{
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed_row_calculate"},
      "reduce": "first",
      "field": "wpa_work_time__amount",
      "default": 0
    },
    "target_time_fixed":{
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "speed_row_calculate"},
      "reduce": "first",
      "field": "wpa_target_time",
      "default": 0
    },
    "previous_batch_number":{
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "previous_measured_track_time"},
      "reduce": "first",
      "field": "wo_row_number",
      "default": 0
    },
    "estimated_work_time__unit": {
      "filter": {"name": "dialog/productivity_report/filter.json", "definition": "estimated_work_time"},
      "reduce": "first",
      "field": "wpe_work_time__unit",
      "default": 0
    }
  }
}
