AshOnetime.Boundary.Change (ash_onetime v1.9.2)

Copy Markdown View Source

Places a conditional context-boundary append on a create action.

The query, cutoff, facts, and tenant are resolved from literal options and {:argument, name} / {:attribute, name} references — action input carries the caller's read results, and the append itself runs in the action's transaction via AshOnetime.Boundary.append_if/5. A changed context fails the action with a typed :context_changed error carrying the seq that moved; admitted seqs are stamped into the record's metadata under :ash_onetime_boundary.

change {AshOnetime.Boundary.Change,
        query: {:all, [tag: {:argument, :context_tag}, type: "refund"]},
        cutoff: {:argument, :context_cutoff},
        facts: {:argument, :context_facts}}