Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fun FetchedOrder.HandlingFee.toUpdated(): UpdatedOrder.HandlingFee {
name = name,
value = value,
description = description,
taxes = taxes.map(FetchedOrder.BaseOrderItemTax::toUpdated)
taxes = taxes.map(FetchedOrder.HandlingFeeTax::toUpdated)
)
}

Expand All @@ -260,6 +260,14 @@ fun FetchedOrder.BaseOrderItemTax.toUpdated(): UpdatedOrder.BaseOrderItemTax {
)
}

fun FetchedOrder.HandlingFeeTax.toUpdated(): UpdatedOrder.HandlingFeeTax {
return UpdatedOrder.HandlingFeeTax(
name = name,
value = value,
total = total
)
}

fun FetchedOrder.UtmData.toUpdated(): UpdatedOrder.UtmData {
return UpdatedOrder.UtmData(
source = source,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ecwid.apiclient.v3.dto.cart.request

import com.ecwid.apiclient.v3.dto.common.ApiRequestDTO
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax
import com.ecwid.apiclient.v3.dto.order.enums.*
import java.text.DateFormat
import java.text.SimpleDateFormat
Expand Down Expand Up @@ -170,13 +171,13 @@ data class OrderForCalculate(
)

data class OrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null,
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null,
val taxOnDiscountedSubtotal: Double? = null,
val taxOnShipping: Double? = null,
val includeInPrice: Boolean? = null
)
) : BaseOrderTax

data class OrderItemProductFile(
val productFileId: Int? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package com.ecwid.apiclient.v3.dto.cart.request
import com.ecwid.apiclient.v3.dto.cart.result.FetchedCart
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax

data class UpdatedCart(
val hidden: Boolean? = null,
val taxesOnShipping: List<TaxOnShipping>? = null
) : ApiUpdatedDTO {

data class TaxOnShipping(
val name: String? = null,
val value: Double? = null,
val total: Double? = null
)
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCart::class)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.cart.result

import com.ecwid.apiclient.v3.dto.cart.CartStringToStringMap
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax
import com.ecwid.apiclient.v3.dto.order.enums.*
import java.util.*

Expand Down Expand Up @@ -159,13 +160,13 @@ data class CalculateOrderDetailsResult(
)

data class OrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null,
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null,
val taxOnDiscountedSubtotal: Double? = null,
val taxOnShipping: Double? = null,
val includeInPrice: Boolean? = null
)
) : BaseOrderTax

data class OrderItemProductFile(
val productFileId: Int? = null,
Expand Down Expand Up @@ -226,8 +227,8 @@ data class CalculateOrderDetailsResult(
)

data class TaxOnShipping(
val name: String? = null,
val value: Double? = null,
val total: Double? = null
)
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.ecwid.apiclient.v3.dto.cart.CartStringToStringMap
import com.ecwid.apiclient.v3.dto.cart.request.UpdatedCart
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax
import com.ecwid.apiclient.v3.dto.order.enums.*
import java.util.*

Expand Down Expand Up @@ -165,13 +166,13 @@ data class FetchedCart(
)

data class OrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null,
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null,
val taxOnDiscountedSubtotal: Double? = null,
val taxOnShipping: Double? = null,
val includeInPrice: Boolean? = null
)
) : BaseOrderTax

data class OrderItemProductFile(
val productFileId: Int? = null,
Expand Down Expand Up @@ -234,10 +235,10 @@ data class FetchedCart(
)

data class TaxOnShipping(
val name: String? = null,
val value: Double? = null,
val total: Double? = null
)
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

data class UtmData(
val source: String? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.ecwid.apiclient.v3.dto.common

interface BaseOrderTax {
val name: String?
val value: Double?
val total: Double?
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.order.request

import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO
import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax
import com.ecwid.apiclient.v3.dto.common.OrderedStringToListStringMap
import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap
import com.ecwid.apiclient.v3.dto.order.enums.*
Expand Down Expand Up @@ -237,19 +238,25 @@ data class UpdatedOrder(
)

data class BaseOrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null
)
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

data class OrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null,
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null,
val taxOnDiscountedSubtotal: Double? = null,
val taxOnShipping: Double? = null,
val includeInPrice: Boolean? = null
)
) : BaseOrderTax

data class HandlingFeeTax(
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

data class ProductDimensions(
val length: Double? = null,
Expand Down Expand Up @@ -287,7 +294,7 @@ data class UpdatedOrder(
val name: String? = null,
val value: Double? = null,
val description: String? = null,
val taxes: List<BaseOrderItemTax>? = null
val taxes: List<HandlingFeeTax>? = null
)

data class UtmData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ecwid.apiclient.v3.dto.order.result

import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.BaseOrderTax
import com.ecwid.apiclient.v3.dto.common.OrderedStringToListStringMap
import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap
import com.ecwid.apiclient.v3.dto.order.enums.*
Expand Down Expand Up @@ -222,21 +223,21 @@ data class FetchedOrder(
)

data class BaseOrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null
)
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

data class OrderItemTax(
val name: String? = null,
val value: Double? = null,
val total: Double? = null,
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null,
val taxOnDiscountedSubtotal: Double? = null,
val taxOnShipping: Double? = null,
val includeInPrice: Boolean? = null,
val sourceTaxRateId: Int? = null,
val sourceTaxRateType: RateType? = null
) {
) : BaseOrderTax {
enum class RateType {
AUTO,
MANUAL,
Expand All @@ -245,6 +246,13 @@ data class FetchedOrder(
}
}


data class HandlingFeeTax(
override val name: String? = null,
override val value: Double? = null,
override val total: Double? = null
) : BaseOrderTax

data class ProductDimensions(
val length: Double? = null,
val width: Double? = null,
Expand Down Expand Up @@ -306,7 +314,7 @@ data class FetchedOrder(
val value: Double? = null,
val valueWithoutTax: Double = 0.0,
val description: String? = null,
val taxes: List<BaseOrderItemTax> = listOf()
val taxes: List<HandlingFeeTax> = listOf()
)

data class RefundInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
AllowNullable(FetchedOrder.BaseOrderItemTax::name),
AllowNullable(FetchedOrder.BaseOrderItemTax::total),
AllowNullable(FetchedOrder.BaseOrderItemTax::value),
AllowNullable(FetchedOrder.HandlingFeeTax::name),
AllowNullable(FetchedOrder.HandlingFeeTax::total),
AllowNullable(FetchedOrder.HandlingFeeTax::value),
AllowNullable(FetchedOrder::latestShipDate),
IgnoreNullable(FetchedOrder::publicUid),
IgnoreNullable(FetchedOrder.CreditCardStatus::avsMessage),
Expand Down