feat(db-split): Phase 3 — Repository Refactoring & Cross-DB Gaps (#108) #113
No reviewers
Labels
No labels
architecture
backend
bug
ci
config
database
docker
documentation
duplicate
enhancement
frontend
help wanted
invalid
issue-25
issue-26
issue-42
issue-65
issue-67
issue-82
migrations
p0-critical
p1-high
p2-medium
p3-low
performance
quality
question
security
state-management
testing
timezone
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
fastie81/honbu-manager!113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/db-split-phase3-refactoring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This Pull Request implements Phase 3 — Repository Refactoring & Cross-DB Gaps (#108).
Proposed Changes
Component 1: DashboardOperations Refactoring
DashboardOperationsfrom raw connection wrapper; injectedclub_repoandsystem_repoinapp/container.py.get_system_stats().get_current_date_in_club_timezoneinget_club_dashboard_data().Component 2: System Repository Cross-DB Fixes
get_users_by_club(): Fetches user IDs in club DB, then resolves profiles in central DB.get_family_guardians(): Fetches guardian user IDs in club DB, then details in central DB.get_available_guardians(): Combines candidate member user IDs, filters current guardians, and resolves details in central DB.delete_user(): Cascades cleanups of user references across all club databases before deleting the record from the Central DB.delete_club(): Creates an on-disk JSON backup under the club context first, terminates active backend pg connections, and then drops the database.Component 3: Application-Level FK Validation
create_member()andupdate_member()to ensure user IDs exist in Central DB.add_guardian_to_family()to ensure the user ID exists, and automatically registers the user with a 'Member' role assignment for that club in the Central DB.Component 5: Tests
test_dashboard_split.pyto assert correct routing context manager stack.test_user_lookups.pyto assert two-phase queries return identical structures.test_fk_validation.pyto assert ValueErrors on non-existent users.All unit and E2E controller tests pass successfully.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.