Greenstand / Greenstand/treetracker-android

Split monolithic TreeTrackerDAO into entity-specific DAOs

Open
#1,235 2 comments 0 reactions 1 assignee Claimed by @marsof02 View on GitHub
2.3 chore refactor triage
Dominant language
Kotlin
Stars
101
Forks
116
PR merge metrics
No merged PRs in 30d

Description

## 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.