diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt index e3b970f3..940970e1 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt @@ -9,6 +9,7 @@ import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap import com.ecwid.apiclient.v3.dto.customer.enums.CommercialRelationshipScheme import com.ecwid.apiclient.v3.dto.order.enums.* import com.ecwid.apiclient.v3.dto.order.request.UpdatedOrder +import com.ecwid.apiclient.v3.dto.productcomponent.result.FetchedProductComponent import com.ecwid.apiclient.v3.jsontransformer.JsonFieldName import java.util.* @@ -218,7 +219,8 @@ data class FetchedOrder( val externalReferenceId: String? = null, val isPreorder: Boolean? = null, val attributes: List? = null, - val taxClassCode: String? = null + val taxClassCode: String? = null, + val compositeComponents: List? = null, ) data class RecurringChargeSettings( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt index 226f1c5e..ba127ce5 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt @@ -4,6 +4,7 @@ import com.ecwid.apiclient.v3.dto.common.* import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind import com.ecwid.apiclient.v3.dto.product.enums.* import com.ecwid.apiclient.v3.dto.product.request.UpdatedProduct +import com.ecwid.apiclient.v3.dto.productcomponent.result.FetchedProductComponent import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType import com.ecwid.apiclient.v3.dto.variation.result.FetchedVariation import java.util.* @@ -142,6 +143,7 @@ data class FetchedProduct( val rating: Double? = null, val reviewsModerated: Int? = null, val reviewsPublished: Int? = null, + val compositeComponents: List? = null, ) : ApiFetchedDTO, ApiResultDTO { data class BorderInfo( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/productcomponent/result/FetchedProductComponent.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/productcomponent/result/FetchedProductComponent.kt new file mode 100644 index 00000000..dc201c54 --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/productcomponent/result/FetchedProductComponent.kt @@ -0,0 +1,14 @@ +package com.ecwid.apiclient.v3.dto.productcomponent.result + +import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO +import com.ecwid.apiclient.v3.dto.common.ApiResultDTO + +data class FetchedProductComponent( + val productId: Long = 0L, + val combinationId: Long? = null, + val quantity: Int = 0, +) : ApiFetchedDTO, ApiResultDTO { + + override fun getModifyKind() = ApiFetchedDTO.ModifyKind.ReadOnly + +} diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt index 3af00e22..27b8d614 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt @@ -74,6 +74,7 @@ val nonUpdatablePropertyRules: List> = listOf( ReadOnly(FetchedProduct::rating), ReadOnly(FetchedProduct::reviewsModerated), ReadOnly(FetchedProduct::reviewsPublished), + ReadOnly(FetchedProduct::compositeComponents), Ignored(FetchedCart::cartId), Ignored(FetchedCart::email), @@ -206,6 +207,7 @@ val nonUpdatablePropertyRules: List> = listOf( ReadOnly(FetchedOrder.OrderItem::priceWithoutTax), ReadOnly(FetchedOrder.OrderItem::files), ReadOnly(FetchedOrder.OrderItem::attributes), + ReadOnly(FetchedOrder.OrderItem::compositeComponents), Ignored(FetchedOrder.OrderItem::imageUrl), Ignored(FetchedOrder.OrderItem::smallThumbnailUrl), Ignored(FetchedOrder.OrderItem::hdThumbnailUrl), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt index 974e0ff6..42d29f5e 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt @@ -206,6 +206,7 @@ val nullablePropertyRules: List> = listOf( fetchedCustomersConfigNullablePropertyRules, brandsSearchRequestNullablePropertyRules, fetchedBrandNullablePropertyRules, + fetchedProductComponentNullablePropertyRules, ).flatten() sealed class NullablePropertyRule( diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt index fc17f10e..37b345b1 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt @@ -100,6 +100,7 @@ val fetchedOrderNullablePropertyRules: List> = listOf AllowNullable(FetchedOrder.OrderItem::isPreorder), AllowNullable(FetchedOrder.OrderItem::attributes), AllowNullable(FetchedOrder.OrderItem::taxClassCode), + AllowNullable(FetchedOrder.OrderItem::compositeComponents), IgnoreNullable(FetchedOrder.OrderItemDiscounts::discountInfo), IgnoreNullable(FetchedOrder.OrderItemDiscounts::total), AllowNullable(FetchedOrder.OrderItemOptionFile::id), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductComponentRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductComponentRules.kt new file mode 100644 index 00000000..132ee90b --- /dev/null +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductComponentRules.kt @@ -0,0 +1,9 @@ +package com.ecwid.apiclient.v3.rule.nullablepropertyrules + +import com.ecwid.apiclient.v3.dto.productcomponent.result.FetchedProductComponent +import com.ecwid.apiclient.v3.rule.NullablePropertyRule +import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable + +val fetchedProductComponentNullablePropertyRules: List> = listOf( + AllowNullable(FetchedProductComponent::combinationId), +) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt index 4dd429de..4bd20bc2 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt @@ -172,4 +172,5 @@ val fetchedProductNullablePropertyRules: List> = list AllowNullable(FetchedProduct::minPurchaseQuantity), AllowNullable(FetchedProduct::maxPurchaseQuantity), AllowNullable(FetchedProduct::locationInventory), + AllowNullable(FetchedProduct::compositeComponents), )