Add goals repository and configurable rules engine

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 08:44:52 -08:00
1 parent 939193f258
commit 7155396312
19 files changed
+882

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
<?php
declare( strict_types=1 );
namespace StreamGoals\Rules;
/** A stored rule row: id, goal, type (add_time|counter|bonus) and decoded config. */
final class RuleDef {
public function __construct(
public readonly int $id,
public readonly int $goalId,
public readonly string $type,
public readonly array $config
) {}
/** Per-rule "reverse on refund" flag; defaults to true. */
public function reverseOnRefund(): bool {
return (bool) ( $this->config['reverse_on_refund'] ?? true );
}
}