Skip to content

Commit

Permalink
Update Firebase paths for mHealth platform
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi committed Jun 10, 2024
1 parent 570213d commit 81d46ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions StrokeCog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,9 @@
CODE_SIGN_ENTITLEMENTS = "StrokeCog/Supporting Files/StrokeCog.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "StrokeCog/Supporting Files/Info.plist";
Expand Down Expand Up @@ -972,9 +972,9 @@
CODE_SIGN_ENTITLEMENTS = "StrokeCog/Supporting Files/StrokeCog.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "StrokeCog/Supporting Files/Info.plist";
Expand Down Expand Up @@ -1019,9 +1019,9 @@
CODE_SIGN_ENTITLEMENTS = "StrokeCog/Supporting Files/StrokeCog.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "StrokeCog/Supporting Files/Info.plist";
Expand Down
14 changes: 7 additions & 7 deletions StrokeCog/StrokeCogStandard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O
}

private static var userCollection: CollectionReference {
Firestore.firestore().collection("users")
Firestore.firestore().collection("com.odden.lifespace-dev").document("study").collection("ls_users")
}

@Dependency var accountStorage: FirestoreAccountStorage?
Expand All @@ -55,7 +55,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O
throw StrokeCogStandardError.userNotAuthenticatedYet
}

return Storage.storage().reference().child("users/\(details.accountId)")
return Storage.storage().reference().child("com.odden.lifespace-dev/study/ls_users/\(details.accountId)")
}
}

Expand Down Expand Up @@ -115,7 +115,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O
)

try await userDocumentReference
.collection("location_data")
.collection("ls_location_data")
.document(UUID().uuidString)
.setData(from: dataPoint)
}
Expand All @@ -129,7 +129,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O

do {
let snapshot = try await userDocumentReference
.collection("location_data")
.collection("ls_location_data")
.whereField("currentDate", isGreaterThanOrEqualTo: startOfDay)
.whereField("currentDate", isLessThan: endOfDay)
.getDocuments()
Expand Down Expand Up @@ -169,7 +169,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O
response.updatedBy = details.accountId

try await userDocumentReference
.collection("surveys")
.collection("ls_surveys")
.document(UUID().uuidString)
.setData(from: response)

Expand All @@ -195,7 +195,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O

private func healthKitDocument(id uuid: UUID) async throws -> DocumentReference {
try await userDocumentReference
.collection("HealthKit") // Add all HealthKit sources in a /HealthKit collection.
.collection("ls_healthkit") // Add all HealthKit sources in a /HealthKit collection.
.document(uuid.uuidString) // Set the document identifier to the UUID of the document.
}

Expand Down Expand Up @@ -261,7 +261,7 @@ actor StrokeCogStandard: Standard, EnvironmentAccessible, HealthKitConstraint, O

let metadata = StorageMetadata()
metadata.contentType = "application/pdf"
_ = try await userBucketReference.child("consent/\(filename)").putDataAsync(consentData, metadata: metadata)
_ = try await userBucketReference.child("ls_consent/\(filename)").putDataAsync(consentData, metadata: metadata)
} catch {
logger.error("Could not store consent form: \(error)")
}
Expand Down

0 comments on commit 81d46ab

Please sign in to comment.