PropertyUnitLedger (property_unit_ledger v1.0.0)

Copy Markdown View Source

Pure event replay for available/reserved/sold/withdrawn property inventory.

Replays input order; never guesses the ordering of conflicting source updates. Exact duplicate event IDs are idempotent; different payloads with the same ID are rejected. Expiration requires an explicit event, not the machine clock. This is an integration component, not a legal sales registry or database lock.

Summary

Functions

Apply a validated event without mutating the prior ledger.

Expired reservations at a caller-supplied UTC instant, without changing state.

Accepted events in their original processing order.

Replay in input order; return all rejections with zero-based input indices.

Functions

apply_event(ledger, event)

Apply a validated event without mutating the prior ledger.

due(ledger, as_of)

Expired reservations at a caller-supplied UTC instant, without changing state.

history(ledger)

Accepted events in their original processing order.

replay(events, ledger \\ %__MODULE__{})

Replay in input order; return all rejections with zero-based input indices.