-
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.
Add
ApplicationData
to trigger associated serializer
This way, the serializer doesn't need to be specified on every field which requires `ApplicationDataSerializer`. Specifically, in case of inheritance, this prevents having to apply the serializer to all inheriting classes on base properties which need it.
- Loading branch information
1 parent
7b6fa58
commit 94664ce
Showing
17 changed files
with
71 additions
and
49 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
package dk.cachet.carp.common.application | ||
|
||
import dk.cachet.carp.common.infrastructure.serialization.ApplicationDataSerializer | ||
import kotlinx.serialization.Serializable | ||
import kotlin.js.JsExport | ||
|
||
|
||
/** | ||
* Holds extra [data] which is specific to concrete applications, sensors, or infrastructure, and isn't statically | ||
* known to the base infrastructure. | ||
* | ||
* While the [data] can be formatted in any way, when JSON serialization is applied and [data] contains a JSON element, | ||
* the data will be formatted as JSON (without escaping special characters). If the JSON contained in the string is | ||
* malformed, it will be serialized as a normal, escaped string. | ||
*/ | ||
@Serializable( 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
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 | ||
|
@@ -57,7 +58,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
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
Oops, something went wrong.