starkbank v2.4.1 StarkBank.Invoice.Log View Source

Groups Invoice.Log related functions

Link to this section Summary

Functions

Every time a Invoice entity is updated, a corresponding Invoice.Log is generated for the entity. This log is never generated by the user, but it can be retrieved to check additional information on the Invoice.

Receive a single Log struct previously created by the Stark Bank API by passing its id

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive a stream of Log structs previously created in the Stark Bank API

Same as query(), but it will unwrap the error tuple and raise in case of errors.

Link to this section Types

Link to this type

t()

View Source
t() :: %StarkBank.Invoice.Log{
  created: term(),
  errors: term(),
  id: term(),
  invoice: term(),
  type: term()
}

Link to this section Functions

Link to this function

%StarkBank.Invoice.Log{}

View Source (struct)

Every time a Invoice entity is updated, a corresponding Invoice.Log is generated for the entity. This log is never generated by the user, but it can be retrieved to check additional information on the Invoice.

Attributes:

  • :id [string]: unique id returned when the log is created. ex: "5656565656565656"
  • :invoice [Invoice]: Invoice entity to which the log refers to.
  • :errors [list of strings]: list of errors linked to this Invoice event
  • :type [string]: type of the Invoice event which triggered the log creation. ex: "created", "paid", "canceled" or "overdue"
  • :created [DateTime]: creation datetime for the log. ex: ~U[2020-03-26 19:32:35.418698Z]
Link to this function

get(id, options \\ [])

View Source
get(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) ::
  {:ok, StarkBank.Invoice.Log.t()}
  | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a single Log struct previously created by the Stark Bank API by passing its id

Parameters (required):

  • id [string]: struct unique id. ex: "5656565656565656"

Options:

  • :user [Organization/Project]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • Log struct with updated attributes
Link to this function

get!(id, options \\ [])

View Source
get!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: StarkBank.Invoice.Log.t()

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Link to this function

query(options \\ [])

View Source
query(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  types: [binary()],
  invoice_ids: [binary()],
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, {:ok, [StarkBank.Invoice.Log.t()]}}
   | {:error, [StarkBank.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Receive a stream of Log structs previously created in the Stark Bank API

Options:

  • :limit [integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
  • :after [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
  • :types [list of strings, default nil]: filter for log event types. ex: "created", "paid", "canceled" or "overdue"
  • :invoice_ids [list of strings, default nil]: list of Invoice ids to filter logs. ex: ["5656565656565656", "4545454545454545"]
  • :user [Organization/Project]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • stream of Log structs with updated attributes
Link to this function

query!(options \\ [])

View Source
query!(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  types: [binary()],
  invoice_ids: [binary()],
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, [StarkBank.Invoice.Log.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Same as query(), but it will unwrap the error tuple and raise in case of errors.