## Summary
- Implement subscription tier system (Free/Pro/Enterprise) to gate premium features
- Gate "Scan for Maintenance Schedule" checkbox behind Pro tier
- Add reusable infrastructure for adding new gated features
## Changes
### Backend
- Create `feature-tiers.ts` with FEATURE_TIERS config and tier utilities
- Add `/api/config/feature-tiers` endpoint for frontend config sync
- Create `requireTier` middleware for route-level tier enforcement
- Add `subscriptionTier` to `request.userContext` in auth plugin
- Gate scanForMaintenance in documents controller (returns 403 for free users)
- Add data migration to reset scanForMaintenance for existing free users
### Frontend
- Create `useTierAccess` hook for checking feature access
- Create `UpgradeRequiredDialog` component (mobile + desktop responsive)
- Gate DocumentForm checkbox with lock icon for free users
- Add `SubscriptionTier` type to profile types
### Documentation
- Add comprehensive `docs/TIER-GATING.md` usage guide
## Test plan
- [x] 30 unit tests pass (feature-tiers, tier-guard, controller tier validation)
- [ ] Free user sees disabled checkbox with lock icon on document form
- [ ] Clicking lock icon opens UpgradeRequiredDialog
- [ ] Pro/Enterprise user sees normal checkbox
- [ ] Backend returns 403 if free user bypasses frontend and sends scanForMaintenance=true
- [ ] Admin can change user tier from Admin UI
## Related Issues
Closes #8
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Changes
Backend
feature-tiers.tswith FEATURE_TIERS config and tier utilities/api/config/feature-tiersendpoint for frontend config syncrequireTiermiddleware for route-level tier enforcementsubscriptionTiertorequest.userContextin auth pluginFrontend
useTierAccesshook for checking feature accessUpgradeRequiredDialogcomponent (mobile + desktop responsive)SubscriptionTiertype to profile typesDocumentation
docs/TIER-GATING.mdusage guideTest plan
Related Issues
Closes #8
🤖 Generated with Claude Code