Problem
TreeTrackerDAO is a single interface with 150+ query methods across 365+ lines. It handles queries for trees, users, sessions, organizations, device configs, planter info, planter check-ins, and location data. This makes it difficult to navigate, test, and maintain.
Location
app/src/main/java/org/greenstand/android/TreeTracker/database/TreeTrackerDAO.kt
Suggested Fix
Split into entity-specific DAOs:
TreeDAO — tree and tree capture queries
UserDAO — user entity queries
SessionDAO — session queries
OrganizationDAO — org queries
DeviceConfigDAO — device config queries
PlanterDAO — planter info and check-in queries (legacy)
LocationDAO — location data queries
Update Room database definition and DI module to provide the new DAOs.
Effort
High — many files reference TreeTrackerDAO and will need updating. Can be done incrementally, one entity type at a time.
Problem
TreeTrackerDAOis a single interface with 150+ query methods across 365+ lines. It handles queries for trees, users, sessions, organizations, device configs, planter info, planter check-ins, and location data. This makes it difficult to navigate, test, and maintain.Location
app/src/main/java/org/greenstand/android/TreeTracker/database/TreeTrackerDAO.ktSuggested Fix
Split into entity-specific DAOs:
TreeDAO— tree and tree capture queriesUserDAO— user entity queriesSessionDAO— session queriesOrganizationDAO— org queriesDeviceConfigDAO— device config queriesPlanterDAO— planter info and check-in queries (legacy)LocationDAO— location data queriesUpdate Room database definition and DI module to provide the new DAOs.
Effort
High — many files reference
TreeTrackerDAOand will need updating. Can be done incrementally, one entity type at a time.