Skip to content

Commit 5cc2d7d

Browse files
authored
Merge pull request #387 from Ecwid/ECWID_136326
ECWID-136326 New Reports: internal API for topOfShippingMethodsByOrde…
2 parents dce4bd0 + 012a153 commit 5cc2d7d

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ private fun createAdditionalDataPolymorphicType(): PolymorphicType<FetchedReport
534534
"product" to FetchedReportResponse.FetchedAdditionalData.AdditionalProductData::class.java,
535535
"coupon" to FetchedReportResponse.FetchedAdditionalData.AdditionalCouponData::class.java,
536536
"abandoned_cart" to FetchedReportResponse.FetchedAdditionalData.AdditionalAbandonedCartData::class.java,
537+
"shipping" to FetchedReportResponse.FetchedAdditionalData.AdditionalShippingData::class.java,
537538
)
538539
)
539540
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/report/result/FetchedReportResponse.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.ecwid.apiclient.v3.dto.report.result
22

33
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
4+
import com.ecwid.apiclient.v3.dto.order.enums.FulfillmentType
45
import com.ecwid.apiclient.v3.dto.report.enums.ComparePeriod
56
import com.ecwid.apiclient.v3.dto.report.enums.ReportType
67
import com.ecwid.apiclient.v3.dto.report.enums.TimeScaleValue
@@ -79,6 +80,11 @@ data class FetchedReportResponse(
7980
val autoAbandonedSalesRecovery: Boolean? = null,
8081
) : FetchedAdditionalData(AdditionalDataType.ABANDONED_CARTS)
8182

83+
data class AdditionalShippingData(
84+
val shippingMethodName: String? = null,
85+
val fulfilmentType: FulfillmentType? = null,
86+
) : FetchedAdditionalData(AdditionalDataType.SHIPPING)
87+
8288
enum class AdditionalDataType {
8389
UTM,
8490
ORDERS,
@@ -87,6 +93,7 @@ data class FetchedReportResponse(
8793
INVENTORY_PRODUCT,
8894
COUPONS,
8995
ABANDONED_CARTS,
96+
SHIPPING,
9097
}
9198
}
9299

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ val otherNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
119119

120120
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalAbandonedCartData::autoAbandonedSalesRecovery),
121121

122+
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalShippingData::shippingMethodName),
123+
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalShippingData::fulfilmentType),
124+
122125
AllowNullable(CreateBatchRequest::groupId),
123126
AllowNullable(CreateBatchRequestWithIds::groupId),
124127

0 commit comments

Comments
 (0)