WHAT THIS ADDS: - Discord role sync on new subscriptions (checkout.session.completed) - Discord role removal on chargebacks (charge.dispute.created) - Grace period expiration job (hourly cron check) - Automatic downgrade to Awakened when grace period expires NEW FILES: - src/services/discordRoleSync.js - Role add/remove/sync functions - src/sync/graceExpiration.js - Grace period expiration processor MODIFIED FILES: - src/routes/stripe.js - Added role sync calls to webhook handlers - src/discord/events.js - Initialize role sync service on bot ready - src/sync/cron.js - Added grace period check to hourly job - src/index.js - Import discordRoleSync service PHILOSOPHY: 'We Don't Kick People Out' - expired grace periods downgrade to permanent Awakened tier (tier 1, lifetime). Users keep community access, just lose premium perks. ROLE MAPPING (tier_level -> role key): 1=the-awakened, 2=fire-elemental, 3=frost-elemental, 4=fire-knight, 5=frost-knight, 6=fire-master, 7=frost-master, 8=fire-legend, 9=frost-legend, 10=the-sovereign CHARGEBACKS: - Immediate role removal - Added to banned_users table - Full audit logging Signed-off-by: Claude (Chronicler #62) <claude@firefrostgaming.com>
3.4 KiB
3.4 KiB