Tiered goals: ordered milestones with unlocks, tier-aware goal bar, TIER UNLOCKED alerts, next-unlock line
Test and Release / test (push) Successful in 1m21s
Test and Release / release (push) Successful in 4s

- 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:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 13:09:18 -08:00
1 parent 39840a20d7
commit 4c379a0245
20 files changed
+1089 -14

No files matched your search

+15 -1
View File
@@ -8,7 +8,7 @@ namespace StreamGoals\Core;
*/
final class Installer {
public const DB_VERSION = '3';
public const DB_VERSION = '4';
public static function activate(): void {
self::install_schema();
@@ -143,6 +143,20 @@ final class Installer {
KEY goal_enabled (goal_id,enabled)
) $c;" );
dbDelta( "CREATE TABLE {$p}goal_tiers (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
goal_id BIGINT UNSIGNED NOT NULL,
target_minor BIGINT UNSIGNED NOT NULL,
title VARCHAR(120) NOT NULL,
description VARCHAR(255) NOT NULL DEFAULT '',
reached_at DATETIME NULL,
reached_donation_id BIGINT UNSIGNED NULL,
created_at DATETIME NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY goal_target (goal_id,target_minor),
KEY reached_donation (reached_donation_id)
) $c;" );
update_option( 'sg_db_version', self::DB_VERSION );
}
}