Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ fun FetchedStoreProfile.Settings.toUpdated(): UpdatedStoreProfile.Settings {
storeName = storeName,
tikTokPixel = tikTokPixel?.toUpdated(),
askAgeConfirmationInStorefront = askAgeConfirmationInStorefront,
fbMessengerSettings = fbMessengerSettings?.toUpdated(),
)
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,20 @@ data class FetchedStoreProfile(
val storeName: String? = null,
val tikTokPixel: TikTokPixelSettings? = null,
val askAgeConfirmationInStorefront: Boolean = false,
val fbMessengerSettings: FbMessengerSettings? = null,
)

data class TikTokPixelSettings(
val code: String? = null,
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]", "[email protected]"),
Expand Down
Loading