-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Overview
The current implementation of the logRelapse function in src/utils/firebase.ts needs updating to improve how relapse data is stored. Currently, relapse data isn't structured optimally. We want to restructure the data storage to ensure each user has their own dedicated document, and each relapse event is clearly mapped within that user's document.
The new structure should follow this pattern:
- Each Firestore document corresponds to a unique user.
- Within each document, relapse events are stored as a mapping.
- Each relapse entry should contain the following fields:
{ timestamp: Timestamp.now(), triggers: triggers, notes: notes || '' }
Todos
- Update the
logRelapsefunction insrc/utils/firebase.tsto assign each document to a specific user ID and create a new doc if the userID isn’t found. - Within each user's document, implement a mapping structure for storing relapse events.
- Ensure each relapse entry includes the fields:
timestamp,triggers, andnotes. - Test the updated implementation thoroughly to ensure correctness and data integrity.
Metadata
Metadata
Assignees
Labels
No labels