View Source Ravix.Documents.Session.Validations (ravix v0.6.3)
Validation rules for session states
Link to this section Summary
Functions
Returns an error if all the informed ids are already loaded in the session
Return an error if the document is not in the session
Returns an error if the document is already marked for deletion
Returns an error if the document is in a deferred command
Returns an error if the document is already stored in the session
Link to this section Functions
@spec all_ids_are_not_already_loaded(list(), list()) :: {:error, :all_ids_already_loaded} | {:ok, [...]}
Returns an error if all the informed ids are already loaded in the session
@spec document_in_session?(Ravix.Documents.Session.State.t(), any()) :: {:error, :document_not_in_session} | {:ok, map()}
Return an error if the document is not in the session
@spec document_not_deleted(Ravix.Documents.Session.State.t(), binary()) :: {:ok, binary()} | {:error, :document_deleted}
Returns an error if the document is already marked for deletion
@spec document_not_in_deferred_command(Ravix.Documents.Session.State.t(), binary()) :: {:ok, binary()} | {:error, :document_already_deferred}
Returns an error if the document is in a deferred command
@spec document_not_stored(Ravix.Documents.Session.State.t(), binary()) :: {:error, {:document_already_stored, map()}} | {:ok, map()}
Returns an error if the document is already stored in the session
@spec load_documents_limit_reached(Ravix.Documents.Session.State.t(), list()) :: {:error, :max_amount_of_ids_reached} | {:ok, -1}
@spec session_request_limit_reached(Ravix.Documents.Session.State.t()) :: {:error, :max_amount_of_requests_reached} | {:ok, -1}