Skip to content

Commit ce1efe1

Browse files
ECWID-155668 Add "updateShippingOption" method to ecwid-java-api-client - (feat) replace FetchedStoreProfile.ShippingOption with new FetchedShippingOption
1 parent 1109053 commit ce1efe1

5 files changed

Lines changed: 4 additions & 170 deletions

File tree

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

Lines changed: 1 addition & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ data class FetchedStoreProfile(
242242
data class Shipping(
243243
val handlingFee: HandlingFee? = null,
244244
val shippingOrigin: ShippingOrigin? = null,
245-
val shippingOptions: List<ShippingOption>? = null
245+
val shippingOptions: List<FetchedShippingOption>? = null
246246
)
247247

248248
data class HandlingFee(
@@ -262,43 +262,6 @@ data class FetchedStoreProfile(
262262
val phone: String? = null
263263
)
264264

265-
data class ShippingOption(
266-
val id: String? = null,
267-
val title: String? = null,
268-
val enabled: Boolean? = null,
269-
val orderBy: Int? = null,
270-
val fulfilmentType: FulfilmentType? = null,
271-
val destinationZone: Zone? = null,
272-
val deliveryTimeDays: String? = null,
273-
val description: String? = null,
274-
val carrier: String? = null,
275-
val carrierMethods: List<CarrierMethod>? = null,
276-
val carrierSettings: CarrierSettings? = null,
277-
val ratesCalculationType: RatesCalculationType? = null,
278-
val shippingCostMarkup: Double? = null,
279-
val flatRate: FlatRate? = null,
280-
val ratesTable: TableRatesDetails? = null,
281-
val appClientId: String? = null,
282-
val locationId: String? = null,
283-
val pickupInstruction: String? = null,
284-
val scheduledPickup: Boolean? = null,
285-
val pickupPreparationTimeHours: Int? = null,
286-
val pickupBusinessHours: String? = null,
287-
val scheduled: Boolean? = null,
288-
val scheduledTimePrecisionType: ScheduledTimePrecisionType? = null,
289-
)
290-
291-
@Suppress("unused")
292-
enum class ScheduledTimePrecisionType {
293-
DATE,
294-
DATE_AND_TIME_SLOT
295-
}
296-
297-
@Suppress("unused")
298-
enum class FulfilmentType {
299-
pickup, shipping, delivery
300-
}
301-
302265
data class Zone(
303266
val id: String? = null,
304267
val name: String? = null,
@@ -307,87 +270,6 @@ data class FetchedStoreProfile(
307270
val postCodes: List<String>? = null
308271
)
309272

310-
data class CarrierMethod(
311-
val id: String? = null,
312-
val name: String? = null,
313-
val enabled: Boolean? = null,
314-
val orderBy: Int? = null
315-
)
316-
317-
data class CarrierSettings(
318-
val defaultCarrierAccountEnabled: Boolean? = null,
319-
val defaultPostageDimensions: DefaultPostageDimensions? = null
320-
)
321-
322-
data class DefaultPostageDimensions(
323-
val length: Double? = null,
324-
val width: Double? = null,
325-
val height: Double? = null
326-
)
327-
328-
@Suppress("unused")
329-
enum class RatesCalculationType {
330-
331-
carrier_calculated,
332-
table,
333-
flat,
334-
app;
335-
336-
override fun toString(): String {
337-
return asApiString()
338-
}
339-
340-
fun asApiString(): String {
341-
return super.toString().replace("_", "-")
342-
}
343-
}
344-
345-
data class FlatRate(
346-
val rateType: RateType? = null,
347-
val rate: Double? = null
348-
) {
349-
350-
@Suppress("unused")
351-
enum class RateType {
352-
ABSOLUTE,
353-
PERCENT
354-
}
355-
}
356-
357-
data class TableRatesDetails(
358-
val tableBasedOn: RateBase? = null,
359-
val rates: List<TableRate>? = null
360-
) {
361-
362-
@Suppress("unused")
363-
enum class RateBase {
364-
subtotal,
365-
discountedSubtotal,
366-
weight
367-
}
368-
}
369-
370-
data class TableRate(
371-
val tableRateConditions: TableRateConditions? = null,
372-
val rate: TableRateDetails? = null
373-
)
374-
375-
data class TableRateConditions(
376-
val weightFrom: Double? = null,
377-
val weightTo: Double? = null,
378-
val subtotalFrom: Double? = null,
379-
val subtotalTo: Double? = null,
380-
val discountedSubtotalFrom: Double? = null,
381-
val discountedSubtotalTo: Double? = null
382-
)
383-
384-
data class TableRateDetails(
385-
val perOrderAbs: Double? = null,
386-
val perOrderPercent: Double? = null,
387-
val perItem: Double? = null,
388-
val perWeightUnitRate: Double? = null
389-
)
390-
391273
data class TaxSettings(
392274
val automaticTaxEnabled: Boolean? = null,
393275
val taxes: List<Taxes>? = null,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package com.ecwid.apiclient.v3.dto.profile.result
22

33
import java.util.*
44

5-
class ShippingOptionsResult : ArrayList<FetchedStoreProfile.ShippingOption>()
5+
class ShippingOptionsResult : ArrayList<FetchedShippingOption>()

src/main/kotlin/com/ecwid/apiclient/v3/jsontransformer/gson/GsonTransformer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.ecwid.apiclient.v3.jsontransformer.gson
22

33
import com.ecwid.apiclient.v3.dto.product.result.GetProductFiltersResult.ProductFilters
4-
import com.ecwid.apiclient.v3.dto.profile.result.FetchedStoreProfile.RatesCalculationType
4+
import com.ecwid.apiclient.v3.dto.profile.enums.RatesCalculationType
55
import com.ecwid.apiclient.v3.exception.JsonDeserializationException
66
import com.ecwid.apiclient.v3.impl.ParsedResponseWithExt
77
import com.ecwid.apiclient.v3.jsontransformer.JsonTransformer

src/main/kotlin/com/ecwid/apiclient/v3/jsontransformer/gson/typeadapters/RatesCalculationTypeDeserializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.ecwid.apiclient.v3.jsontransformer.gson.typeadapters
22

3-
import com.ecwid.apiclient.v3.dto.profile.result.FetchedStoreProfile.RatesCalculationType
3+
import com.ecwid.apiclient.v3.dto.profile.enums.RatesCalculationType
44
import com.google.gson.JsonDeserializationContext
55
import com.google.gson.JsonDeserializer
66
import com.google.gson.JsonElement

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ val fetchedStoreProfileNullablePropertyRules: List<NullablePropertyRule<*, *>> =
3737
IgnoreNullable(FetchedStoreProfile.ApplePay::verificationFileUrl),
3838
IgnoreNullable(FetchedStoreProfile.BusinessRegistrationID::name),
3939
IgnoreNullable(FetchedStoreProfile.BusinessRegistrationID::value),
40-
IgnoreNullable(FetchedStoreProfile.CarrierMethod::enabled),
41-
IgnoreNullable(FetchedStoreProfile.CarrierMethod::id),
42-
IgnoreNullable(FetchedStoreProfile.CarrierMethod::name),
43-
IgnoreNullable(FetchedStoreProfile.CarrierMethod::orderBy),
44-
IgnoreNullable(FetchedStoreProfile.CarrierSettings::defaultCarrierAccountEnabled),
45-
IgnoreNullable(FetchedStoreProfile.CarrierSettings::defaultPostageDimensions),
4640
IgnoreNullable(FetchedStoreProfile.Company::city),
4741
IgnoreNullable(FetchedStoreProfile.Company::companyName),
4842
IgnoreNullable(FetchedStoreProfile.Company::countryCode),
@@ -51,9 +45,6 @@ val fetchedStoreProfileNullablePropertyRules: List<NullablePropertyRule<*, *>> =
5145
IgnoreNullable(FetchedStoreProfile.Company::postalCode),
5246
IgnoreNullable(FetchedStoreProfile.Company::stateOrProvinceCode),
5347
IgnoreNullable(FetchedStoreProfile.Company::street),
54-
IgnoreNullable(FetchedStoreProfile.DefaultPostageDimensions::height),
55-
IgnoreNullable(FetchedStoreProfile.DefaultPostageDimensions::length),
56-
IgnoreNullable(FetchedStoreProfile.DefaultPostageDimensions::width),
5748
AllowNullable(FetchedStoreProfile.DesignSettings::breadcrumbsHaveHomeItem),
5849
AllowNullable(FetchedStoreProfile.DesignSettings::breadcrumbsHomeUrl),
5950
AllowNullable(FetchedStoreProfile.DesignSettings::breadcrumbsSeparator),
@@ -186,8 +177,6 @@ val fetchedStoreProfileNullablePropertyRules: List<NullablePropertyRule<*, *>> =
186177
IgnoreNullable(FetchedStoreProfile.FeatureTogglesInfo::enabled),
187178
IgnoreNullable(FetchedStoreProfile.FeatureTogglesInfo::name),
188179
IgnoreNullable(FetchedStoreProfile.FeatureTogglesInfo::visible),
189-
IgnoreNullable(FetchedStoreProfile.FlatRate::rate),
190-
IgnoreNullable(FetchedStoreProfile.FlatRate::rateType),
191180
IgnoreNullable(FetchedStoreProfile.FormatsAndUnits::currency),
192181
IgnoreNullable(FetchedStoreProfile.FormatsAndUnits::currencyDecimalSeparator),
193182
IgnoreNullable(FetchedStoreProfile.FormatsAndUnits::currencyGroupSeparator),
@@ -310,29 +299,6 @@ val fetchedStoreProfileNullablePropertyRules: List<NullablePropertyRule<*, *>> =
310299
IgnoreNullable(FetchedStoreProfile.Shipping::handlingFee),
311300
IgnoreNullable(FetchedStoreProfile.Shipping::shippingOptions),
312301
IgnoreNullable(FetchedStoreProfile.Shipping::shippingOrigin),
313-
IgnoreNullable(FetchedStoreProfile.ShippingOption::appClientId),
314-
IgnoreNullable(FetchedStoreProfile.ShippingOption::carrier),
315-
IgnoreNullable(FetchedStoreProfile.ShippingOption::carrierMethods),
316-
IgnoreNullable(FetchedStoreProfile.ShippingOption::carrierSettings),
317-
IgnoreNullable(FetchedStoreProfile.ShippingOption::deliveryTimeDays),
318-
IgnoreNullable(FetchedStoreProfile.ShippingOption::description),
319-
IgnoreNullable(FetchedStoreProfile.ShippingOption::destinationZone),
320-
IgnoreNullable(FetchedStoreProfile.ShippingOption::enabled),
321-
IgnoreNullable(FetchedStoreProfile.ShippingOption::flatRate),
322-
IgnoreNullable(FetchedStoreProfile.ShippingOption::fulfilmentType),
323-
IgnoreNullable(FetchedStoreProfile.ShippingOption::id),
324-
AllowNullable(FetchedStoreProfile.ShippingOption::locationId),
325-
IgnoreNullable(FetchedStoreProfile.ShippingOption::orderBy),
326-
IgnoreNullable(FetchedStoreProfile.ShippingOption::pickupBusinessHours),
327-
IgnoreNullable(FetchedStoreProfile.ShippingOption::pickupInstruction),
328-
IgnoreNullable(FetchedStoreProfile.ShippingOption::pickupPreparationTimeHours),
329-
IgnoreNullable(FetchedStoreProfile.ShippingOption::ratesCalculationType),
330-
IgnoreNullable(FetchedStoreProfile.ShippingOption::ratesTable),
331-
IgnoreNullable(FetchedStoreProfile.ShippingOption::scheduledPickup),
332-
IgnoreNullable(FetchedStoreProfile.ShippingOption::shippingCostMarkup),
333-
IgnoreNullable(FetchedStoreProfile.ShippingOption::title),
334-
AllowNullable(FetchedStoreProfile.ShippingOption::scheduled),
335-
AllowNullable(FetchedStoreProfile.ShippingOption::scheduledTimePrecisionType),
336302
IgnoreNullable(FetchedStoreProfile.ShippingOrigin::city),
337303
IgnoreNullable(FetchedStoreProfile.ShippingOrigin::companyName),
338304
IgnoreNullable(FetchedStoreProfile.ShippingOrigin::countryCode),
@@ -342,20 +308,6 @@ val fetchedStoreProfileNullablePropertyRules: List<NullablePropertyRule<*, *>> =
342308
IgnoreNullable(FetchedStoreProfile.ShippingOrigin::stateOrProvinceCode),
343309
IgnoreNullable(FetchedStoreProfile.ShippingOrigin::street),
344310
AllowNullable(FetchedStoreProfile.ShippingSettings::enabledShippingMethods),
345-
IgnoreNullable(FetchedStoreProfile.TableRate::rate),
346-
IgnoreNullable(FetchedStoreProfile.TableRate::tableRateConditions),
347-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::discountedSubtotalFrom),
348-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::discountedSubtotalTo),
349-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::subtotalFrom),
350-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::subtotalTo),
351-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::weightFrom),
352-
IgnoreNullable(FetchedStoreProfile.TableRateConditions::weightTo),
353-
IgnoreNullable(FetchedStoreProfile.TableRateDetails::perItem),
354-
IgnoreNullable(FetchedStoreProfile.TableRateDetails::perOrderAbs),
355-
IgnoreNullable(FetchedStoreProfile.TableRateDetails::perOrderPercent),
356-
IgnoreNullable(FetchedStoreProfile.TableRateDetails::perWeightUnitRate),
357-
IgnoreNullable(FetchedStoreProfile.TableRatesDetails::rates),
358-
IgnoreNullable(FetchedStoreProfile.TableRatesDetails::tableBasedOn),
359311
IgnoreNullable(FetchedStoreProfile.TaxSettings::automaticTaxEnabled),
360312
IgnoreNullable(FetchedStoreProfile.TaxSettings::pricesIncludeTax),
361313
IgnoreNullable(FetchedStoreProfile.TaxSettings::taxes),

0 commit comments

Comments
 (0)