Skip to content

Commit ee992c5

Browse files
ECWID-105431 Add SEO fields and translations for category and store profile
1 parent b75e4ef commit ee992c5

7 files changed

Lines changed: 41 additions & 7 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ fun FetchedCategory.toUpdated(): UpdatedCategory {
1313
description = description,
1414
descriptionTranslated = descriptionTranslated,
1515
enabled = enabled,
16-
productIds = productIds
16+
productIds = productIds,
17+
seoTitle = seoTitle,
18+
seoTitleTranslated = seoTitleTranslated,
19+
seoDescription = seoDescription,
20+
seoDescriptionTranslated = seoDescriptionTranslated
1721
)
1822
}

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ private fun FetchedStoreProfile.Settings.toUpdated(): UpdatedStoreProfile.Settin
8484
showPricePerUnit = showPricePerUnit,
8585
googleProductCategory = googleProductCategory,
8686
productCondition = productCondition,
87-
tikTokPixel = tikTokPixel?.toUpdated()
87+
tikTokPixel = tikTokPixel?.toUpdated(),
88+
storeDescriptionTranslated = storeDescriptionTranslated,
89+
rootCategorySeoTitle = rootCategorySeoTitle,
90+
rootCategorySeoTitleTranslated = rootCategorySeoTitleTranslated,
91+
rootCategorySeoDescription = rootCategorySeoDescription,
92+
rootCategorySeoDescriptionTranslated = rootCategorySeoDescriptionTranslated
8893
)
8994
}
9095

src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ data class UpdatedCategory(
1414
val description: String? = null,
1515
val descriptionTranslated: LocalizedValueMap? = null,
1616
val enabled: Boolean? = null,
17-
val productIds: List<Int>? = null
17+
val productIds: List<Int>? = null,
18+
val seoTitle: String? = null,
19+
val seoTitleTranslated: LocalizedValueMap? = null,
20+
val seoDescription: String? = null,
21+
val seoDescriptionTranslated: LocalizedValueMap? = null
1822
) : ApiUpdatedDTO {
1923

2024
override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCategory::class)

src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ data class FetchedCategory(
2525
val originalImage: PictureInfo? = null,
2626
val url: String? = null,
2727
val productCount: Int? = null,
28-
val enabledProductCount: Int? = null
28+
val enabledProductCount: Int? = null,
29+
30+
val seoTitle: String? = null,
31+
val seoTitleTranslated: LocalizedValueMap? = null,
32+
val seoDescription: String? = null,
33+
val seoDescriptionTranslated: LocalizedValueMap? = null
2934
) : ApiFetchedDTO {
3035

3136
override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCategory::class)

src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.profile.request
22

33
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO
44
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind
5+
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
56
import com.ecwid.apiclient.v3.dto.common.ProductCondition
67
import com.ecwid.apiclient.v3.dto.profile.enums.ProductFilterType
78
import com.ecwid.apiclient.v3.dto.profile.result.FetchedStoreProfile
@@ -71,7 +72,12 @@ data class UpdatedStoreProfile(
7172
val showPricePerUnit: Boolean? = null,
7273
val googleProductCategory: Int? = null,
7374
val productCondition: ProductCondition? = null,
74-
val tikTokPixel: TikTokPixelSettings? = null
75+
val tikTokPixel: TikTokPixelSettings? = null,
76+
val storeDescriptionTranslated: LocalizedValueMap? = null,
77+
val rootCategorySeoTitle: String? = null,
78+
val rootCategorySeoTitleTranslated: LocalizedValueMap? = null,
79+
val rootCategorySeoDescription: String? = null,
80+
val rootCategorySeoDescriptionTranslated: LocalizedValueMap? = null
7581
)
7682

7783
data class TikTokPixelSettings(

src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.profile.result
22

33
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
44
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
5+
import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap
56
import com.ecwid.apiclient.v3.dto.common.ProductCondition
67
import com.ecwid.apiclient.v3.dto.profile.enums.ProductFilterType
78
import com.ecwid.apiclient.v3.dto.profile.request.UpdatedStoreProfile
@@ -98,7 +99,12 @@ data class FetchedStoreProfile(
9899
val googleProductCategory: Int? = null,
99100
val googleProductCategoryName: String? = null,
100101
val productCondition: ProductCondition = ProductCondition.NEW,
101-
val tikTokPixel: TikTokPixelSettings? = null
102+
val tikTokPixel: TikTokPixelSettings? = null,
103+
val storeDescriptionTranslated: LocalizedValueMap? = null,
104+
val rootCategorySeoTitle: String? = null,
105+
val rootCategorySeoTitleTranslated: LocalizedValueMap? = null,
106+
val rootCategorySeoDescription: String? = null,
107+
val rootCategorySeoDescriptionTranslated: LocalizedValueMap? = null
102108
)
103109

104110
data class TikTokPixelSettings(

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ val fetchedCategoryNullablePropertyRules: List<NullablePropertyRule<*, *>> = lis
1919
IgnoreNullable(FetchedCategory::productCount),
2020
IgnoreNullable(FetchedCategory::productIds),
2121
IgnoreNullable(FetchedCategory::thumbnailUrl),
22-
IgnoreNullable(FetchedCategory::url)
22+
IgnoreNullable(FetchedCategory::url),
23+
IgnoreNullable(FetchedCategory::seoTitle),
24+
IgnoreNullable(FetchedCategory::seoTitleTranslated),
25+
IgnoreNullable(FetchedCategory::seoDescription),
26+
IgnoreNullable(FetchedCategory::seoDescriptionTranslated)
2327
)

0 commit comments

Comments
 (0)