Activity Document Repository
Component Detail
Data Layer
low complexity
mobilebackend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Data access layer for the activity_documents table, managing CRUD operations for document metadata records (filename, MIME type, size, storage path) linked to activity IDs. Handles cascade delete behavior and provides query methods for fetching all documents belonging to a given activity.
activity-document-repository
Responsibilities
- Insert document metadata records into activity_documents table
- Fetch all document records associated with a given activity_id
- Delete document metadata records with cascade delete on activity removal
- Provide type-safe mapping between Supabase rows and ActivityDocument model
Interfaces
insertDocument(document: ActivityDocument): Future<ActivityDocument>
getDocumentsByActivityId(activityId: string): Future<List<ActivityDocument>>
deleteDocument(documentId: string): Future<void>
deleteAllDocumentsForActivity(activityId: string): Future<void>
getDocumentById(documentId: string): Future<ActivityDocument?>