diff --git a/domain/monster/data/src/commonMain/kotlin/br/alexandregpereira/hunter/data/monster/local/mapper/SpeedEntityMapper.kt b/domain/monster/data/src/commonMain/kotlin/br/alexandregpereira/hunter/data/monster/local/mapper/SpeedEntityMapper.kt index 387b3d1f..50667f47 100644 --- a/domain/monster/data/src/commonMain/kotlin/br/alexandregpereira/hunter/data/monster/local/mapper/SpeedEntityMapper.kt +++ b/domain/monster/data/src/commonMain/kotlin/br/alexandregpereira/hunter/data/monster/local/mapper/SpeedEntityMapper.kt @@ -31,10 +31,11 @@ internal fun SpeedWithValuesEntity.toDomain(): Speed { } internal fun List.toDomain(): List { - return this.map { + return this.mapIndexed { index, speedValueEntity -> SpeedValue( - type = SpeedType.valueOf(it.type), - valueFormatted = it.valueFormatted + type = SpeedType.valueOf(speedValueEntity.type), + valueFormatted = speedValueEntity.valueFormatted, + index = "${speedValueEntity.speedId}-${speedValueEntity.type}-$index" ) } } diff --git a/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationAnalytics.kt b/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationAnalytics.kt index cd8ced5c..d1ab5a69 100644 --- a/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationAnalytics.kt +++ b/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationAnalytics.kt @@ -1,6 +1,7 @@ package br.alexandregpereira.hunter.monster.registration import br.alexandregpereira.hunter.analytics.Analytics +import br.alexandregpereira.hunter.domain.model.Monster internal fun Analytics.trackMonsterRegistrationOpened(monsterIndex: String) { track( @@ -20,11 +21,12 @@ internal fun Analytics.trackMonsterRegistrationClosed(monsterIndex: String) { ) } -internal fun Analytics.trackMonsterRegistrationSaved(monsterIndex: String) { +internal fun Analytics.trackMonsterRegistrationSaved(monster: Monster) { track( eventName = "MonsterRegistration - saved", params = mapOf( - "monsterIndex" to monsterIndex, + "monsterIndex" to monster.index, + "monster" to monster.toString(), ), ) } diff --git a/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationStateHolder.kt b/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationStateHolder.kt index 1a291ee0..81c78f87 100644 --- a/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationStateHolder.kt +++ b/feature/monster-registration/state-holder/src/commonMain/kotlin/br/alexandregpereira/hunter/monster/registration/MonsterRegistrationStateHolder.kt @@ -67,7 +67,7 @@ class MonsterRegistrationStateHolder internal constructor( } override fun onSaved() { - analytics.trackMonsterRegistrationSaved(state.value.monster.index) + analytics.trackMonsterRegistrationSaved(state.value.monster) normalizeMonster(state.value.monster) .flatMapConcat { monster -> saveMonsters(monsters = listOf(monster))