diff --git a/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/ClientRepositoryTest.kt b/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/ClientRepositoryTest.kt index 7651bdf55..910de8a37 100644 --- a/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/ClientRepositoryTest.kt +++ b/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/ClientRepositoryTest.kt @@ -97,7 +97,7 @@ interface ClientRepositoryTest Clock.System.now(), deploymentId, listOf( - DeviceDeploymentStatus.Registered( primaryDevice, true, emptySet(), emptySet() ) + DeviceDeploymentStatus.Registered( primaryDevice, registration, true, emptySet(), emptySet() ) ), emptyList(), null diff --git a/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/study/StudyTest.kt b/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/study/StudyTest.kt index 6f70d1b39..6d55c96e9 100644 --- a/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/study/StudyTest.kt +++ b/carp.clients.core/src/commonTest/kotlin/dk/cachet/carp/clients/domain/study/StudyTest.kt @@ -311,6 +311,7 @@ class StudyTest listOf( DeviceDeploymentStatus.Registered( smartphone, + primaryDeviceDeployment.registration, true, emptySet(), connectedDevices.map { it.roleName }.toSet() diff --git a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/application/DeviceDeploymentStatus.kt b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/application/DeviceDeploymentStatus.kt index 57582af71..c05124bea 100644 --- a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/application/DeviceDeploymentStatus.kt +++ b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/application/DeviceDeploymentStatus.kt @@ -3,6 +3,7 @@ package dk.cachet.carp.deployments.application import dk.cachet.carp.common.application.devices.AnyDeviceConfiguration +import dk.cachet.carp.common.application.devices.DeviceRegistration import kotlinx.serialization.* import kotlin.js.JsExport @@ -56,6 +57,16 @@ sealed class DeviceDeploymentStatus abstract val remainingDevicesToRegisterBeforeDeployment: Set } + /** + * A device deployment status which indicates the device has been registered. + */ + sealed interface HasDeviceRegistration + { + /** + * The last [DeviceRegistration] for this device. + */ + val deviceRegistration: DeviceRegistration + } /** * Device deployment status for when a device has not been registered. @@ -74,18 +85,20 @@ sealed class DeviceDeploymentStatus @Serializable data class Registered( override val device: AnyDeviceConfiguration, + override val deviceRegistration: DeviceRegistration, override val canBeDeployed: Boolean, override val remainingDevicesToRegisterToObtainDeployment: Set, override val remainingDevicesToRegisterBeforeDeployment: Set - ) : NotDeployed() + ) : NotDeployed(), HasDeviceRegistration /** * Device deployment status when the device has retrieved its [PrimaryDeviceDeployment] and was able to load all the necessary plugins to execute the study. */ @Serializable data class Deployed( - override val device: AnyDeviceConfiguration - ) : DeviceDeploymentStatus() + override val device: AnyDeviceConfiguration, + override val deviceRegistration: DeviceRegistration + ) : DeviceDeploymentStatus(), HasDeviceRegistration { // All devices that have been deployed necessarily can be deployed. override val canBeDeployed = true @@ -97,9 +110,10 @@ sealed class DeviceDeploymentStatus @Serializable data class NeedsRedeployment( override val device: AnyDeviceConfiguration, + override val deviceRegistration: DeviceRegistration, override val remainingDevicesToRegisterToObtainDeployment: Set, override val remainingDevicesToRegisterBeforeDeployment: Set - ) : NotDeployed() + ) : NotDeployed(), HasDeviceRegistration { // All devices that have been deployed necessarily can be deployed. override val canBeDeployed = true diff --git a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/domain/StudyDeployment.kt b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/domain/StudyDeployment.kt index 39d882c9c..0fc640e75 100644 --- a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/domain/StudyDeployment.kt +++ b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/domain/StudyDeployment.kt @@ -287,11 +287,25 @@ class StudyDeployment private constructor( return when { needsRedeployment -> - DeviceDeploymentStatus.NeedsRedeployment( device, toObtainDeployment, beforeDeployment ) + DeviceDeploymentStatus.NeedsRedeployment( + device, + _registeredDevices.getValue( device ), + toObtainDeployment, + beforeDeployment + ) isDeployed -> - DeviceDeploymentStatus.Deployed( device ) + DeviceDeploymentStatus.Deployed( + device, + _registeredDevices.getValue( device ) + ) isRegistered -> - DeviceDeploymentStatus.Registered( device, canBeDeployed, toObtainDeployment, beforeDeployment ) + DeviceDeploymentStatus.Registered( + device, + _registeredDevices.getValue( device ), + canBeDeployed, + toObtainDeployment, + beforeDeployment + ) else -> DeviceDeploymentStatus.Unregistered( device, canBeDeployed, toObtainDeployment, beforeDeployment ) } diff --git a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/infrastructure/versioning/DeploymentServiceApiMigrator.kt b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/infrastructure/versioning/DeploymentServiceApiMigrator.kt index 09d7e099d..6eda7603b 100644 --- a/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/infrastructure/versioning/DeploymentServiceApiMigrator.kt +++ b/carp.deployments.core/src/commonMain/kotlin/dk/cachet/carp/deployments/infrastructure/versioning/DeploymentServiceApiMigrator.kt @@ -38,7 +38,7 @@ private val major1Minor1To3Migration = { "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor" -> { - val responseObject = (response.response as? JsonObject)?.migrate { + val responseObject = response.response?.jsonObject?.migrate { requiredDeviceDisplayName( "registration" ) updateOptionalObject( "connectedDeviceRegistrations" ) @@ -48,6 +48,25 @@ private val major1Minor1To3Migration = } ApiResponse( responseObject, response.ex ) } + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatus", + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.UnregisterDevice", + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.DeviceDeployed", + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.Stop" -> + { + val responseObject = response.response?.jsonObject?.migrate { + removeDeviceRegistration() + } + ApiResponse( responseObject, response.ex ) + } + "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatusList" -> + { + val responseObject = response.response?.jsonArray?.migrate { + objects { removeDeviceRegistration() } + } + ApiResponse( responseObject, response.ex ) + } else -> response } @@ -60,6 +79,15 @@ private val major1Minor1To3Migration = json.getOrPut( "deviceDisplayName" ) { JsonNull } } + /** + * Remove the newly added `deviceRegistration` field from `DeviceDeploymentStatus` objects contained within + * `StudyDeploymentStatus`. + */ + private fun ApiJsonObjectMigrationBuilder.removeDeviceRegistration() = + updateArray( "deviceStatusList" ) { + objects { json.remove( "deviceRegistration" ) } + } + override fun migrateEvent( event: JsonObject ) = event } diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.0/DeploymentServiceTest/getStudyDeploymentStatusList_with_registered_device_succeeds.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.0/DeploymentServiceTest/getStudyDeploymentStatusList_with_registered_device_succeeds.json new file mode 100644 index 000000000..5683553ef --- /dev/null +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.0/DeploymentServiceTest/getStudyDeploymentStatusList_with_registered_device_succeeds.json @@ -0,0 +1,493 @@ +[ + { + "outcome": "Succeeded", + "request": { + "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", + "apiVersion": "1.0", + "id": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "protocol": { + "id": "5d72d8fe-05af-4788-aabe-7b32b5c86fc4", + "createdOn": "2024-10-23T11:43:40.333269Z", + "version": 0, + "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", + "name": "Test protocol", + "description": "Test description", + "primaryDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + } + ], + "connectedDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + } + ], + "connections": [ + { + "roleName": "Connected", + "connectedToRoleName": "Primary" + } + ] + }, + "invitations": [ + { + "participantId": "ab858017-cdbe-4173-92a8-69b7460be97f", + "assignedRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "identity": { + "__type": "dk.cachet.carp.common.application.users.UsernameAccountIdentity", + "username": "User 1" + }, + "invitation": { + "name": "Some study" + } + } + ] + }, + "precedingEvents": [], + "publishedEvents": [ + { + "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", + "aggregateId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "apiVersion": "1.0", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "protocol": { + "id": "5d72d8fe-05af-4788-aabe-7b32b5c86fc4", + "createdOn": "2024-10-23T11:43:40.333269Z", + "version": 0, + "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", + "name": "Test protocol", + "description": "Test description", + "primaryDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + } + ], + "connectedDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + } + ], + "connections": [ + { + "roleName": "Connected", + "connectedToRoleName": "Primary" + } + ] + }, + "invitations": [ + { + "participantId": "ab858017-cdbe-4173-92a8-69b7460be97f", + "assignedRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "identity": { + "__type": "dk.cachet.carp.common.application.users.UsernameAccountIdentity", + "username": "User 1" + }, + "invitation": { + "name": "Some study" + } + } + ], + "connectedDevicePreregistrations": {} + } + ], + "response": { + "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", + "createdOn": "1970-01-01T00:00:00Z", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "deviceStatusList": [ + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "canBeDeployed": true, + "remainingDevicesToRegisterToObtainDeployment": [ + "Primary" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Primary", + "Connected" + ] + }, + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + }, + "canBeDeployed": false, + "remainingDevicesToRegisterToObtainDeployment": [ + "Connected" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + } + ], + "participantStatusList": [ + { + "participantId": "ab858017-cdbe-4173-92a8-69b7460be97f", + "assignedParticipantRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "assignedPrimaryDeviceRoleNames": [ + "Primary" + ] + } + ], + "startedOn": null + } + }, + { + "outcome": "Succeeded", + "request": { + "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", + "apiVersion": "1.0", + "id": "43696314-7d89-4a23-b3f8-11812ab2fc4d", + "protocol": { + "id": "5d72d8fe-05af-4788-aabe-7b32b5c86fc4", + "createdOn": "2024-10-23T11:43:40.333269Z", + "version": 0, + "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", + "name": "Test protocol", + "description": "Test description", + "primaryDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + } + ], + "connectedDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + } + ], + "connections": [ + { + "roleName": "Connected", + "connectedToRoleName": "Primary" + } + ] + }, + "invitations": [ + { + "participantId": "ac51e919-2a4e-4d53-8842-0e4ebd297e79", + "assignedRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "identity": { + "__type": "dk.cachet.carp.common.application.users.UsernameAccountIdentity", + "username": "User 2" + }, + "invitation": { + "name": "Some study" + } + } + ] + }, + "precedingEvents": [], + "publishedEvents": [ + { + "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", + "aggregateId": "43696314-7d89-4a23-b3f8-11812ab2fc4d", + "apiVersion": "0", + "studyDeploymentId": "43696314-7d89-4a23-b3f8-11812ab2fc4d", + "protocol": { + "id": "5d72d8fe-05af-4788-aabe-7b32b5c86fc4", + "createdOn": "2024-10-23T11:43:40.333269Z", + "version": 0, + "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", + "name": "Test protocol", + "description": "Test description", + "primaryDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + } + ], + "connectedDevices": [ + { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + } + ], + "connections": [ + { + "roleName": "Connected", + "connectedToRoleName": "Primary" + } + ] + }, + "invitations": [ + { + "participantId": "ac51e919-2a4e-4d53-8842-0e4ebd297e79", + "assignedRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "identity": { + "__type": "dk.cachet.carp.common.application.users.UsernameAccountIdentity", + "username": "User 2" + }, + "invitation": { + "name": "Some study" + } + } + ], + "connectedDevicePreregistrations": {} + } + ], + "response": { + "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", + "createdOn": "1970-01-01T00:00:00Z", + "studyDeploymentId": "43696314-7d89-4a23-b3f8-11812ab2fc4d", + "deviceStatusList": [ + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "canBeDeployed": true, + "remainingDevicesToRegisterToObtainDeployment": [ + "Primary" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Primary", + "Connected" + ] + }, + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + }, + "canBeDeployed": false, + "remainingDevicesToRegisterToObtainDeployment": [ + "Connected" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + } + ], + "participantStatusList": [ + { + "participantId": "ac51e919-2a4e-4d53-8842-0e4ebd297e79", + "assignedParticipantRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "assignedPrimaryDeviceRoleNames": [ + "Primary" + ] + } + ], + "startedOn": null + } + }, + { + "outcome": "Succeeded", + "request": { + "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", + "apiVersion": "1.0", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "deviceRoleName": "Primary", + "registration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T11:43:40.333566Z", + "deviceId": "ea283a75-3fc5-4f7a-9424-97ec2ca21df4" + } + }, + "precedingEvents": [], + "publishedEvents": [ + { + "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", + "aggregateId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "apiVersion": "1.0", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "registration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T11:43:40.333566Z", + "deviceId": "ea283a75-3fc5-4f7a-9424-97ec2ca21df4" + } + } + ], + "response": { + "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", + "createdOn": "1970-01-01T00:00:00Z", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "deviceStatusList": [ + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "canBeDeployed": true, + "remainingDevicesToRegisterToObtainDeployment": [], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + }, + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + }, + "canBeDeployed": false, + "remainingDevicesToRegisterToObtainDeployment": [ + "Connected" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + } + ], + "participantStatusList": [ + { + "participantId": "ab858017-cdbe-4173-92a8-69b7460be97f", + "assignedParticipantRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "assignedPrimaryDeviceRoleNames": [ + "Primary" + ] + } + ], + "startedOn": null + } + }, + { + "outcome": "Succeeded", + "request": { + "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatusList", + "apiVersion": "1.0", + "studyDeploymentIds": [ + "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "43696314-7d89-4a23-b3f8-11812ab2fc4d" + ] + }, + "precedingEvents": [], + "publishedEvents": [], + "response": [ + { + "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", + "createdOn": "1970-01-01T00:00:00Z", + "studyDeploymentId": "81dfa6e2-2797-47ab-a8a4-67d41808c575", + "deviceStatusList": [ + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "canBeDeployed": true, + "remainingDevicesToRegisterToObtainDeployment": [], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + }, + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + }, + "canBeDeployed": false, + "remainingDevicesToRegisterToObtainDeployment": [ + "Connected" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + } + ], + "participantStatusList": [ + { + "participantId": "ab858017-cdbe-4173-92a8-69b7460be97f", + "assignedParticipantRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "assignedPrimaryDeviceRoleNames": [ + "Primary" + ] + } + ], + "startedOn": null + }, + { + "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", + "createdOn": "1970-01-01T00:00:00Z", + "studyDeploymentId": "43696314-7d89-4a23-b3f8-11812ab2fc4d", + "deviceStatusList": [ + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", + "isPrimaryDevice": true, + "roleName": "Primary" + }, + "canBeDeployed": true, + "remainingDevicesToRegisterToObtainDeployment": [ + "Primary" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Primary", + "Connected" + ] + }, + { + "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", + "device": { + "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", + "roleName": "Connected" + }, + "canBeDeployed": false, + "remainingDevicesToRegisterToObtainDeployment": [ + "Connected" + ], + "remainingDevicesToRegisterBeforeDeployment": [ + "Connected" + ] + } + ], + "participantStatusList": [ + { + "participantId": "ac51e919-2a4e-4d53-8842-0e4ebd297e79", + "assignedParticipantRoles": { + "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" + }, + "assignedPrimaryDeviceRoleNames": [ + "Primary" + ] + } + ], + "startedOn": null + } + ] + } +] \ No newline at end of file diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/createStudyDeployment_registers_preregistered_devices.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/createStudyDeployment_registers_preregistered_devices.json index 784470893..6f5bc0cd6 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/createStudyDeployment_registers_preregistered_devices.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/createStudyDeployment_registers_preregistered_devices.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "bd9f4116-7c3c-4653-9285-38710660a8af", + "id": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "protocol": { - "id": "cc251597-c835-4120-b238-eca1df37eb9e", - "createdOn": "2024-10-09T08:17:33.754071Z", + "id": "0ef899d4-389b-4001-af50-bc7b50d28419", + "createdOn": "2024-10-23T13:28:04.937081Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -34,7 +34,7 @@ }, "invitations": [ { - "participantId": "5511bab5-4f93-458a-b51e-d468d9624468", + "participantId": "d79806b7-c100-4617-ac26-75a958765d15", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -50,8 +50,8 @@ "connectedDevicePreregistrations": { "Connected": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754108Z", - "deviceId": "03baa630-74f7-4f7b-ab89-aea7b1fa5e2a" + "registrationCreatedOn": "2024-10-23T13:28:04.937108Z", + "deviceId": "11ce9129-4d16-4c29-93e4-2e0ae1cb9a76" } } }, @@ -59,12 +59,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "aggregateId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "apiVersion": "1.3", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "protocol": { - "id": "cc251597-c835-4120-b238-eca1df37eb9e", - "createdOn": "2024-10-09T08:17:33.754071Z", + "id": "0ef899d4-389b-4001-af50-bc7b50d28419", + "createdOn": "2024-10-23T13:28:04.937081Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -91,7 +91,7 @@ }, "invitations": [ { - "participantId": "5511bab5-4f93-458a-b51e-d468d9624468", + "participantId": "d79806b7-c100-4617-ac26-75a958765d15", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -107,8 +107,8 @@ "connectedDevicePreregistrations": { "Connected": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754108Z", - "deviceId": "03baa630-74f7-4f7b-ab89-aea7b1fa5e2a" + "registrationCreatedOn": "2024-10-23T13:28:04.937108Z", + "deviceId": "11ce9129-4d16-4c29-93e4-2e0ae1cb9a76" } } } @@ -116,7 +116,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -139,6 +139,11 @@ "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", "roleName": "Connected" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.937108Z", + "deviceId": "11ce9129-4d16-4c29-93e4-2e0ae1cb9a76" + }, "canBeDeployed": false, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -146,7 +151,7 @@ ], "participantStatusList": [ { - "participantId": "5511bab5-4f93-458a-b51e-d468d9624468", + "participantId": "d79806b7-c100-4617-ac26-75a958765d15", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -163,21 +168,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754227Z", - "deviceId": "a7b167cb-77d6-4db3-8fc3-cc3d612c82de" + "registrationCreatedOn": "2024-10-23T13:28:04.937259Z", + "deviceId": "199d05be-5e67-4c68-8ec9-c55290841c9a" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "aggregateId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "apiVersion": "1.3", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -185,15 +190,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754227Z", - "deviceId": "a7b167cb-77d6-4db3-8fc3-cc3d612c82de" + "registrationCreatedOn": "2024-10-23T13:28:04.937259Z", + "deviceId": "199d05be-5e67-4c68-8ec9-c55290841c9a" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -202,6 +207,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.937259Z", + "deviceId": "199d05be-5e67-4c68-8ec9-c55290841c9a" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -212,6 +222,11 @@ "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", "roleName": "Connected" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.937108Z", + "deviceId": "11ce9129-4d16-4c29-93e4-2e0ae1cb9a76" + }, "canBeDeployed": false, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -219,7 +234,7 @@ ], "participantStatusList": [ { - "participantId": "5511bab5-4f93-458a-b51e-d468d9624468", + "participantId": "d79806b7-c100-4617-ac26-75a958765d15", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -236,7 +251,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor", "apiVersion": "1.3", - "studyDeploymentId": "bd9f4116-7c3c-4653-9285-38710660a8af", + "studyDeploymentId": "5f8b35d8-2d9e-45ae-87d4-62274b0fe325", "primaryDeviceRoleName": "Primary" }, "precedingEvents": [], @@ -249,8 +264,8 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754227Z", - "deviceId": "a7b167cb-77d6-4db3-8fc3-cc3d612c82de" + "registrationCreatedOn": "2024-10-23T13:28:04.937259Z", + "deviceId": "199d05be-5e67-4c68-8ec9-c55290841c9a" }, "connectedDevices": [ { @@ -261,8 +276,8 @@ "connectedDeviceRegistrations": { "Connected": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.754108Z", - "deviceId": "03baa630-74f7-4f7b-ab89-aea7b1fa5e2a" + "registrationCreatedOn": "2024-10-23T13:28:04.937108Z", + "deviceId": "11ce9129-4d16-4c29-93e4-2e0ae1cb9a76" } } } diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/getDeviceDeploymentFor_during_device_reregistrations.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/getDeviceDeploymentFor_during_device_reregistrations.json index 63a7474c6..b33988315 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/getDeviceDeploymentFor_during_device_reregistrations.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/getDeviceDeploymentFor_during_device_reregistrations.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "id": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "protocol": { - "id": "5205551a-37a8-4a87-adfc-b246304a6c1a", - "createdOn": "2024-10-09T08:17:33.782260Z", + "id": "8ff57fa2-4a43-44fa-b540-cd5ef8d0faca", + "createdOn": "2024-10-23T13:28:04.973958Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -22,7 +22,7 @@ }, "invitations": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -40,12 +40,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "aggregateId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "protocol": { - "id": "5205551a-37a8-4a87-adfc-b246304a6c1a", - "createdOn": "2024-10-09T08:17:33.782260Z", + "id": "8ff57fa2-4a43-44fa-b540-cd5ef8d0faca", + "createdOn": "2024-10-23T13:28:04.973958Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -60,7 +60,7 @@ }, "invitations": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -79,7 +79,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -99,7 +99,7 @@ ], "participantStatusList": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -116,21 +116,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceRoleName": "Test device", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.783526Z", - "deviceId": "c5cf6146-d748-46ce-9354-660d37a2c6eb" + "registrationCreatedOn": "2024-10-23T13:28:04.974525Z", + "deviceId": "9357517d-7d91-426b-97fb-a558a1e67814" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "aggregateId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -138,15 +138,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.783526Z", - "deviceId": "c5cf6146-d748-46ce-9354-660d37a2c6eb" + "registrationCreatedOn": "2024-10-23T13:28:04.974525Z", + "deviceId": "9357517d-7d91-426b-97fb-a558a1e67814" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -155,6 +155,11 @@ "isPrimaryDevice": true, "roleName": "Test device" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.974525Z", + "deviceId": "9357517d-7d91-426b-97fb-a558a1e67814" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -162,7 +167,7 @@ ], "participantStatusList": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -179,7 +184,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "primaryDeviceRoleName": "Test device" }, "precedingEvents": [], @@ -192,8 +197,8 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.783526Z", - "deviceId": "c5cf6146-d748-46ce-9354-660d37a2c6eb" + "registrationCreatedOn": "2024-10-23T13:28:04.974525Z", + "deviceId": "9357517d-7d91-426b-97fb-a558a1e67814" } } }, @@ -202,16 +207,16 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.UnregisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceRoleName": "Test device" }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "aggregateId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -223,7 +228,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -243,7 +248,7 @@ ], "participantStatusList": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -260,7 +265,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "primaryDeviceRoleName": "Test device" }, "precedingEvents": [], @@ -272,21 +277,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceRoleName": "Test device", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.784020Z", - "deviceId": "7aa81293-dec8-4816-a1a8-2c687c01042c" + "registrationCreatedOn": "2024-10-23T13:28:04.974960Z", + "deviceId": "89b4ad43-071d-4b4f-8ad0-cda4fa40334d" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "aggregateId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -294,15 +299,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.784020Z", - "deviceId": "7aa81293-dec8-4816-a1a8-2c687c01042c" + "registrationCreatedOn": "2024-10-23T13:28:04.974960Z", + "deviceId": "89b4ad43-071d-4b4f-8ad0-cda4fa40334d" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -311,6 +316,11 @@ "isPrimaryDevice": true, "roleName": "Test device" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.974960Z", + "deviceId": "89b4ad43-071d-4b4f-8ad0-cda4fa40334d" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -318,7 +328,7 @@ ], "participantStatusList": [ { - "participantId": "8ba6c597-f2d2-4fc6-98e7-bce34e18ce8a", + "participantId": "ee7b08a8-4aa2-4f4d-8800-e9e35e212fe4", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -335,7 +345,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor", "apiVersion": "1.3", - "studyDeploymentId": "c58edc1e-c451-483b-9552-7b455ed2e0a6", + "studyDeploymentId": "5e25307a-98c1-44df-ac6b-338dd70ba0c0", "primaryDeviceRoleName": "Test device" }, "precedingEvents": [], @@ -348,8 +358,8 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.784020Z", - "deviceId": "7aa81293-dec8-4816-a1a8-2c687c01042c" + "registrationCreatedOn": "2024-10-23T13:28:04.974960Z", + "deviceId": "89b4ad43-071d-4b4f-8ad0-cda4fa40334d" } } } diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/modifications_after_stop_not_allowed.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/modifications_after_stop_not_allowed.json index 15e542e37..f6385f2d1 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/modifications_after_stop_not_allowed.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/modifications_after_stop_not_allowed.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "id": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "protocol": { - "id": "c5724080-e5ec-4366-a9e4-281203369ab5", - "createdOn": "2024-10-09T08:17:33.804237Z", + "id": "f8077775-b1a2-411f-943c-66269ce2f569", + "createdOn": "2024-10-23T13:28:04.991855Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -34,7 +34,7 @@ }, "invitations": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -52,12 +52,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "aggregateId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "protocol": { - "id": "c5724080-e5ec-4366-a9e4-281203369ab5", - "createdOn": "2024-10-09T08:17:33.804237Z", + "id": "f8077775-b1a2-411f-943c-66269ce2f569", + "createdOn": "2024-10-23T13:28:04.991855Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -84,7 +84,7 @@ }, "invitations": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -103,7 +103,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -138,7 +138,7 @@ ], "participantStatusList": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -155,14 +155,14 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatus", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14" + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7" }, "precedingEvents": [], "publishedEvents": [], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -197,7 +197,7 @@ ], "participantStatusList": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -214,21 +214,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804445Z", - "deviceId": "01c6bda0-9c68-45e9-a924-687df9a27f4c" + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "aggregateId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -236,15 +236,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804445Z", - "deviceId": "01c6bda0-9c68-45e9-a924-687df9a27f4c" + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -253,6 +253,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -276,7 +281,7 @@ ], "participantStatusList": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -293,36 +298,36 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceRoleName": "Connected", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804598Z", - "deviceId": "38bb9e8b-2303-46bb-aa33-3a8cb1cd03bb" + "registrationCreatedOn": "2024-10-23T13:28:04.992104Z", + "deviceId": "cabea3df-845e-43e4-926b-be8d32792815" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "aggregateId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", "roleName": "Connected" }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804598Z", - "deviceId": "38bb9e8b-2303-46bb-aa33-3a8cb1cd03bb" + "registrationCreatedOn": "2024-10-23T13:28:04.992104Z", + "deviceId": "cabea3df-845e-43e4-926b-be8d32792815" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -331,6 +336,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -341,6 +351,11 @@ "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", "roleName": "Connected" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.992104Z", + "deviceId": "cabea3df-845e-43e4-926b-be8d32792815" + }, "canBeDeployed": false, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -348,7 +363,7 @@ ], "participantStatusList": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -365,21 +380,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.Stop", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14" + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7" }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentStopped", - "aggregateId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "aggregateId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14" + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7" } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Stopped", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -388,6 +403,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -398,6 +418,11 @@ "__type": "dk.cachet.carp.common.infrastructure.test.StubDeviceConfiguration", "roleName": "Connected" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.992104Z", + "deviceId": "cabea3df-845e-43e4-926b-be8d32792815" + }, "canBeDeployed": false, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [] @@ -405,7 +430,7 @@ ], "participantStatusList": [ { - "participantId": "08ea7dca-bb45-446d-b464-4f92d9408e55", + "participantId": "28b5e14f-67d0-4cf3-b901-8ba1a3165f69", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -423,12 +448,12 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceRoleName": "Connected", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804735Z", - "deviceId": "b3736803-d27e-42a3-8c91-10175b76abb4" + "registrationCreatedOn": "2024-10-23T13:28:04.992191Z", + "deviceId": "4b9cd54e-e1e1-4443-859c-fe6855919d95" } }, "precedingEvents": [], @@ -440,7 +465,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.UnregisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "deviceRoleName": "Primary" }, "precedingEvents": [], @@ -452,7 +477,7 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetDeviceDeploymentFor", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "primaryDeviceRoleName": "Primary" }, "precedingEvents": [], @@ -465,8 +490,8 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804445Z", - "deviceId": "01c6bda0-9c68-45e9-a924-687df9a27f4c" + "registrationCreatedOn": "2024-10-23T13:28:04.992045Z", + "deviceId": "495cfa02-72d4-451c-974a-c53268ebb7a9" }, "connectedDevices": [ { @@ -477,8 +502,8 @@ "connectedDeviceRegistrations": { "Connected": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.804598Z", - "deviceId": "38bb9e8b-2303-46bb-aa33-3a8cb1cd03bb" + "registrationCreatedOn": "2024-10-23T13:28:04.992104Z", + "deviceId": "cabea3df-845e-43e4-926b-be8d32792815" } } } @@ -488,9 +513,9 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.DeviceDeployed", "apiVersion": "1.3", - "studyDeploymentId": "fa0ae217-904a-4a9f-b28a-ae9c9dd68f14", + "studyDeploymentId": "c92146bf-fd35-4b9b-86d1-72d9cec344e7", "primaryDeviceRoleName": "Primary", - "deviceDeploymentLastUpdatedOn": "2024-10-09T08:17:33.804598Z" + "deviceDeploymentLastUpdatedOn": "2024-10-23T13:28:04.992104Z" }, "precedingEvents": [], "publishedEvents": [], diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_can_be_called_multiple_times.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_can_be_called_multiple_times.json index d3f2dc875..a7ef34f51 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_can_be_called_multiple_times.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_can_be_called_multiple_times.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "id": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "protocol": { - "id": "0d8f8e63-63c5-45af-b83f-3d75d5807eeb", - "createdOn": "2024-10-09T08:17:33.814534Z", + "id": "4a379a94-5063-425b-baec-e25959031131", + "createdOn": "2024-10-23T13:28:05.000594Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -34,7 +34,7 @@ }, "invitations": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -52,12 +52,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "aggregateId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "apiVersion": "1.3", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "protocol": { - "id": "0d8f8e63-63c5-45af-b83f-3d75d5807eeb", - "createdOn": "2024-10-09T08:17:33.814534Z", + "id": "4a379a94-5063-425b-baec-e25959031131", + "createdOn": "2024-10-23T13:28:05.000594Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -84,7 +84,7 @@ }, "invitations": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -103,7 +103,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -138,7 +138,7 @@ ], "participantStatusList": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -155,14 +155,14 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatus", "apiVersion": "1.3", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777" + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a" }, "precedingEvents": [], "publishedEvents": [], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -197,7 +197,7 @@ ], "participantStatusList": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -214,21 +214,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.814753Z", - "deviceId": "115ada23-3643-4a81-b2c5-20c53b70af32" + "registrationCreatedOn": "2024-10-23T13:28:05.000734Z", + "deviceId": "9edb801b-a09a-46f4-9517-654b3c6dc163" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "aggregateId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "apiVersion": "1.3", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -236,15 +236,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.814753Z", - "deviceId": "115ada23-3643-4a81-b2c5-20c53b70af32" + "registrationCreatedOn": "2024-10-23T13:28:05.000734Z", + "deviceId": "9edb801b-a09a-46f4-9517-654b3c6dc163" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -253,6 +253,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:05.000734Z", + "deviceId": "9edb801b-a09a-46f4-9517-654b3c6dc163" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -276,7 +281,7 @@ ], "participantStatusList": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -293,12 +298,12 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.814753Z", - "deviceId": "115ada23-3643-4a81-b2c5-20c53b70af32" + "registrationCreatedOn": "2024-10-23T13:28:05.000734Z", + "deviceId": "9edb801b-a09a-46f4-9517-654b3c6dc163" } }, "precedingEvents": [], @@ -306,7 +311,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "f235ad9c-66f2-4245-bcb3-8b2985eae777", + "studyDeploymentId": "8510e14f-c6f3-4ac8-84da-8e1f5290cc1a", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -315,6 +320,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:05.000734Z", + "deviceId": "9edb801b-a09a-46f4-9517-654b3c6dc163" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -338,7 +348,7 @@ ], "participantStatusList": [ { - "participantId": "bb31c185-6b47-4a81-92a0-ea802ead5032", + "participantId": "331b8f8d-0e87-46f9-8683-e66462dfa41d", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_cannot_be_called_with_same_registration_when_stopped.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_cannot_be_called_with_same_registration_when_stopped.json index 2c77cdd21..721f1aa7f 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_cannot_be_called_with_same_registration_when_stopped.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/registerDevice_cannot_be_called_with_same_registration_when_stopped.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "id": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "protocol": { - "id": "9e062dc6-1dcc-4a9e-b6c2-0ce9bd019302", - "createdOn": "2024-10-09T08:17:33.769601Z", + "id": "ae2e7cc1-2e9f-4fb0-a6ca-36033eff7af4", + "createdOn": "2024-10-23T13:28:04.953112Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -34,7 +34,7 @@ }, "invitations": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -52,12 +52,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "aggregateId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "protocol": { - "id": "9e062dc6-1dcc-4a9e-b6c2-0ce9bd019302", - "createdOn": "2024-10-09T08:17:33.769601Z", + "id": "ae2e7cc1-2e9f-4fb0-a6ca-36033eff7af4", + "createdOn": "2024-10-23T13:28:04.953112Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -84,7 +84,7 @@ }, "invitations": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -103,7 +103,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -138,7 +138,7 @@ ], "participantStatusList": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -155,14 +155,14 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatus", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b" + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd" }, "precedingEvents": [], "publishedEvents": [], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -197,7 +197,7 @@ ], "participantStatusList": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -214,21 +214,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.769796Z", - "deviceId": "4ad851e6-550e-4b45-92d1-ed8bb6cc3025" + "registrationCreatedOn": "2024-10-23T13:28:04.953329Z", + "deviceId": "fce7c813-4103-4ac8-974d-df6acda867df" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "aggregateId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -236,15 +236,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.769796Z", - "deviceId": "4ad851e6-550e-4b45-92d1-ed8bb6cc3025" + "registrationCreatedOn": "2024-10-23T13:28:04.953329Z", + "deviceId": "fce7c813-4103-4ac8-974d-df6acda867df" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -253,6 +253,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.953329Z", + "deviceId": "fce7c813-4103-4ac8-974d-df6acda867df" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -276,7 +281,7 @@ ], "participantStatusList": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -293,21 +298,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.Stop", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b" + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd" }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentStopped", - "aggregateId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "aggregateId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b" + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd" } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Stopped", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -316,6 +321,11 @@ "isPrimaryDevice": true, "roleName": "Primary" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.953329Z", + "deviceId": "fce7c813-4103-4ac8-974d-df6acda867df" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -339,7 +349,7 @@ ], "participantStatusList": [ { - "participantId": "e600986f-bca0-43c3-b59d-5c1c66adcd62", + "participantId": "094908ed-aa9e-4c01-956f-34bd303d9e9e", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -357,12 +367,12 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "371dbdd3-3913-4ee3-a300-e7e7639a7d0b", + "studyDeploymentId": "c2e773a1-bb22-4340-bd39-2fcef2cceebd", "deviceRoleName": "Primary", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.769796Z", - "deviceId": "4ad851e6-550e-4b45-92d1-ed8bb6cc3025" + "registrationCreatedOn": "2024-10-23T13:28:04.953329Z", + "deviceId": "fce7c813-4103-4ac8-974d-df6acda867df" } }, "precedingEvents": [], diff --git a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/unregisterDevice_succeeds.json b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/unregisterDevice_succeeds.json index 18194b63d..8b5dfa67b 100644 --- a/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/unregisterDevice_succeeds.json +++ b/carp.deployments.core/src/commonTest/resources/test-requests/DeploymentService/1.3/DeploymentServiceTest/unregisterDevice_succeeds.json @@ -4,10 +4,10 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.CreateStudyDeployment", "apiVersion": "1.3", - "id": "911fd544-135f-49f0-8998-377b1307b70f", + "id": "d70a1936-9230-4537-a849-4b6cf9c6f279", "protocol": { - "id": "1721c856-0087-433b-a719-a8ada7641802", - "createdOn": "2024-10-09T08:17:33.778003Z", + "id": "c8bafd50-7ea2-4a73-998d-ca1b80cd5e8d", + "createdOn": "2024-10-23T13:28:04.968044Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -34,7 +34,7 @@ }, "invitations": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -52,12 +52,12 @@ "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.StudyDeploymentCreated", - "aggregateId": "911fd544-135f-49f0-8998-377b1307b70f", + "aggregateId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "protocol": { - "id": "1721c856-0087-433b-a719-a8ada7641802", - "createdOn": "2024-10-09T08:17:33.778003Z", + "id": "c8bafd50-7ea2-4a73-998d-ca1b80cd5e8d", + "createdOn": "2024-10-23T13:28:04.968044Z", "version": 0, "ownerId": "27879e75-ccc1-4866-9ab3-4ece1b735052", "name": "Test protocol", @@ -84,7 +84,7 @@ }, "invitations": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -103,7 +103,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -138,7 +138,7 @@ ], "participantStatusList": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -155,14 +155,14 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.GetStudyDeploymentStatus", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f" + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279" }, "precedingEvents": [], "publishedEvents": [], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.Invited", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -197,7 +197,7 @@ ], "participantStatusList": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -214,21 +214,21 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.RegisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceRoleName": "Test device", "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.778267Z", - "deviceId": "a43533e7-58fb-4b5b-bed1-312ec0cc0d49" + "registrationCreatedOn": "2024-10-23T13:28:04.968882Z", + "deviceId": "42bc556e-e337-47de-8b6a-3e5ed76c63f1" } }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "911fd544-135f-49f0-8998-377b1307b70f", + "aggregateId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -236,15 +236,15 @@ }, "registration": { "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", - "registrationCreatedOn": "2024-10-09T08:17:33.778267Z", - "deviceId": "a43533e7-58fb-4b5b-bed1-312ec0cc0d49" + "registrationCreatedOn": "2024-10-23T13:28:04.968882Z", + "deviceId": "42bc556e-e337-47de-8b6a-3e5ed76c63f1" } } ], "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered", @@ -253,6 +253,11 @@ "isPrimaryDevice": true, "roleName": "Test device" }, + "deviceRegistration": { + "__type": "dk.cachet.carp.common.application.devices.DefaultDeviceRegistration", + "registrationCreatedOn": "2024-10-23T13:28:04.968882Z", + "deviceId": "42bc556e-e337-47de-8b6a-3e5ed76c63f1" + }, "canBeDeployed": true, "remainingDevicesToRegisterToObtainDeployment": [], "remainingDevicesToRegisterBeforeDeployment": [ @@ -276,7 +281,7 @@ ], "participantStatusList": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, @@ -293,16 +298,16 @@ "request": { "__type": "dk.cachet.carp.deployments.infrastructure.DeploymentServiceRequest.UnregisterDevice", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceRoleName": "Test device" }, "precedingEvents": [], "publishedEvents": [ { "__type": "dk.cachet.carp.deployments.application.DeploymentService.Event.DeviceRegistrationChanged", - "aggregateId": "911fd544-135f-49f0-8998-377b1307b70f", + "aggregateId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "apiVersion": "1.3", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "device": { "__type": "dk.cachet.carp.common.infrastructure.test.StubPrimaryDeviceConfiguration", "isPrimaryDevice": true, @@ -314,7 +319,7 @@ "response": { "__type": "dk.cachet.carp.deployments.application.StudyDeploymentStatus.DeployingDevices", "createdOn": "1970-01-01T00:00:00Z", - "studyDeploymentId": "911fd544-135f-49f0-8998-377b1307b70f", + "studyDeploymentId": "d70a1936-9230-4537-a849-4b6cf9c6f279", "deviceStatusList": [ { "__type": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Unregistered", @@ -349,7 +354,7 @@ ], "participantStatusList": [ { - "participantId": "c8b447cf-a7ca-4b6c-bdd2-61ada806f849", + "participantId": "d3e49de4-e760-4c70-b9f6-27aaaf7a6246", "assignedParticipantRoles": { "__type": "dk.cachet.carp.common.application.users.AssignedTo.All" }, diff --git a/rpc/schemas/deployments/DeviceDeploymentStatus.json b/rpc/schemas/deployments/DeviceDeploymentStatus.json index 39d925470..f3e6323b9 100644 --- a/rpc/schemas/deployments/DeviceDeploymentStatus.json +++ b/rpc/schemas/deployments/DeviceDeploymentStatus.json @@ -29,6 +29,13 @@ }, "required": [ "remainingDevicesToRegisterToObtainDeployment", "remainingDevicesToRegisterBeforeDeployment" ] }, + "HasRegistration": { + "type": "object", + "properties": { + "deviceRegistration": { "$ref": "../common/devices/DeviceRegistration.json" } + }, + "required": [ "deviceRegistration" ] + }, "Unregistered": { "$anchor": "Unregistered", "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/NotDeployed" ], @@ -41,7 +48,7 @@ }, "Registered": { "$anchor": "Registered", - "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/NotDeployed" ], + "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/NotDeployed", "#/$defs/HasRegistration" ], "properties": { "__type": { "const": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Registered" }, "canBeDeployed": { "type": "boolean" } @@ -51,7 +58,7 @@ }, "Deployed": { "$anchor": "Deployed", - "allOf": [ "#/$defs/DeviceDeploymentStatus" ], + "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/HasRegistration" ], "properties": { "__type": { "const": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.Deployed" } }, @@ -59,7 +66,7 @@ }, "NeedsRedeployment": { "$anchor": "NeedsRedeployment", - "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/NotDeployed" ], + "allOf": [ "#/$defs/DeviceDeploymentStatus", "#/$defs/NotDeployed", "#/$defs/HasRegistration" ], "properties": { "__type": { "const": "dk.cachet.carp.deployments.application.DeviceDeploymentStatus.NeedsRedeployment" } }, diff --git a/rpc/src/main/kotlin/dk/cachet/carp/rpc/GenerateExampleRequests.kt b/rpc/src/main/kotlin/dk/cachet/carp/rpc/GenerateExampleRequests.kt index 8b02b9d97..1fa473e1b 100644 --- a/rpc/src/main/kotlin/dk/cachet/carp/rpc/GenerateExampleRequests.kt +++ b/rpc/src/main/kotlin/dk/cachet/carp/rpc/GenerateExampleRequests.kt @@ -192,7 +192,7 @@ private val bikeBeaconPreregistration = bikeBeacon.createRegistration { private val phoneRegistration = phone.createRegistration { deviceId = UUID( "fc7b41b0-e9e2-4b5d-8c3d-5119b556a3f0" ).toString() }.setRegistrationCreatedOn( Instant.fromEpochSeconds( 1642514110 ) ) -private val bikeBeaconStatus = DeviceDeploymentStatus.Registered( bikeBeacon, false, emptySet(), emptySet() ) +private val bikeBeaconStatus = DeviceDeploymentStatus.Registered( bikeBeacon, phoneRegistration, false, emptySet(), emptySet() ) private val participantStatusList = listOf( ParticipantStatus( participantId, participantAssignedRoles, setOf( phone.roleName ) ) ) @@ -210,7 +210,7 @@ private val runningDeploymentStatus = StudyDeploymentStatus.Running( deploymentCreatedOn, deploymentId, listOf( - DeviceDeploymentStatus.Deployed( phone ), + DeviceDeploymentStatus.Deployed( phone, phoneRegistration ), bikeBeaconStatus ), participantStatusList, @@ -220,7 +220,7 @@ private val stoppedDeploymentStatus = StudyDeploymentStatus.Stopped( deploymentCreatedOn, deploymentId, listOf( - DeviceDeploymentStatus.Deployed( phone ), + DeviceDeploymentStatus.Deployed( phone, phoneRegistration ), bikeBeaconStatus ), participantStatusList, @@ -425,7 +425,7 @@ private val exampleRequests: Map, LoggedRequest.Succeeded<*>> = map deploymentCreatedOn, deploymentId, listOf( - DeviceDeploymentStatus.Registered( phone, true, emptySet(), emptySet() ), + DeviceDeploymentStatus.Registered( phone, phoneRegistration, true, emptySet(), emptySet() ), bikeBeaconStatus ), participantStatusList,