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

Description

A Drift-backed local data adapter that stores and retrieves the persisted active role-organization pair. Provides the Profile Context Service with an offline-durable read/write interface so the last selected context is available immediately on cold start without a network round-trip.

Feature: Profile Switching

active-context-repository

Sources & reasoning

Drift persistence for the active context is explicitly called out in implementation notes. A dedicated repository component isolates the storage concern from the state notifier, aligns with the offline-first architecture, and keeps the Profile Context Service testable without a database dependency.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Write the active role-org pair to the Drift encrypted local database
  • Read and return the persisted context on app startup
  • Clear the persisted context on full sign-out

Interfaces

saveActiveContext(roleOrgPair: RoleOrgPair): Future<void>
loadActiveContext(): Future<RoleOrgPair?>
clearActiveContext(): Future<void>

Related Data Entities (1)

Data entities managed by this component