The shape of each kind of MishkaPay.Ash.Resource, in one place: its attributes, identities,
calculations and actions (with their arguments, changes and options), the code interface name
of each action, the listener that keeps it current and, for the inbox, its AshOban trigger.
MishkaPay.Ash.Resource.ApplyKind adds them to a host's resource with Ash.Resource.Builder,
skipping whatever the host defines itself.
Summary
Functions
The names of a kind's actions, in the order they are added.
The actions of a kind, with :resync for every provider object's kind. announce?: false
builds their changes without the
mishka_pay:<kind>:changed event; user: names the belongs_to_user attribute, which a sync
writes from the owner and a customer's :register accepts.
The attributes of a kind, after its :id primary key and before its timestamps.
The calculations of a kind: its amounts as Money, and for a subscription :active? (gives
access now, as MishkaPay.Ash.Subscribed counts it by default), :on_trial? and :canceling?
(ends at the period's end), each usable in a filter or a sort.
The inbox's daily AshOban trigger that deletes processed events older than days.
The identity that keeps each provider object (or event) once.
The code interface name of an action. receive is an Elixir special form, so the inbox's
:receive is receive_event.
Every kind.
The listener macro module that keeps a resource of the kind current from webhooks.
The hourly AshOban trigger that reads again, with :resync, the rows of kind still open at
their provider and not read for hours; nil for a kind whose rows are never open.
The inbox's AshOban trigger, as oban do triggers do trigger :process ... end end writes it.
Its worker and scheduler are named after the resource, so two inboxes never share them.
Types
Functions
The names of a kind's actions, in the order they are added.
The actions of a kind, with :resync for every provider object's kind. announce?: false
builds their changes without the
mishka_pay:<kind>:changed event; user: names the belongs_to_user attribute, which a sync
writes from the owner and a customer's :register accepts.
The attributes of a kind, after its :id primary key and before its timestamps.
The calculations of a kind: its amounts as Money, and for a subscription :active? (gives
access now, as MishkaPay.Ash.Subscribed counts it by default), :on_trial? and :canceling?
(ends at the period's end), each usable in a filter or a sort.
@spec forget_trigger(module(), pos_integer()) :: keyword()
The inbox's daily AshOban trigger that deletes processed events older than days.
The identity that keeps each provider object (or event) once.
The code interface name of an action. receive is an Elixir special form, so the inbox's
:receive is receive_event.
@spec kinds() :: [kind()]
Every kind.
The listener macro module that keeps a resource of the kind current from webhooks.
@spec resync_trigger(module(), kind(), pos_integer()) :: keyword() | nil
The hourly AshOban trigger that reads again, with :resync, the rows of kind still open at
their provider and not read for hours; nil for a kind whose rows are never open.
The inbox's AshOban trigger, as oban do triggers do trigger :process ... end end writes it.
Its worker and scheduler are named after the resource, so two inboxes never share them.