diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt index 2e049e4b..7a17c7a6 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt @@ -124,6 +124,7 @@ fun FetchedStoreProfile.Settings.toUpdated(): UpdatedStoreProfile.Settings { storeName = storeName, tikTokPixel = tikTokPixel?.toUpdated(), askAgeConfirmationInStorefront = askAgeConfirmationInStorefront, + fbMessengerSettings = fbMessengerSettings?.toUpdated(), ) } @@ -133,6 +134,14 @@ fun FetchedStoreProfile.TikTokPixelSettings.toUpdated(): UpdatedStoreProfile.Tik ) } +fun FetchedStoreProfile.FbMessengerSettings.toUpdated(): UpdatedStoreProfile.FbMessengerSettings { + return UpdatedStoreProfile.FbMessengerSettings( + fbMessengerPageId = fbMessengerPageId, + fbMessengerThemeColor = fbMessengerThemeColor, + fbMessengerMessageUsButtonColor = fbMessengerMessageUsButtonColor + ) +} + fun FetchedStoreProfile.ProductSortOrder.toUpdated(): UpdatedStoreProfile.ProductSortOrder { return when (this) { FetchedStoreProfile.ProductSortOrder.DEFINED_BY_STORE_OWNER -> UpdatedStoreProfile.ProductSortOrder.DEFINED_BY_STORE_OWNER diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt index 222bbfe2..3b84a004 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt @@ -117,12 +117,19 @@ data class UpdatedStoreProfile( val storeName: String? = null, val tikTokPixel: TikTokPixelSettings? = null, val askAgeConfirmationInStorefront: Boolean? = null, + val fbMessengerSettings: FbMessengerSettings? = null, ) data class TikTokPixelSettings( val advancedMatching: Boolean? = null ) + data class FbMessengerSettings( + val fbMessengerPageId: String? = null, + val fbMessengerThemeColor: String? = null, + val fbMessengerMessageUsButtonColor: String? = null, + ) + enum class ProductSortOrder { DEFINED_BY_STORE_OWNER, ADDED_TIME_DESC, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt index 3afaa046..bfa1515e 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt @@ -149,6 +149,7 @@ data class FetchedStoreProfile( val storeName: String? = null, val tikTokPixel: TikTokPixelSettings? = null, val askAgeConfirmationInStorefront: Boolean = false, + val fbMessengerSettings: FbMessengerSettings? = null, ) data class TikTokPixelSettings( @@ -156,6 +157,12 @@ data class FetchedStoreProfile( val advancedMatching: Boolean = false ) + data class FbMessengerSettings( + val fbMessengerPageId: String? = null, + val fbMessengerThemeColor: String? = null, + val fbMessengerMessageUsButtonColor: String? = null, + ) + enum class ProductSortOrder { DEFINED_BY_STORE_OWNER, ADDED_TIME_DESC, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt index 75977c6d..e43d64cd 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt @@ -73,7 +73,12 @@ class StoreProfileTest : BaseEntityTest() { productCondition = ProductCondition.USED, tikTokPixel = UpdatedStoreProfile.TikTokPixelSettings( advancedMatching = true - ) + ), + fbMessengerSettings = UpdatedStoreProfile.FbMessengerSettings( + fbMessengerPageId = "fbMessengerPageId", + fbMessengerThemeColor = "#000000", + fbMessengerMessageUsButtonColor = "#FFFFFF", + ), ), mailNotifications = UpdatedStoreProfile.MailNotifications( adminNotificationEmails = listOf("admin@example.com", "admin2@example.com"),