Arc.CommandResult (cratis_arc v0.1.0)

Copy Markdown View Source

The outcome of executing a command, shaped as the Arc command result envelope.

Summary

Functions

The HTTP status the Arc contract maps this result to.

Whether the command was authorized, valid and free of exceptions.

Converts the result to the wire envelope.

Types

t()

@type t() :: %Arc.CommandResult{
  authorization_failure_reason: term(),
  authorized?: term(),
  correlation_id: term(),
  events: term(),
  exception_messages: term(),
  exception_stack_trace: term(),
  response: term(),
  validation_results: term()
}

Functions

status(r)

@spec status(t()) :: 200 | 400 | 403 | 500

The HTTP status the Arc contract maps this result to.

success?(r)

@spec success?(t()) :: boolean()

Whether the command was authorized, valid and free of exceptions.

to_wire(r)

@spec to_wire(t()) :: map()

Converts the result to the wire envelope.