anchor.diff:  -license("Apache License 2.0").
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -%% Records.
  -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -
  --record(sumo_doc, {
  -  name :: atom(),
  -  fields=[] :: sumo:doc()
  -}).
  -
  --record(sumo_field, {
  -  name :: atom(),
  -  type :: atom(),
  -  attrs=[] :: sumo:field_attrs()
  -}).
  -
  --record(sumo_schema, {
  -  name :: atom(),
  -  fields=[] :: [field()]
  -}).
  -
  -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% Exports.
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  
positive.code: %% @doc Returns the name of the schema
  -spec schema_name(schema()) -> sumo:schema_name().
  schema_name(Schema) ->
    Schema#sumo_schema.name.
  
  %% @doc Returns the fields of the schema
  -spec schema_fields(schema()) -> [field()].
  schema_fields(Schema) ->
    Schema#sumo_schema.fields.
  
  %% @doc Returns the doc name
  -spec doc_name(doc()) -> atom().
  doc_name(Doc) ->
    Doc#sumo_doc.name.
  
  -spec doc_fields(doc()) -> sumo:doc().
  doc_fields(Doc) ->
    Doc#sumo_doc.fields.
  
  %% @doc Wakes up the document
  -spec wakeup(doc()) -> sumo:user_doc().
  
negative.code: %% @doc Wakes up the document
  -spec wakeup(module(), doc()) -> sumo:user_doc().
  wakeup(DocName, Doc) ->
    Fields = maps:get(fields, Doc, []),
    DocName:sumo_wakeup(Fields).
  
  %% @doc Returns all the configured docs.
  -spec get_docs() -> [{atom(), atom()}].
  