anchor.diff:                      }.
   
   %% Heartbeat Status translators
  -hb_status(down) -> 0;
  -hb_status(idle) -> 1;
  -hb_status(ready) -> 2;
  -hb_status(running) -> 3;
  -hb_status(restarting) -> 4;
  -hb_status(0) -> down;
  -hb_status(1) -> idle;
  -hb_status(2) -> ready;
  -hb_status(3) -> running;
  -hb_status(4) -> restarting.
  +hb_status_as_int(X) when is_integer(X) -> X;
  +hb_status_as_int(down) -> 0;
  +hb_status_as_int(up) -> 1.
  +hb_status_as_atom(X) when is_atom(X) -> X;
  +hb_status_as_atom(0) -> down;
  +hb_status_as_atom(1) -> up.
   
   %% Job Status translators
   job_status(new) -> 0;
  
positive.code: node_status_row_to_record(Row) ->
      #pushy_node_status{org_id = safe_get(<<"org_id">>, Row),
                         node_name = safe_get(<<"node_name">>, Row),
                         status = hb_status(safe_get(<<"status">>, Row)),
                         last_updated_by = safe_get(<<"last_updated_by">>, Row),
                         created_at = trunc_date_time_to_second(safe_get(<<"created_at">>, Row)),
                         updated_at = trunc_date_time_to_second(safe_get(<<"updated_at">>, Row))}.
  
negative.code:                                                            {error, term()}.
  %% @doc create an object given a pushy object record
  create_object(#pushy_node_status{status=Status}=NodeStatus) ->
      NodeStatus1 = NodeStatus#pushy_node_status{status=hb_status_as_atom(Status)},
      create_object(insert_node_status, NodeStatus1);
  %% This does not exactly follow the same pattern as it needs to
  %% insert a list of job_nodes into a separate table.
  