diff --git a/carp_core/lib/deployment/domain/study_deployment.dart b/carp_core/lib/deployment/domain/study_deployment.dart index ed0d72a37..8f969c1de 100644 --- a/carp_core/lib/deployment/domain/study_deployment.dart +++ b/carp_core/lib/deployment/domain/study_deployment.dart @@ -91,6 +91,7 @@ class StudyDeployment { _protocol = protocol; _creationDate = DateTime.now(); _status = StudyDeploymentStatus(studyDeploymentId: _studyDeploymentId); + _status.createdOn = _creationDate; } /// Get the status of this [StudyDeployment]. @@ -293,9 +294,7 @@ class StudyDeploymentStatus extends Serializable { StudyDeploymentStatus({ required this.studyDeploymentId, this.deviceStatusList = const [], - }) : super() { - createdOn = DateTime.now(); - } + }) : super(); @override Function get fromJsonFunction => _$StudyDeploymentStatusFromJson; diff --git a/carp_mobile_sensing/lib/infrastructure/persistence.dart b/carp_mobile_sensing/lib/infrastructure/persistence.dart index d351fd2d6..60d77616c 100644 --- a/carp_mobile_sensing/lib/infrastructure/persistence.dart +++ b/carp_mobile_sensing/lib/infrastructure/persistence.dart @@ -6,8 +6,25 @@ part of '../infrastructure.dart'; -/// A persistence layer that knows how to persistently store deployment and -/// app task information across app restart. +/// Stores meta data about the running [SmartphoneDeployment] and all +/// [UserTask] json objects in an SQLite database on the device's +/// local storage media. To be used across app restarts. +/// +/// Deployments are stored in the `deployment` table and user tasks are stored +/// in the `task_queue` table. +/// +/// The path and filename format is +/// +/// `~/carp.db` +/// +/// where `~` is the folder where SQLite places it database files. +/// +/// On iOS, this is the `NSDocumentsDirectory` and the files can be accessed via +/// the MacOS Finder. +/// +/// On Android, Flutter files are stored in the `databases` directory, which is +/// located in the `data/data//databases/` folder. +/// Files can be accessed via AndroidStudio. class Persistence { static const String DATABASE_NAME = 'carp'; static const String DEPLOYMENT_TABLE_NAME = 'deployment';