Commit Graph

34 Commits

Author SHA1 Message Date
beo3000 dd4317bf80 fix Seeder, QR-Copde Copy Clipboard 2025-12-30 18:21:46 +01:00
beo3000 9aee6b50c0 add gif-Seeder and gif-Templates:
Zusammenfassung der Änderungen

  Template-GIF Seeding implementiert:

  1. DemoSeeder.cs aktualisiert:
  - SeedTemplateGifsAsync() - Öffentliche Methode für externes Seeding
  - SeedTemplateGifsInternalAsync() - Kopiert GIFs vom Template-Ordner und erstellt DB-Einträge
  - DeleteClubGifsAsync() - Löscht GIF-Dateien und DB-Einträge beim Reset
  - ResetDemoClubAsync() - Löscht nun auch GIFs und seedet sie neu
  - SeedAsync() - Seedet Template-GIFs beim Demo-Club-Setup

  2. IClubGifService.cs erweitert:
  - SeedTemplateGifsAsync(Guid clubId) - Neue Interface-Methode

  3. ClubGifService.cs erweitert:
  - SeedTemplateGifsAsync() implementiert - Liest giftemplates.json, kopiert Dateien und erstellt ClubGif-Einträge

  4. ClubService.cs aktualisiert:
  - Injiziert IClubGifService
  - CreateAsync() seedet automatisch Template-GIFs für neue Clubs

  Ablauf:

  1. Neuer Club: Template-GIFs werden automatisch kopiert nach wwwroot/club-media/{LoginName}/gifs/
  2. Demo-Reset: Alte GIFs werden gelöscht, Templates neu kopiert
  3. Demo-Seed: Template-GIFs werden geseedet falls noch keine vorhanden

  Template-Struktur:

  wwwroot/club-template/gifs/
  ├── giftemplates.json        # Definition der GIFs
  ├── 44f5bc11-...-d1215.gif   # Strike GIF
  └── 297970f3-...-a2a93.gif   # NoWood GIF
2025-12-30 18:00:11 +01:00
beo3000 a3a5c288a1 added giftype NoWood 2025-12-30 17:43:10 +01:00
beo3000 752523fe78 added gif-Feature:
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
2025-12-30 14:57:06 +01:00
beo3000 0e4e1530ed added LoginName for Clubs 2025-12-30 11:57:01 +01:00
beo3000 21130895d4 add statistics:
Erfasste Metriken:
  - ThrowCount, PinCount, ClearedCount, GutterCount, CircleCount, StrikeCount, BellCount

  Widget zeigt:
  - Jahres-Übersicht (Spiele, Würfe, Kegel, Durchschnitt)
  - Top 5 Kegler Rangliste
  - Monatstrend-Tabelle
2025-12-29 15:27:25 +01:00
beo3000 5c088345b3 add demo-club:
Neue Dateien (5)

  | Datei                                                  | Zweck                |
  |--------------------------------------------------------|----------------------|
  | src/Koogle.Infrastructure/Data/DemoSeeder.cs           | Seeder + Reset-Logik |
  | src/Koogle.Domain/Interfaces/IDemoResetService.cs      | Interface            |
  | src/Koogle.Infrastructure/Services/DemoResetService.cs | Service              |
  | src/Koogle.Web/Store/Demo/DemoActions.cs               | Fluxor Actions       |
  | src/Koogle.Web/Store/Demo/DemoEffects.cs               | Fluxor Effects       |

  Geaenderte Dateien (6)

  | Datei                        | Aenderung                     |
  |------------------------------|-------------------------------|
  | appsettings.Development.json | Demo-Config hinzugefuegt      |
  | Program.cs                   | DemoSeeder.SeedAsync() Aufruf |
  | DependencyInjection.cs       | IDemoResetService registriert |
  | Login.razor                  | Demo-Hinweis-Box              |
  | Clubs.razor                  | Reset-Button + Confirm-Dialog |

  Demo-Daten

  - User: demo@koogle.de / demo123 (ClubAdmin, kein SuperAdmin)
  - Club: "Demo"
  - 8 Mitglieder: Hans Maier, Klaus Schmidt, Werner Braun, Dieter Fischer, Juergen Weber, Heinz Mueller, Rolf Schneider, Karl Hoffmann
  - 2 Gaeste: Stefan Gast, Thomas Besucher
  - 10 Expenses mit Trigger-Zuordnung (Gosse 0.50, Pudel 0.30, ... Abwesenheit 5.00)
  - 3 Spieltage mit Games
2025-12-28 12:10:15 +01:00
beo3000 fcfbbae94e fix CurrentClub Id
Änderungen:

  1. UserProfile.cs:47-52 - Neues Feld CurrentClubId (nullable FK zu Club)
  2. CustomClaimsPrincipalFactory.cs:38-50 - Lädt jetzt CurrentClub und setzt current_club_id/current_club_name Claims bei jeder Cookie-Erneuerung
  3. UserService.cs:113-118 - Speichert CurrentClubId bei Login, nutzt jetzt einfaches SignInAsync (Claims kommen via Factory)
  4. Migration AddCurrentClubIdToUserProfile erstellt + angewandt

  Ablauf jetzt:
  - Login → CurrentClubId wird in DB gespeichert
  - Cookie-Erneuerung → CustomClaimsPrincipalFactory liest CurrentClubId aus DB → Claims bleiben erhalten
2025-12-28 11:25:30 +01:00
beo3000 44b04ec2de dev Trigger / Expense Masterdata, Seeder for triggers 2025-12-28 11:16:51 +01:00
beo3000 954c2589e6 added Trigger and Trigger/Expense Releations 2025-12-28 10:18:39 +01:00
beo3000 125226127d add appsettings, undo/redo without saving 2025-12-27 22:11:30 +01:00
beo3000 a84b192055 Complete phase H9: DB Persistence & Recovery
- 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>
2025-12-27 09:23:58 +01:00
beo3000 e8df51d67f Add Trigger-Engine (Phase H0)
- ITriggerRepository interface + TriggerRepository implementation
- ITriggerService interface + TriggerService implementation
- TriggerDto, ExpenseTriggerLinkDto, FireTriggerDto
- FireTriggerAsync creates PersonExpenses with multiplier
- DI registration for both services
- Fix test mock for IClubRepository

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:10:28 +01:00
beo3000 29cebcbb81 ensure unique names for club,person,expense 2025-12-26 13:39:23 +01:00
beo3000 e2fe8b723a added Game->Club Relation 2025-12-26 10:17:22 +01:00
beo3000 8e2342fd74 avoid duplicate person names 2025-12-25 19:00:42 +01:00
beo3000 32c48d2bc3 fix namespaces
add AccessDenied Page
2025-12-25 18:15:21 +01:00
beo3000 a1bad43d88 Add IEmailService interface + StubEmailService
- IEmailService in Domain/Interfaces for membership notifications
- StubEmailService in Infrastructure/Services logs instead of sending
- TODO comments for future SMTP implementation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:57:16 +01:00
beo3000 68c6c30a2a Add ClubInvitation entity for invitation links
- ClubInvitation: Token, ExpiresAt, MaxUses, UsedCount
- Unique index on Token
- DbSet + EF Configuration
- Migration applied

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:49:50 +01:00
beo3000 b70ddcc6ef Add MembershipStatus enum + extend UserProfileClub
- MembershipStatus: Pending, Approved, Rejected
- UserProfileClub: Status, RejectionReason, ApprovedAt/ById, RejectedAt/ById
- Migration for new columns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:41:26 +01:00
beo3000 51600596c2 Add Expense Pages (D4) 2025-12-24 17:23:31 +01:00
beo3000 c3839d2363 fix permissions;
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.
2025-12-24 15:44:52 +01:00
beo3000 0bc0de2215 edit users 2025-12-23 17:57:16 +01:00
beo3000 b4818efc1a added club relations to datamodel
mod UserService
2025-12-23 15:05:22 +01:00
beo3000 5c6860a4ad mod DI Containers 2025-12-23 11:20:18 +01:00
beo3000 57146a382a add comments 2025-12-22 21:42:25 +01:00
beo3000 9fa6958933 Repository Implementation 2025-12-22 21:30:20 +01:00
beo3000 8a92555ce9 add authorizazion und authentication 2025-12-21 19:31:54 +01:00
beo3000 b8e18a52b3 seed super-admin 2025-12-21 14:58:46 +01:00
beo3000 db0a4b7c00 dev authorization 2025-12-21 14:42:26 +01:00
beo3000 32757a7668 fix db model and create initial db 2025-12-21 12:25:47 +01:00
beo3000 3024ed85d2 fix db model 2025-12-21 12:03:46 +01:00
beo3000 d653225c5f fix datamodel 2025-12-21 11:42:59 +01:00
beo3000 6c43c85cb4 mod project structure
ef migrations
2025-12-21 09:59:40 +01:00