anchor.diff:      Mod:Decoder(decode_record(Term, json), TypeName);
   decode_record(Term, {custom_type, TypeName, Mod}) ->
       decode_record(Term, {custom_type, TypeName, {Mod, encode_value, decode_value}});
  -decode_record({Term}, {record, _Version, Fields}) when is_list(Fields), is_list(Term) ->
  +decode_record({Term}, {record, Version, Fields}) when is_list(Fields), is_list(Term) ->
  +    ModelName0 = decode_record(proplists:get_value(<<?RECORD_TYPE_MARKER>>, Term), atom),
  +    ModelName = maybe_rename_model(ModelName0, Version),
       list_to_tuple(lists:reverse(lists:foldl(
           fun({Name, Type}, RecordList) ->
               [decode_record(proplists:get_value(encode_record(key, Name, atom), Term), Type) | RecordList]
           end,
  -        [decode_record(proplists:get_value(<<?RECORD_TYPE_MARKER>>, Term), atom)], Fields)));
  +        [ModelName], Fields)));
   decode_record(Term, string) when is_binary(Term) ->
       Term;
   decode_record(Term, integer) when is_integer(Term) ->
       Term;
  +decode_record(Term, integer) when is_float(Term) andalso (Term =:= float(round(Term))) ->
  +    round(Term);
   decode_record(Term, integer) when is_binary(Term) ->
       binary_to_integer(Term);
  +decode_record(Term, float) when is_float(Term) ->
  +    Term;
   decode_record(Term, float) when is_integer(Term) ->
       float(Term);
  -decode_record(Term, float) when is_float(Term) ->
  -    Term;
   decode_record(Term, float) when is_binary(Term) ->
       binary_to_float(Term);
   decode_record({Term}, #{} = Struct) when is_list(Term) ->
  
positive.code: -spec record_upgrade(model_behaviour:model_type(), record_version(), record_version(), term()) ->
      {record_version(), term()}.
  record_upgrade(ModelName, TargetVersion, CurrentVersion, Record) when TargetVersion > CurrentVersion ->
      {NextVersion, NextRecord} = ModelName:upgrade_record(CurrentVersion, Record),
      case NextVersion > CurrentVersion of
          true ->
              record_upgrade(ModelName, TargetVersion, NextVersion, NextRecord);
  
negative.code: %% API
  -export([encode_record/1, decode_record/1, validate_struct/1]).
  -export([encode_record/2, decode_record/2]).
  -export([encode_record/3]).
  -export([decode_record_vcs/1, record_upgrade/4]).
  -export([get_renamed_models/0]).
  
  
  %%%===================================================================
  %%% API functions
  %%%===================================================================
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Maps old model name to new one.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_renamed_models() -> #{OldName :: model_behaviour:model_type() => {RenameVersion :: record_version(), NewName :: model_behaviour:model_type()}}.
  get_renamed_models() ->
      maps:merge(plugins:apply(node_manager_plugin, renamed_models, []),
          #{}
      ).
  
  
  %%--------------------------------------------------------------------
  %% @doc
  