Locks and returns the account rewards for id now land on: itself, or
where it was promoted to. Waits on id's lock, which a running promotion
holds, then follows a promotion it committed.
The account a recipient resolves to, without creating one: null when it has none yet. For reads, so probing an email or phone writes nothing.
Moves every pending account addressed to the entity's email or phone onto the entity's own account, once the entity is approved. Each pending account's ledger rows are repointed and the account is stamped promoted, in one transaction, so a retry finds nothing left to move.
the ids of the pending accounts that were promoted
The account a recipient's rewards land on, created on first use. A phone or email already held by a live identity resolves to that identity's account, so a promo sent to a member is not left pending.
approved is whether the owning entity may transact; false for a pending
account. Debits and claims require it.
Optionaltx: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>
Resolves a recipient to the reward account that holds its balance, and moves a pending account onto an entity's account when the entity is approved.