Skip to content

Commit fb740f7

Browse files
ECWID-137817 New customers: add favorites to the internal API - added 'favorites' field to FetchedCustomer
1 parent 03e102a commit fb740f7

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/dto/customer/result/FetchedCustomer.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ data class FetchedCustomer(
2424
val lang: String? = null,
2525
val stats: CustomerStats? = null,
2626
val privateAdminNotes: String? = null,
27+
var favorites: List<CustomerFavorite>,
2728

2829
@JsonFieldName("b2b_b2c")
2930
val commercialRelationshipScheme: CommercialRelationshipScheme = CommercialRelationshipScheme.b2c,
@@ -82,5 +83,10 @@ data class FetchedCustomer(
8283
val timestamp: Date? = null,
8384
)
8485

86+
data class CustomerFavorite(
87+
val productId: Long = 0,
88+
val addedTimestamp: Date? = null,
89+
)
90+
8591
override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCustomer::class)
8692
}

src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ val nonUpdatablePropertyRules: List<NonUpdatablePropertyRule<*, *>> = listOf(
157157
ReadOnly(FetchedCustomer.ShippingAddress::addressFormatted),
158158
ReadOnly(FetchedCustomer::stats),
159159
ReadOnly(FetchedCustomer.CustomerContact::timestamp),
160+
ReadOnly(FetchedCustomer::favorites),
161+
ReadOnly(FetchedCustomer.CustomerFavorite::productId),
162+
ReadOnly(FetchedCustomer.CustomerFavorite::addedTimestamp),
160163

161164
ReadOnly(FetchedCustomerGroup::id),
162165

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ val fetchedCustomerNullablePropertyRules: List<NullablePropertyRule<*, *>> = lis
5454
AllowNullable(FetchedCustomer.CustomerContact::handle),
5555
AllowNullable(FetchedCustomer.CustomerContact::note),
5656
AllowNullable(FetchedCustomer.CustomerContact::timestamp),
57+
AllowNullable(FetchedCustomer.CustomerFavorite::addedTimestamp),
5758

5859
AllowNullable(CustomerFilterShippingAddress::street),
5960
AllowNullable(CustomerFilterShippingAddress::city),

0 commit comments

Comments
 (0)