From 903721716ae7292ca0d06ce497b71fb3105c0dcc Mon Sep 17 00:00:00 2001 From: mvgreen Date: Wed, 14 Feb 2024 14:53:10 +0400 Subject: [PATCH 1/3] Add new FetchedAdditionalData for inventory report --- .../kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt | 1 + .../v3/dto/report/result/FetchedReportResponse.kt | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt b/src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt index 92b3f6041..d435e2cbd 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt @@ -530,6 +530,7 @@ private fun createAdditionalDataPolymorphicType(): PolymorphicType Date: Wed, 14 Feb 2024 15:11:45 +0400 Subject: [PATCH 2/3] Provide default values for all properties --- .../apiclient/v3/dto/report/result/FetchedReportResponse.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/result/FetchedReportResponse.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/result/FetchedReportResponse.kt index f4302a908..7fd88e5ac 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/result/FetchedReportResponse.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/result/FetchedReportResponse.kt @@ -51,7 +51,7 @@ data class FetchedReportResponse( ) : FetchedAdditionalData(AdditionalDataType.CUSTOMERS) data class AdditionalInventoryData( - val productId: Int, + val productId: Int = 0, val sku: String? = null, val imageUrl: String? = null, val thumbnailUrl: String? = null, From d373c0bf873b6c213fd50aae3049cf6ef4346218 Mon Sep 17 00:00:00 2001 From: mvgreen Date: Wed, 14 Feb 2024 15:14:06 +0400 Subject: [PATCH 3/3] Allow nullable values for properties in AdditionalInventoryData --- .../com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt | 5 +++++ 1 file changed, 5 insertions(+) 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 e7fcecc6b..156b56ff2 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt @@ -94,6 +94,11 @@ val otherNullablePropertyRules: List> = listOf( AllowNullable(FetchedReportResponse.FetchedCustomerData::customerEmail), AllowNullable(FetchedReportResponse.FetchedCustomerData::customerPhone), + AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::sku), + AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::imageUrl), + AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::thumbnailUrl), + AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::exampleOrder), + AllowNullable(CreateBatchRequest::groupId), AllowNullable(CreateBatchRequestWithIds::groupId),