Persisted cost/lot specification (embedded schema).
Storage-layer counterpart of Beancount.CostSpec. Embedded inside
Beancount.Schemas.Posting via embeds_one/3; it has no table of its own.
Fields
per_amount- per-unit cost asDecimal.t(), ornil.per_currency- currency forper_amount.total_amount- total cost for all units ({{...}}), ornil.total_currency- currency fortotal_amount.date- acquisitionDate.t()used for lot matching, ornil.label- lot label string, ornil.merge- whentrue, matching lots are merged on deposit.
Example
%Beancount.Schemas.CostSpec{
per_amount: Decimal.new("150"),
per_currency: "USD",
total_amount: nil,
total_currency: nil,
date: ~D[2026-01-02],
label: "lot-a",
merge: false
}