Skip to content

Commit

Permalink
Add additional customer data type
Browse files Browse the repository at this point in the history
  • Loading branch information
aleskarova committed Jan 18, 2024
1 parent 2e354a1 commit 2ed332b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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 @@ -529,6 +529,7 @@ private fun createAdditionalDataPolymorphicType(): PolymorphicType<FetchedReport
childClasses = mapOf(
"utm" to FetchedReportResponse.FetchedAdditionalData.AdditionalUtmData::class.java,
"orders" to FetchedReportResponse.FetchedAdditionalData.AdditionalOrdersData::class.java,
"customers" to FetchedReportResponse.FetchedAdditionalData.AdditionalCustomerData::class.java,
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ data class FetchedReportResponse(
val ordersCount: Int = 0,
) : FetchedAdditionalData(AdditionalDataType.ORDERS)

data class AdditionalCustomerData(
val customerData: FetchedCustomerData,
) : FetchedAdditionalData(AdditionalDataType.CUSTOMERS)

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

Expand All @@ -58,6 +63,13 @@ data class FetchedReportResponse(
val utmCampaign: String = "",
)

data class FetchedCustomerData(
val customerId: Int? = null,
val customerEmail: String? = null,
val customerPhone: String? = null,
val customerName: String? = null,
)

override fun getModifyKind() = ApiFetchedDTO.ModifyKind.ReadOnly

}

0 comments on commit 2ed332b

Please sign in to comment.