From 21bae0f19adf360819173cd76373a5d48074b59e Mon Sep 17 00:00:00 2001 From: gandalf Date: Mon, 10 Jun 2024 11:58:14 +0400 Subject: [PATCH 1/2] ECWID-141762 add enum StorefrontPlatform and use as param in ReportRequest --- .../dto/report/enums/StorefrontPlatform.java | 19 +++++++++++++++++++ .../v3/dto/report/request/ReportRequest.kt | 7 +++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java new file mode 100644 index 000000000..78880d69c --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java @@ -0,0 +1,19 @@ +package com.ecwid.apiclient.v3.dto.report.enums; + +public enum StorefrontPlatform { + undefined, + code, + instantSite, + facebook, + singleProduct, + wix, + linkUp, + email, + ecwidServer, + wordpress, + squarespace, + joomla, + weebly, + duda, + other, +} diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/request/ReportRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/request/ReportRequest.kt index 54981ed85..b5d7c9698 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/request/ReportRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/request/ReportRequest.kt @@ -1,10 +1,7 @@ package com.ecwid.apiclient.v3.dto.report.request import com.ecwid.apiclient.v3.dto.ApiRequest -import com.ecwid.apiclient.v3.dto.report.enums.ComparePeriod -import com.ecwid.apiclient.v3.dto.report.enums.FirstDayOfWeek -import com.ecwid.apiclient.v3.dto.report.enums.ReportType -import com.ecwid.apiclient.v3.dto.report.enums.TimeScaleValue +import com.ecwid.apiclient.v3.dto.report.enums.* import com.ecwid.apiclient.v3.impl.RequestInfo import com.ecwid.apiclient.v3.responsefields.ResponseFields @@ -20,6 +17,7 @@ data class ReportRequest( val limit: Int? = null, val offset: Int? = null, val responseFields: ResponseFields = ResponseFields.All, + val storefrontPlatform: StorefrontPlatform? = null, ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createGetRequest( @@ -42,6 +40,7 @@ data class ReportRequest( orderDirection?.let { put("orderDirection", it) } limit?.let { put("limit", it.toString()) } offset?.let { put("offset", it.toString()) } + storefrontPlatform?.let { put("storefrontPlatform", it.toString()) } }.toMap() } From 6b549fa1b816602b217c0ef2c430d19642c3ec5a Mon Sep 17 00:00:00 2001 From: gandalf Date: Mon, 10 Jun 2024 14:02:43 +0400 Subject: [PATCH 2/2] ECWID-141762 rework StorefrontPlatform to Kotlin and add StorefrontPlatform to NullablePropertyRules --- .../dto/report/enums/StorefrontPlatform.java | 19 ------------------- .../v3/dto/report/enums/StorefrontPlatform.kt | 19 +++++++++++++++++++ .../v3/rule/NullablePropertyRules.kt | 1 + 3 files changed, 20 insertions(+), 19 deletions(-) delete mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java create mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.kt diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java deleted file mode 100644 index 78880d69c..000000000 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ecwid.apiclient.v3.dto.report.enums; - -public enum StorefrontPlatform { - undefined, - code, - instantSite, - facebook, - singleProduct, - wix, - linkUp, - email, - ecwidServer, - wordpress, - squarespace, - joomla, - weebly, - duda, - other, -} diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.kt new file mode 100644 index 000000000..b112b971c --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/StorefrontPlatform.kt @@ -0,0 +1,19 @@ +package com.ecwid.apiclient.v3.dto.report.enums + +enum class StorefrontPlatform { + undefined, + code, + instantSite, + facebook, + singleProduct, + wix, + linkUp, + email, + ecwidServer, + wordpress, + squarespace, + joomla, + weebly, + duda, + other, +} 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 c42a6de4d..85f2e0c2d 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NullablePropertyRules.kt @@ -81,6 +81,7 @@ val otherNullablePropertyRules: List> = listOf( AllowNullable(ReportRequest::orderDirection), AllowNullable(ReportRequest::limit), AllowNullable(ReportRequest::offset), + AllowNullable(ReportRequest::storefrontPlatform), AllowNullable(FetchedReportResponse::timeScaleValue), AllowNullable(FetchedReportResponse::comparePeriod),