Tiered goals: ordered milestones with unlocks, tier-aware goal bar, TIER UNLOCKED alerts, next-unlock line
- Tiers\TierPolicy (pure), TierRepository (atomic reached marking), Tiers\Recorder hooked before close-at-target - Admin tiers screen; goal target derived from the final tier - Overlay goal widget shows Tier N of M and fills within the tier; alert pill; donate form 'Next unlock' - Installer DB_VERSION 4 (sg_goal_tiers) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
39840a20d7
commit
4c379a0245
20 files changed
+1089
-14
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
declare( strict_types=1 );
|
||||
|
||||
namespace StreamGoals\Overlay;
|
||||
|
||||
/** Optional capability: goal tiers (milestones). Sources without it behave as if no goal had tiers. */
|
||||
interface TiersSource {
|
||||
|
||||
/**
|
||||
* Tiers of a goal ordered by target ascending. Rows with keys id, target_minor, title, description, reached_at.
|
||||
*
|
||||
* @return array<int,array<string,mixed>>
|
||||
*/
|
||||
public function tiersFor( int $goalId ): array;
|
||||
|
||||
/**
|
||||
* Tiers unlocked by each donation, ONE lookup for the whole page: donation id => [ {title} ].
|
||||
*
|
||||
* @param int[] $donationIds
|
||||
* @return array<int,array<int,array<string,mixed>>>
|
||||
*/
|
||||
public function tiersReachedFor( array $donationIds ): array;
|
||||
}
|
||||
Reference in new issue
Block a user