- Actions\Matcher (exact / every), ActionRepository, Recorder (idempotent via unique key) - Admin: Rewards screen with live preview, queue with Mark done, menu badge - Donate form shows actions as payment buttons; overlay 'actions' widget; alerts list triggered actions - Installer DB_VERSION 2 (sg_actions, sg_action_events) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
26 lines
825 B
PHP
26 lines
825 B
PHP
<?php
|
|
declare( strict_types=1 );
|
|
|
|
namespace StreamGoals\Overlay;
|
|
|
|
/** Optional capability: donation actions (rewards). Sources without it simply show no actions. */
|
|
interface ActionsSource {
|
|
|
|
/**
|
|
* Enabled actions for the goal (goal_id = $goalId or 0), already filtered to the effective minimum and ordered.
|
|
* Raw rows with keys title, description, amount_minor, mode.
|
|
*
|
|
* @return array<int,array<string,mixed>>
|
|
*/
|
|
public function menuActions( int $goalId ): array;
|
|
|
|
/**
|
|
* Triggered actions per donation (sg_action_events), in trigger order. One lookup for the whole page.
|
|
* Raw rows with keys title, times; Payloads sanitizes them.
|
|
*
|
|
* @param int[] $donationIds
|
|
* @return array<int,array<int,array<string,mixed>>> donation id => events
|
|
*/
|
|
public function actionsFor( array $donationIds ): array;
|
|
}
|