Skip to content

Commit 5f6f7e6

Browse files
authored
Merge pull request #384 from Ecwid/ECWID_136140
ECWID-136140 New reports: internal API for topOfCouponsByOrders report:
2 parents ee030ab + df4cf2f commit 5f6f7e6

4 files changed

Lines changed: 9 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
@@ -532,6 +532,7 @@ private fun createAdditionalDataPolymorphicType(): PolymorphicType<FetchedReport
532532
"customers" to FetchedReportResponse.FetchedAdditionalData.AdditionalCustomerData::class.java,
533533
"inventory_product" to FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::class.java,
534534
"product" to FetchedReportResponse.FetchedAdditionalData.AdditionalProductData::class.java,
535+
"coupon" to FetchedReportResponse.FetchedAdditionalData.AdditionalCouponData::class.java,
535536
)
536537
)
537538
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/ReportType.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enum class ReportType {
1919
inventory,
2020
topOfShippingMethodsByOrders,
2121
topOfPaymentMethodsByOrders,
22+
topOfCouponsByOrders,
2223

2324
/** finance */
2425
allRevenue,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ data class FetchedReportResponse(
7171
val productEditUrl: String? = null,
7272
) : FetchedAdditionalData(AdditionalDataType.PRODUCT)
7373

74+
data class AdditionalCouponData(
75+
val couponName: String? = null,
76+
) : FetchedAdditionalData(AdditionalDataType.COUPONS)
77+
7478
enum class AdditionalDataType {
7579
UTM,
7680
ORDERS,
7781
CUSTOMERS,
7882
PRODUCT,
7983
INVENTORY_PRODUCT,
84+
COUPONS,
8085
}
8186
}
8287

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ val otherNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
115115
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalProductData::productUrl),
116116
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalProductData::productEditUrl),
117117

118+
AllowNullable(FetchedReportResponse.FetchedAdditionalData.AdditionalCouponData::couponName),
119+
118120
AllowNullable(CreateBatchRequest::groupId),
119121
AllowNullable(CreateBatchRequestWithIds::groupId),
120122

0 commit comments

Comments
 (0)