- 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>
24 lines
675 B
PHP
24 lines
675 B
PHP
<?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;
|
|
}
|