From 1c5ff04251b320d256be28ad5b8799453a9e4b72 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 28 Sep 2026 19:16:10 +0200 Subject: [PATCH] fix(core): map message metadata prtnUUID --- .../network/responses/MessagesResponse.kt | 1 + .../network/responses/MessagesResponseTest.kt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/core/src/commonMain/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponse.kt b/core/src/commonMain/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponse.kt index af5ad390..8ba64af0 100644 --- a/core/src/commonMain/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponse.kt +++ b/core/src/commonMain/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponse.kt @@ -307,6 +307,7 @@ data class MessagesResponse( val categoryId: MessageCategory, val subCategoryId: MessageSubCategory, val messageId: Int, + @SerialName("prtnUUID") val messagePartitionUUID: String? ) { @Serializable(with = MessageCategory.Serializer::class) diff --git a/core/src/commonTest/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponseTest.kt b/core/src/commonTest/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponseTest.kt index a8483112..a0dec3f6 100644 --- a/core/src/commonTest/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponseTest.kt +++ b/core/src/commonTest/kotlin/com/sourcepoint/mobile_core/network/responses/MessagesResponseTest.kt @@ -1,11 +1,30 @@ package com.sourcepoint.mobile_core.network.responses +import com.sourcepoint.mobile_core.network.json +import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json.Default.encodeToString import kotlinx.serialization.json.JsonObject import kotlin.test.Test import kotlin.test.assertEquals class MessagesResponseTest { + @Test + fun decodeMessageMetaDataUsesPrtnUuidWireName() { + val metadata = json.decodeFromString( + """ + { + "categoryId": 1, + "subCategoryId": 5, + "messageId": 1429939, + "messagePartitionUUID": null, + "prtnUUID": "partition-uuid" + } + """.trimIndent() + ) + + assertEquals("partition-uuid", metadata.messagePartitionUUID) + } + @Test fun encodeToJsonTest() { val message = MessagesResponse.Message(