Summary
Functions
A sample %MishkaPay.TaxCalculation.Items{} populated from defaults + type-based fallbacks.
Types
@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.
| Field | Type | Required | Default | Description | Derives |
|---|---|---|---|---|---|
:reference | String.t() | yes | sanitize(trim) validate(not_nil_value, string, not_empty, max_len=500) | ||
:amount | Money.t() | yes | validator {MishkaPay.Money, :field} | ||
:quantity | pos_integer() | nil | no | 1 | validate(not_nil_value, integer, min_len=1) | |
:tax_code | String.t() | nil | no | sanitize(trim) validate(string, not_empty, max_len=100) | ||
:tax_behavior | :inclusive | :exclusive | nil | no | validate(enum=Atom[inclusive::exclusive])<br>validator {MishkaPay.Price, :tax_behavior} | ||
:product_id | String.t() | nil | no | sanitize(trim) validate(string, not_empty) | ||
:id | String.t() | nil | no | validate(string) | ||
:amount_tax | Money.t() | nil | no | validator {MishkaPay.Money, :field} |