Data Layer medium complexity mobile
0
Dependencies
1
Dependents
4
Entities
0
Integrations

Description

Data access layer for peer mentor entities, abstracting REST API calls and local SQLite cache reads. Supports offline-first reads via the local database, with the Sync Service handling background refresh. Joins peer_mentors, certifications, and peer_mentor_status_logs tables via the backend API endpoint `/api/v1/peer-mentors/:id`.

Feature: Peer Mentor Profile & Management

peer-mentor-repository

Responsibilities

  • Fetch peer mentor records from remote REST API
  • Read and write peer mentor data to local SQLite cache
  • Map raw API responses to typed PeerMentorEntity objects
  • Invalidate and refresh cache entries on status changes

Interfaces

findById(mentorId: string): Future<PeerMentorEntity?>
findByAssociation(associationId: string): Future<List<PeerMentorEntity>>
findAll(): Future<List<PeerMentorEntity>>
save(mentor: PeerMentorEntity): Future<void>
updateStatus(mentorId: string, status: String, logEntry: StatusLog): Future<void>
deleteById(mentorId: string): Future<void>
getCachedMentor(mentorId: string): PeerMentorEntity?
clearCache(): Future<void>

Relationships

Dependents (1)

Components that depend on this component