File tree 6 files changed +31
-4
lines changed
libs/fluxc-plugin/src/main/kotlin/org/wordpress/android/fluxc/model
6 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ class FeeLine {
23
23
24
24
@SerializedName(" tax_status" )
25
25
var taxStatus: FeeLineTaxStatus ? = null
26
+
27
+ @SerializedName(" taxes" )
28
+ var taxes: List <LineTaxEntry >? = null
26
29
}
27
30
28
31
enum class FeeLineTaxStatus (val value : String ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ data class LineItem(
28
28
@SerializedName(" bundled_by" )
29
29
val bundledBy : String? = null ,
30
30
@SerializedName(" composite_parent" )
31
- val compositeParent : String? = null
31
+ val compositeParent : String? = null ,
32
+ @SerializedName(" taxes" )
33
+ val taxes : List <LineTaxEntry >? = null ,
32
34
) {
33
35
class Attribute (val key : String? , val value : String? )
34
36
Original file line number Diff line number Diff line change
1
+ package org.wordpress.android.fluxc.model.order
2
+
3
+ import com.google.gson.annotations.SerializedName
4
+ import java.math.BigDecimal
5
+
6
+ /* *
7
+ * Tax information for a line item, it can be part of a line item or a shipping line or a fee line.
8
+ */
9
+ data class LineTaxEntry (
10
+ @SerializedName(" id" )
11
+ val rateId : Long? = null ,
12
+ @SerializedName(" total" )
13
+ private val _total : String? = null ,
14
+ ) {
15
+ val total: BigDecimal ?
16
+ get() = _total ?.toBigDecimalOrNull()
17
+ }
Original file line number Diff line number Diff line change @@ -13,5 +13,7 @@ data class ShippingLine(
13
13
@JsonAdapter(NullStringJsonAdapter ::class , nullSafe = false )
14
14
val methodId : String? = null ,
15
15
@SerializedName(" method_title" )
16
- val methodTitle : String? = null
16
+ val methodTitle : String? = null ,
17
+ @SerializedName(" taxes" )
18
+ val taxes : List <LineTaxEntry >? = null ,
17
19
)
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class RefundMapper @Inject constructor() {
29
29
total = it.total?.toBigDecimalOrNull(),
30
30
sku = it.sku,
31
31
price = it.price?.toBigDecimalOrNull(),
32
- metaData = it.metaData
32
+ metaData = it.metaData,
33
+ taxes = it.taxes
33
34
)
34
35
} ? : emptyList(),
35
36
shippingLineItems = response.shippingLineItems ? : emptyList(),
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.wordpress.android.fluxc.model.refunds
2
2
3
3
import com.google.gson.annotations.SerializedName
4
4
import org.wordpress.android.fluxc.model.metadata.WCMetaData
5
+ import org.wordpress.android.fluxc.model.order.LineTaxEntry
5
6
import java.math.BigDecimal
6
7
import java.util.Date
7
8
@@ -35,7 +36,8 @@ data class WCRefundModel(
35
36
val total : BigDecimal ? = null ,
36
37
val sku : String? = null ,
37
38
val price : BigDecimal ? = null ,
38
- val metaData : List <WCMetaData >? = null
39
+ val metaData : List <WCMetaData >? = null ,
40
+ val taxes : List <LineTaxEntry >? = null
39
41
)
40
42
41
43
data class WCRefundShippingLine (
You can’t perform that action at this time.
0 commit comments