Zusammenfassung des Problems:
- BellValue wurde in Zeile 357 auf false zurückgesetzt, BEVOR es für Trigger ausgewertet wurde
- afterThrowState.ThrowPanel.BellValue war dadurch immer false
- Bell-Expenses und Bell-GIFs wurden nie ausgelöst
Lösung:
- bellValue wird jetzt als separater Parameter aus action.AfterThrowState.BellValue übergeben
- Die Auswertung erfolgt mit dem ursprünglichen Wert, bevor er zurückgesetzt wird
Summary of Changes:
Phase 1-3 (Domain/Infrastructure/Application):
- ThrowEventType enum with Strike, Circle, Bell, Gutter flags
- ClubGif, ClubGifRating, GifSubmissionToken entities
- EF configurations with proper indexes
- ClubGifRepository with weighted random selection
- MediaStorageService for file storage (wwwroot/club-media/{LoginName}/gifs/)
- ClubGifService with rating system and auto-disable at -5 threshold
Phase 4-5 (Admin UI & Playback):
- Admin page at /club/{ClubId}/admin/gifs with Upload, Import, Edit, Token management
- QR code generation for submission tokens
- GifPlayer component with overlay, rating buttons, and dismiss
- Fluxor state management (GifState, actions, reducers, effects)
Phase 6 (Anonymous Submission):
- Public page at /gif/submit/{Token} with EmptyLayout
- Token validation and file upload
Phase 7 (Game Integration + Migration):
- Database migration AddClubGifFeature applied
- GameEffects.TriggerGifForEventsAsync triggers GIFs on special throws
- SignalR broadcast via BroadcastGifTriggeredAsync to all clients
- DayDetails.razor includes GifPlayer and handles SignalR GIF events
Key Features:
- GIFs play on Strike (alle 9), Circle (Kranz), Bell (Glocke), Gutter (Rinne)
- Weighted random selection based on ratings
- Real-time sync across all connected clients via SignalR
- Thumbs up/down rating with auto-disable at -5
- Max file size: 20MB, Video duration: 15s
- Supports GIF, MP4, WebM formats
Zusammenfassung der Änderungen:
1. GameState.cs - Neue Properties hinzugefügt:
- IsGameOver - zeigt an, dass das Spiel beendet ist
- WinnerId - ID des Gewinners
2. GameReducers.cs:
- OnProcessThrowResult setzt jetzt IsGameOver und WinnerId
- OnExecuteGameActionSuccess setzt jetzt IsGameOver und WinnerId
- OnStartGameSuccess setzt IsGameOver=false
- OnEndGameSuccess setzt IsGameOver=false
3. GameEffects.cs:
- HandleRecordThrow blockiert Eingaben wenn IsGameOver=true
- HandleExecuteGameAction blockiert Eingaben wenn IsGameOver=true
- EndGameAction wird nicht automatisch dispatcht - der Benutzer muss das Spiel explizit über die UI beenden
Verhalten jetzt:
- Wenn ProcessThrow oder ExecuteAction IsGameOver=true zurückgibt, wird der State auf IsGameOver=true gesetzt
- Die Tafel bleibt sichtbar mit dem Endergebnis
- Weitere Würfe/Actions werden blockiert
- Der Benutzer muss EndGameAction explizit über einen Button in der UI auslösen
Die UI muss jetzt GameState.IsGameOver und GameState.WinnerId nutzen, um:
1. Eingaben zu deaktivieren
2. Eine "Spiel beenden"-Schaltfläche anzuzeigen
- IGameHubClient: client interface for SignalR messages
- GameHub: SignalR hub with group management for games/days
- GameHubService: scoped service wrapper with auto-reconnect
- GameEffects: broadcasts game start/end/state via SignalR
- EndGameAction: extended with winner info and final scores
- Program.cs: AddSignalR + MapHub configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extend Game entity with GameType, Status, StartedAt, CompletedAt, RowVersion
- Add GameConfiguration with RowVersion for optimistic concurrency
- Create IGamePersistenceService interface
- Implement GamePersistenceService with CRUD operations
- Create GameStateSerializationDto for JSON serialization
- Extend GameEffects with full persistence lifecycle:
- HandleStartGame: Creates game in DB
- HandleEndGame: Updates status to Completed/Aborted
- HandleLoadActiveGame: Recovery from page reload
- HandleRecordThrow: Debounced save (500ms)
- HandleSaveGameState: Explicit save with concurrency check
- Add migration ExtendGameEntity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add UndoButton.razor as reusable component
- Refactor GameInputPanel to use UndoButton component
- Enhance GameEffects with proper UndoThrowAction handler
- IState injection for state access in effects
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GameType, GameStatus, PinStatus, ThrowMode, ParticipantsMode enums
- GameState with ThrowPanelState, ParticipantsState, GameSnapshot
- GameActions for lifecycle, throws, undo, persistence, SignalR
- GameReducers for all actions
- GameEffects placeholder for later phases
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extend DayState with SelectedDayExpenses, AvailableExpenses
- Add Fluxor actions for load/create/update/delete expenses
- Add reducers + effects for PersonExpense operations
- Create AddPersonExpenseDialog with inverse expense support
- Update DayDetails with expense table, summary, status toggle
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- ExpenseState.cs: state record with Expenses, SelectedExpense, IsLoading, Error
- ExpenseActions.cs: Load/Create/Update/Delete actions + Select/ClearError
- ExpenseReducers.cs: pure state transformations
- ExpenseEffects.cs: async service calls with logging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of all fixes
3 files changed:
1. src/Koogle.Application/Services/UserService.cs:140-171
- GetByIdentityUserIdAsync now includes .Include(p => p.Clubs) and maps ClubMemberships
2. src/Koogle.Web/Store/AuthState/AuthEffects.cs:53-73
- Merges club-specific roles from ClubMemberships into AuthState roles
3. src/Koogle.Infrastructure/Security/ClubRoleRequirement.cs:17-114
- Changed ClubRoleHandler to extend AuthorizationHandler<ClubRoleRequirement> (no resource)
- Reads current_club_id from claims to determine club context
- Added ClubRoleResourceHandler for resource-based auth (explicit clubId)
4. src/Koogle.Infrastructure/DependencyInjection.cs:72
- Registered ClubRoleResourceHandler
The [Authorize(Policy = "ClubViewer")] attribute now uses current_club_id claim set during login to check club roles.
- PersonState.cs: State record with Persons, SelectedPerson, IsLoading, Error
- PersonActions.cs: Load/Create/Update/Delete actions with success/failure variants
- PersonReducers.cs: Pure reducers for all person actions
- PersonEffects.cs: Async effects calling IPersonService
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>