Skip to content

Commit 4a75261

Browse files
authored
Merge pull request #224 from Ecwid/extrafield-config-surcharge
Add support for negative and floating point numbers for surcharges
2 parents 6ecfd8c + a0971ec commit 4a75261

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedExtrafieldConfig.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,18 @@ data class UpdatedExtrafieldConfig(
4040
data class UpdatedExtrafieldOptionConfig(
4141
val title: String? = null,
4242
val subtitle: String? = null,
43-
val surcharge: Int? = null,
43+
val surcharge: Double? = null,
4444
val titleTranslated: LocalizedValueMap? = null,
4545
val subtitleTranslated: LocalizedValueMap? = null
46-
)
46+
) {
47+
constructor(
48+
title: String?,
49+
subtitle: String?,
50+
surcharge: Int?,
51+
titleTranslated: LocalizedValueMap?,
52+
subtitleTranslated: LocalizedValueMap?
53+
) : this(title, subtitle, surcharge?.toDouble(), titleTranslated, subtitleTranslated)
54+
}
4755

4856
data class UpdatedExtrafieldSurchargeConfig(
4957
val name: String? = null,

src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedExtrafieldConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ data class FetchedExtrafieldConfig(
4040
data class FetchedExtrafieldOptionConfig(
4141
val title: String? = null,
4242
val subtitle: String? = null,
43-
val surcharge: Int? = null,
43+
val surcharge: Double? = null,
4444
val titleTranslated: LocalizedValueMap? = null,
4545
val subtitleTranslated: LocalizedValueMap? = null
4646
)

0 commit comments

Comments
 (0)