Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECWID-137817 New customers: add favorites to the internal API - added 'favorites' field to FetchedCustomer #395

Merged
merged 3 commits into from
Apr 10, 2024
Merged
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 @@ -6,6 +6,7 @@ import com.ecwid.apiclient.v3.dto.customer.enums.CommercialRelationshipScheme
import com.ecwid.apiclient.v3.dto.customer.request.UpdatedCustomer
import com.ecwid.apiclient.v3.jsontransformer.JsonFieldName
import java.util.*
import kotlin.collections.ArrayList

data class FetchedCustomer(
val id: Int = 0,
Expand All @@ -24,6 +25,7 @@ data class FetchedCustomer(
val lang: String? = null,
val stats: CustomerStats? = null,
val privateAdminNotes: String? = null,
val favorites: List<CustomerFavorite> = ArrayList(),

@JsonFieldName("b2b_b2c")
val commercialRelationshipScheme: CommercialRelationshipScheme = CommercialRelationshipScheme.b2c,
Expand Down Expand Up @@ -82,5 +84,10 @@ data class FetchedCustomer(
val timestamp: Date? = null,
)

data class CustomerFavorite(
val productId: Long = 0,
val addedTimestamp: Date? = null,
)

override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCustomer::class)
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ val nonUpdatablePropertyRules: List<NonUpdatablePropertyRule<*, *>> = listOf(
ReadOnly(FetchedCustomer.ShippingAddress::addressFormatted),
ReadOnly(FetchedCustomer::stats),
ReadOnly(FetchedCustomer.CustomerContact::timestamp),
ReadOnly(FetchedCustomer::favorites),
ReadOnly(FetchedCustomer.CustomerFavorite::productId),
ReadOnly(FetchedCustomer.CustomerFavorite::addedTimestamp),

ReadOnly(FetchedCustomerGroup::id),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ val fetchedCustomerNullablePropertyRules: List<NullablePropertyRule<*, *>> = lis
AllowNullable(FetchedCustomer.CustomerContact::handle),
AllowNullable(FetchedCustomer.CustomerContact::note),
AllowNullable(FetchedCustomer.CustomerContact::timestamp),
AllowNullable(FetchedCustomer.CustomerFavorite::addedTimestamp),

AllowNullable(CustomerFilterShippingAddress::street),
AllowNullable(CustomerFilterShippingAddress::city),
Expand Down
Loading