MishkaPay.TaxCalculation.Items (Mishka Pay v0.0.1)

Copy Markdown View Source

Summary

Types

t()

The struct that builder/1 returns.

Functions

A sample %MishkaPay.TaxCalculation.Items{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaPay.TaxCalculation.Items{
  amount: Money.t(),
  amount_tax: Money.t() | nil,
  id: String.t() | nil,
  product_id: String.t() | nil,
  quantity: pos_integer() | nil,
  reference: String.t(),
  tax_behavior: (:inclusive | :exclusive) | nil,
  tax_code: String.t() | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:referenceString.t()yessanitize(trim) validate(not_nil_value, string, not_empty, max_len=500)
:amountMoney.t()yesvalidator {MishkaPay.Money, :field}
:quantitypos_integer() | nilno1validate(not_nil_value, integer, min_len=1)
:tax_codeString.t() | nilnosanitize(trim) validate(string, not_empty, max_len=100)
:tax_behavior:inclusive | :exclusive | nilnovalidate(enum=Atom[inclusive::exclusive])<br>validator {MishkaPay.Price, :tax_behavior}
:product_idString.t() | nilnosanitize(trim) validate(string, not_empty)
:idString.t() | nilnovalidate(string)
:amount_taxMoney.t() | nilnovalidator {MishkaPay.Money, :field}

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaPay.TaxCalculation.Items{} populated from defaults + type-based fallbacks.

keys()

keys(field)