Files
wp-donations/includes/Overlay/TiersSource.php
T
shadowdaoandClaude Sonnet 5.5 4c379a0245
Test and Release / test (push) Successful in 1m21s
Test and Release / release (push) Successful in 4s
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>
2026-11-15 13:09:18 -08:00

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;
}