-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c78321
commit 9001f8c
Showing
26 changed files
with
98 additions
and
61 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
carp.common/src/commonMain/kotlin/dk/cachet/carp/common/application/ApplicationData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dk.cachet.carp.common.application | ||
|
||
import dk.cachet.carp.common.infrastructure.serialization.ApplicationDataSerializer | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.json.JsonElement | ||
import kotlin.js.JsExport | ||
|
||
/** | ||
* A [String] data holder that can store application-specific data. | ||
* It includes a custom serializer that serializes the [String] as a [JsonElement], but only when a JSON encoder/decoder is used. | ||
* | ||
* This is useful for storing application-specific data that is not statically known to the common base infrastructure | ||
* when JSON serialization is applied, without needing to escape the JSON data. | ||
* | ||
* If the JSON contained in the string is malformed, it will be serialized as a normal, escaped string. | ||
*/ | ||
|
||
@Serializable( with = ApplicationDataSerializer::class ) | ||
@JsExport | ||
data class ApplicationData( | ||
val data: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package dk.cachet.carp.deployments.application | ||
|
||
import dk.cachet.carp.common.application.ApplicationData | ||
import dk.cachet.carp.common.application.UUID | ||
import dk.cachet.carp.common.application.data.input.CarpInputDataTypes | ||
import dk.cachet.carp.common.application.data.input.Sex | ||
|
@@ -56,7 +57,7 @@ interface ParticipationServiceTest | |
val (participationService, deploymentService, accountService) = createSUT() | ||
val protocol = createSinglePrimaryDeviceProtocol() | ||
val identity = AccountIdentity.fromEmailAddress( "[email protected]" ) | ||
val invitation = StudyInvitation( "Test study", "description", "Custom data" ) | ||
val invitation = StudyInvitation( "Test study", "description", ApplicationData( "Custom data" ) ) | ||
val participantInvitation = ParticipantInvitation( | ||
participantId = UUID.randomUUID(), | ||
AssignedTo.All, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.