Skip to content

Commit

Permalink
Merge pull request #374 from Ecwid/additional_data_for_products
Browse files Browse the repository at this point in the history
Add new FetchedAdditionalData for inventory report
  • Loading branch information
mvgreen authored Feb 14, 2024
2 parents 5d75eb1 + d373c0b commit 3d5588b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/com/ecwid/apiclient/v3/ApiClientHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ private fun createAdditionalDataPolymorphicType(): PolymorphicType<FetchedReport
"utm" to FetchedReportResponse.FetchedAdditionalData.AdditionalUtmData::class.java,
"orders" to FetchedReportResponse.FetchedAdditionalData.AdditionalOrdersData::class.java,
"customers" to FetchedReportResponse.FetchedAdditionalData.AdditionalCustomerData::class.java,
"product" to FetchedReportResponse.FetchedAdditionalData.AdditionalInventoryData::class.java
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,19 @@ data class FetchedReportResponse(
val customerData: FetchedCustomerData = FetchedCustomerData(),
) : FetchedAdditionalData(AdditionalDataType.CUSTOMERS)

data class AdditionalInventoryData(
val productId: Int = 0,
val sku: String? = null,
val imageUrl: String? = null,
val thumbnailUrl: String? = null,
val exampleOrder: String? = null,
) : FetchedAdditionalData(AdditionalDataType.PRODUCT)

enum class AdditionalDataType {
UTM,
ORDERS,
CUSTOMERS,
PRODUCT,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ val otherNullablePropertyRules: List<NullablePropertyRule<*, *>> = 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),

Expand Down

0 comments on commit 3d5588b

Please sign in to comment.