Data Layer low complexity mobile
0
Dependencies
1
Dependents
1
Entities
0
Integrations

Description

Drift DAO (Data Access Object) that encapsulates all SQL queries needed to aggregate activity statistics for a single user. Returns strongly-typed result sets consumed by the Statistics Service provider; never makes network calls - all data is sourced from the encrypted local Drift database.

Feature: Personal Activity Statistics

statistics-query-repository

Responsibilities

  • Execute parameterised Drift queries returning activity counts grouped by day, week, month, or year
  • Return total duration in minutes and distinct contact count for a given time range
  • Provide a raw sorted list of activity dates used by the statistics service to compute streaks
  • Expose reactive Drift stream queries so Riverpod watchers are notified on local DB writes

Interfaces

watchActivitiesGroupedByBucket(String userId, TimeBucket, DateRange) → Stream<List<BucketRow>>
getTotalActivityCount(String userId, DateRange) → Future<int>
getTotalDurationMinutes(String userId, DateRange) → Future<int>
getDistinctContactCount(String userId, DateRange) → Future<int>
getActivityDates(String userId) → Future<List<DateTime>>

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component