fix: Centralize attended status logic and improve role documentation#175
Open
Lionhunt3r wants to merge 2 commits into
Open
fix: Centralize attended status logic and improve role documentation#175Lionhunt3r wants to merge 2 commits into
Lionhunt3r wants to merge 2 commits into
Conversation
added 2 commits
March 3, 2026 12:55
- people_list_page.dart: Check tenant.id != null before .eq() query - person_detail_page.dart: Check tenant.id != null in personProvider - person_detail_page.dart: Extract criticalRules to local variable for clarity - late_warning_card.dart: Extract criticalRules to local variable for clarity Prevents potential crash when tenant.id is null. Closes #162
## Issue #165: Inkonsistenter Status-Check bei 'attended' Definition - Root Cause: countsAsPresent extension existiert, wird aber nicht überall genutzt - Solution: Migrate alle manuellen Status-Checks zu countsAsPresent - person_detail_page.dart: Ersetze hardcoded integer checks (status == 1 || 3 || 5) - sign_in_out_repository.dart: attended getter nutzt countsAsPresent - parents_providers.dart: attended getter nutzt countsAsPresent - statistics_providers.dart: Ersetze 2x duplizierte Enum-Checks - attendance_grid.dart: presentCount nutzt countsAsPresent - Tests: Alle 348 Tests bestehen ## Issue #166: Role.canSeeMembersTab Logik undokumentiert - Root Cause: Dokumentation fehlt - Verhalten ist by design - Solution: Erweiterte Dokumentation für isPlayerRole und canSeeMembersTab - Erklärt warum APPLICANT in isPlayerRole (für Routing) aber nicht in canSeeMembersTab (Datenschutz) - Dokumentiert dass Role.none als Fallback inkludiert ist - Tests: dart analyze ohne Warnings Closes #165, #166
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
countsAsPresentIssues Fixed
#165: Inkonsistenter Status-Check bei 'attended' Definition ✅
Problem: Die Extension-Methode
countsAsPresentexistierte bereits, wurde aber nur an einer Stelle genutzt. Alle anderen Stellen verwendeten duplizierte manuelle Checks.Lösung:
person_detail_page.dart: Ersetzte hardcoded integer checks(status == 1 || 3 || 5)mitcountsAsPresentsign_in_out_repository.dart:attendedgetter nutztcountsAsPresentparents_providers.dart:attendedgetter nutztcountsAsPresentstatistics_providers.dart: 2x duplizierte Enum-Checks ersetztattendance_grid.dart:presentCountnutztcountsAsPresentImpact: Einheitliche, wartbare Logik für "attended" Status über die gesamte App.
#166: Role.canSeeMembersTab Logik undokumentiert ✅
Problem: Es war nicht dokumentiert, warum
APPLICANTvoncanSeeMembersTabausgeschlossen ist, obwohlisPlayerRolees einschließt.Lösung: Erweiterte Dokumentation in
enums.dart:isPlayerRole: Erklärt dass APPLICANT für UI-Routing inkludiert istcanSeeMembersTab: Erklärt dass APPLICANT aus Datenschutzgründen exkludiert ist (Bewerber im Wartebereich sollten Mitgliederliste nicht sehen)Role.noneals Fallback inkludiert istImpact: Code ist jetzt selbstdokumentierend und verhindert künftige Verwirrung.
Test Plan
dart analyzeohne WarningsChanges
Closes #165, #166