Add donation actions (rewards): menu editor + queue, donate-form buttons, overlay menu widget, alert lines
- 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>
This commit is contained in:
1 parent
c62ac06b27
commit
b0b5012698
25 files changed
+1227
-7
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in new issue
Block a user