Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build-logic/build_properties.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ extra.apply {
* https://simprints.atlassian.net/wiki/spaces/KB/pages/1761378305/Releasing+Simprints+ID
*
* Dev version >= 2024.2.1 is required for receiving biometric sdk age restrictions
* Dev version >= 2024.3.0 is required to receive configuration ID
*/
set("VERSION_NAME", "2024.2.1")
set("VERSION_NAME", "2024.3.0")

/**
* Build type. The version code describes which build type was used for the build.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal class UpdateSessionScopePayloadUseCaseTest {
device = Device("deviceId", "deviceModel", "deviceManufacturer"),
databaseInfo = DatabaseInfo(0, 0),
projectConfigurationUpdatedAt = "",
projectConfigurationId = "",
location = null,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class ProjectAuthenticatorTest {
} returns Token("", "", "", "")

coEvery { configManager.getProjectConfiguration() } returns ProjectConfiguration(
"id",
PROJECT_ID,
"",
general = GeneralConfiguration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ internal class SignerManagerTest {
tokenizationKeys = emptyMap()
),
ProjectConfiguration(
DEFAULT_PROJECT_ID, "", mockk(), mockk(), mockk(), mockk(), mockk(), mockk()
"id", DEFAULT_PROJECT_ID, "", mockk(), mockk(), mockk(), mockk(), mockk(), mockk()
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ internal class ConfigLocalDataSourceImpl @Inject constructor(

val defaultProjectConfiguration: ProtoProjectConfiguration =
ProjectConfiguration(
id = "",
projectId = "",
updatedAt = "",
general = GeneralConfiguration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ internal data class OldProjectConfig(
) {
fun toDomain(projectId: String): ProjectConfiguration =
ProjectConfiguration(
id = "",
projectId = projectId,
updatedAt = "",
general = generalConfiguration(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.simprints.infra.config.store.models.ProjectConfiguration

internal fun ProjectConfiguration.toProto(): ProtoProjectConfiguration =
ProtoProjectConfiguration.newBuilder()
.setId(id)
.setProjectId(projectId)
.setUpdatedAt(updatedAt)
.setConsent(consent.toProto())
Expand All @@ -18,6 +19,7 @@ internal fun ProjectConfiguration.toProto(): ProtoProjectConfiguration =

internal fun ProtoProjectConfiguration.toDomain(): ProjectConfiguration =
ProjectConfiguration(
id,
projectId,
updatedAt,
general.toDomain(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.simprints.infra.config.store.models

data class ProjectConfiguration(
val id: String,
val projectId: String,
val updatedAt: String,
val general: GeneralConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.simprints.infra.config.store.models.ProjectConfiguration

@Keep
internal data class ApiProjectConfiguration(
val id: String,
val projectId: String,
val updatedAt: String,
val general: ApiGeneralConfiguration,
Expand All @@ -16,6 +17,7 @@ internal data class ApiProjectConfiguration(
) {

fun toDomain(): ProjectConfiguration = ProjectConfiguration(
id,
projectId,
updatedAt,
general.toDomain(),
Expand Down
1 change: 1 addition & 0 deletions infra/config-store/src/main/proto/project_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ message ProtoProjectConfiguration {
ProtoIdentificationConfiguration identification = 6;
ProtoSynchronizationConfiguration synchronization = 7;
string updated_at = 8;
string id = 10;
}

message ProtoGeneralConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class ConfigLocalDataSourceImplTest {
fun `should save the project configuration and update the device configuration correctly with an empty list of fingersToCollect if fingerprint config is missing`() =
runTest(UnconfinedTestDispatcher()) {
val projectConfigurationToSave = ProjectConfiguration(
"id",
"projectId",
"updatedAt",
generalConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ApiProjectConfigurationTest {
@Test
fun `should map correctly the model when both fingerprint and face are missing`() {
val apiProjectConfiguration = ApiProjectConfiguration(
"id",
"projectId",
"updatedAt",
apiGeneralConfiguration,
Expand All @@ -25,6 +26,7 @@ class ApiProjectConfigurationTest {
apiSynchronizationConfiguration
)
val projectConfiguration = ProjectConfiguration(
"id",
"projectId",
"updatedAt",
generalConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ internal val protoSynchronizationConfiguration = ProtoSynchronizationConfigurati
.build()

internal val apiProjectConfiguration = ApiProjectConfiguration(
"id",
"projectId",
"updatedAt",
apiGeneralConfiguration,
Expand All @@ -359,6 +360,7 @@ internal val apiProjectConfiguration = ApiProjectConfiguration(
)

internal val projectConfiguration = ProjectConfiguration(
"id",
"projectId",
"updatedAt",
generalConfiguration,
Expand All @@ -370,6 +372,7 @@ internal val projectConfiguration = ProjectConfiguration(
)

internal val protoProjectConfiguration = ProtoProjectConfiguration.newBuilder()
.setId("id")
.setProjectId("projectId")
.setUpdatedAt("updatedAt")
.setGeneral(protoGeneralConfiguration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ internal data class ApiEventScope(
val location: ApiLocation?,
@JsonInclude(Include.NON_EMPTY)
val projectConfigurationUpdatedAt: String,
val projectConfigurationId: String,
val events: List<ApiEvent>,
) {

Expand All @@ -48,6 +49,7 @@ internal data class ApiEventScope(
databaseInfo = scope.payload.databaseInfo.fromDomainToApi(),
location = scope.payload.location?.fromDomainToApi(),
projectConfigurationUpdatedAt = scope.payload.projectConfigurationUpdatedAt,
projectConfigurationId = scope.payload.projectConfigurationId.orEmpty(),
events = events.map { it.fromDomainToApi() }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ApiEventScopeTest {
databaseInfo = ApiDatabaseInfo(0, 0),
location = null,
projectConfigurationUpdatedAt = "",
projectConfigurationId = "",
events = emptyList()
)

Expand Down Expand Up @@ -51,6 +52,7 @@ class ApiEventScopeTest {
databaseInfo = ApiDatabaseInfo(0, 0),
location = null,
projectConfigurationUpdatedAt = "123",
projectConfigurationId = "",
events = emptyList()
)

Expand All @@ -60,4 +62,4 @@ class ApiEventScopeTest {
// Assert
Truth.assertThat(json).contains("projectConfigurationUpdatedAt")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ fun createSessionScope(
device = deviceArg,
databaseInfo = databaseInfoArg,
location = locationArg,
projectConfigurationUpdatedAt = "projectConfigurationUpdatedAt"
projectConfigurationUpdatedAt = "projectConfigurationUpdatedAt",
projectConfigurationId = "projectConfigurationId",
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ internal open class EventRepositoryImpl @Inject constructor(
),
databaseInfo = DatabaseInfo(sessionCount),
projectConfigurationUpdatedAt = projectConfiguration.updatedAt,
projectConfigurationId = projectConfiguration.id,
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data class EventScopePayload(
val libSimprintsVersion: String,
val language: String,
val projectConfigurationUpdatedAt: String,
val projectConfigurationId: String? = null,

val modalities: List<GeneralConfiguration.Modality>,
val device: Device,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ internal val identificationConfiguration =
IdentificationConfiguration(4, IdentificationConfiguration.PoolType.PROJECT)

internal val projectConfiguration = ProjectConfiguration(
"id",
"projectId",
"updatedAt",
generalConfiguration,
Expand Down