Triple.Types.FeedbackRequest (triple v1.0.0)

Copy Markdown View Source

Request payload for POST /v1/customer-feedback/ — report enrichment data that is missing or wrong for a given transaction.

Build one with new/1 rather than constructing the struct directly.

Summary

Functions

Builds and validates a feedback report from a map or keyword list.

Types

report()

@type report() ::
  :brand_name
  | :brand_logo
  | :website
  | :email
  | :phone
  | :category
  | :subscription
  | :location

t()

@type t() :: %Triple.Types.FeedbackRequest{
  feedback: String.t() | nil,
  report: report() | String.t() | nil,
  response_value: String.t() | nil,
  transaction_id: String.t() | nil
}

Functions

new(attrs)

@spec new(map() | keyword()) :: {:ok, t()} | {:error, Triple.Error.t()}

Builds and validates a feedback report from a map or keyword list.

report may be given as an atom (:brand_name) or string ("brand_name"); one of brand_name, brand_logo, website, email, phone, category, subscription, location.

Returns {:ok, t()} or {:error, %Triple.Error{type: :validation}}.