Skip to content

Split monolithic TreeTrackerDAO into entity-specific DAOs #1235

Description

@Elforama

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.

Metadata

Metadata

Assignees

Type

Projects

Status
Ready for Review

Relationships

None yet

Development

No branches or pull requests

Issue actions