From 0bf6c178c8c9e0ce7fbb0d3636c668251921ae08 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Mon, 17 Mar 2025 11:08:20 +0100 Subject: [PATCH 1/9] ECWID-159524 Add additional types --- .../v3/dto/profile/enums/ScheduledTimePrecisionType.kt | 6 ++++++ .../v3/dto/profile/result/FetchedShippingOption.kt | 1 + 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt index db9d9b4a..3965195e 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt @@ -5,3 +5,9 @@ enum class ScheduledTimePrecisionType { DATE, DATE_AND_TIME_SLOT, } + +@Suppress("unused") +enum class PickupPrecisionType { + DATE_ONLY, + DATE_AND_TIME; +} diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedShippingOption.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedShippingOption.kt index caf93309..6ae60122 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedShippingOption.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedShippingOption.kt @@ -27,6 +27,7 @@ data class FetchedShippingOption( val pickupPreparationTimeHours: Int? = null, val pickupBusinessHours: String? = null, val scheduledPickup: Boolean? = null, + val pickupPrecisionType: PickupPrecisionType? = null, val type: String? = null, val carrier: String? = null, val carrierMethods: List? = null, From 253c8328463b8f47e59b25e262fb0f14d08f7439 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Mon, 17 Mar 2025 11:13:18 +0100 Subject: [PATCH 2/9] ECWID-159524 detekt: Remove semicolon --- .../v3/dto/profile/enums/ScheduledTimePrecisionType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt index 3965195e..a2767f73 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt @@ -9,5 +9,5 @@ enum class ScheduledTimePrecisionType { @Suppress("unused") enum class PickupPrecisionType { DATE_ONLY, - DATE_AND_TIME; + DATE_AND_TIME, } From 11666b47da5db3f9c0ee3b017a51f747a03c14a0 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Mon, 17 Mar 2025 12:44:54 +0100 Subject: [PATCH 3/9] ECWID-159524 Update additional places --- .../com/ecwid/apiclient/v3/converter/FetchedShippingOption.kt | 1 + .../apiclient/v3/dto/profile/request/UpdatedShippingOption.kt | 1 + .../FetchedShippingoptionNullablePropertyRules.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedShippingOption.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedShippingOption.kt index ca01dde8..a42333ca 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedShippingOption.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedShippingOption.kt @@ -27,6 +27,7 @@ fun FetchedShippingOption.toUpdated(): UpdatedShippingOption { pickupInstruction = pickupInstruction, pickupInstructionTranslated = pickupInstructionTranslated, scheduledPickup = scheduledPickup, + pickupPrecisionType = pickupPrecisionType, type = type, carrier = carrier, carrierSettings = carrierSettings?.toUpdate(), diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedShippingOption.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedShippingOption.kt index 3ebd20ad..20b0e85a 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedShippingOption.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedShippingOption.kt @@ -27,6 +27,7 @@ data class UpdatedShippingOption( val pickupPreparationTimeHours: Int? = null, val pickupBusinessHours: String? = null, val scheduledPickup: Boolean? = null, + val pickupPrecisionType: PickupPrecisionType? = null, val type: String? = null, val carrier: String? = null, val carrierMethods: List? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedShippingoptionNullablePropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedShippingoptionNullablePropertyRules.kt index d854f756..131eb2e9 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedShippingoptionNullablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedShippingoptionNullablePropertyRules.kt @@ -25,6 +25,7 @@ val fetchedShippingOptionNullablePropertyRules: List> AllowNullable(FetchedShippingOption::pickupInstructionTranslated), AllowNullable(FetchedShippingOption::pickupBusinessHours), AllowNullable(FetchedShippingOption::pickupPreparationTimeHours), + AllowNullable(FetchedShippingOption::pickupPrecisionType), AllowNullable(FetchedShippingOption::type), AllowNullable(FetchedShippingOption::carrier), AllowNullable(FetchedShippingOption::carrierSettings), From d90961396779226fbb883ab047b4b6ba4b75889a Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Mon, 17 Mar 2025 13:49:43 +0100 Subject: [PATCH 4/9] ECWID-159524 Additional rules for fetched order --- .../apiclient/v3/dto/order/enums/PickupPrecisionType.kt | 7 +++++++ .../ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt | 1 + .../ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt | 1 + .../v3/rule/nullablepropertyrules/FetchedOrderRules.kt | 1 + 4 files changed, 10 insertions(+) create mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/PickupPrecisionType.kt diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/PickupPrecisionType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/PickupPrecisionType.kt new file mode 100644 index 00000000..3cba4ef5 --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/PickupPrecisionType.kt @@ -0,0 +1,7 @@ +package com.ecwid.apiclient.v3.dto.order.enums + +@Suppress("unused") +enum class PickupPrecisionType { + DATE_ONLY, + DATE_AND_TIME, +} diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt index f2a3f794..bdd3abd0 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt @@ -342,6 +342,7 @@ data class FetchedOrder( val estimatedTransitTime: String? = null, val isPickup: Boolean? = null, val pickupInstruction: String? = null, + val pickupPrecisionType: PickupPrecisionType? = null, val fulfillmentType: FulfillmentType? = null, val locationId: String? = null, val localizedLabel: String? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt index 17d43c1a..3af00e22 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt @@ -227,6 +227,7 @@ val nonUpdatablePropertyRules: List> = listOf( ReadOnly(FetchedOrder.ShippingOption::scheduled), ReadOnly(FetchedOrder.ShippingOption::scheduledTimePrecisionType), ReadOnly(FetchedOrder.ShippingOption::timeSlotLengthInMinutes), + ReadOnly(FetchedOrder.ShippingOption::pickupPrecisionType), ReadOnly(FetchedOrder.HandlingFee::valueWithoutTax), ReadOnly(FetchedOrder.Surcharge::totalWithoutTax), Ignored(FetchedOrder::refundedAmount), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt index 4e9898e4..b146cc8a 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt @@ -188,6 +188,7 @@ val fetchedOrderNullablePropertyRules: List> = listOf AllowNullable(FetchedOrder.ShippingOption::scheduled), AllowNullable(FetchedOrder.ShippingOption::scheduledTimePrecisionType), AllowNullable(FetchedOrder.ShippingOption::timeSlotLengthInMinutes), + AllowNullable(FetchedOrder.ShippingOption::pickupPrecisionType), AllowNullable(FetchedOrder.ShippingServiceInfo::carrier), AllowNullable(FetchedOrder.ShippingServiceInfo::carrierName), AllowNullable(FetchedOrder.ShippingServiceInfo::carrierServiceCode), From 160a830efd4cde057f5250666921fb7a9e3980c8 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Mon, 17 Mar 2025 15:53:30 +0100 Subject: [PATCH 5/9] ECWID-159524 Trigger actions From 555660c1bb93bec1c5b125d14eb2cc981eba01a8 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Tue, 18 Mar 2025 11:05:31 +0100 Subject: [PATCH 6/9] ECWID-159524 Extract PickupPrecision into file --- .../apiclient/v3/dto/profile/enums/PickupPrecisionType.kt | 7 +++++++ .../v3/dto/profile/enums/ScheduledTimePrecisionType.kt | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/PickupPrecisionType.kt diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/PickupPrecisionType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/PickupPrecisionType.kt new file mode 100644 index 00000000..62e103d6 --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/PickupPrecisionType.kt @@ -0,0 +1,7 @@ +package com.ecwid.apiclient.v3.dto.profile.enums + +@Suppress("unused") +enum class PickupPrecisionType { + DATE_ONLY, + DATE_AND_TIME, +} diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt index a2767f73..db9d9b4a 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/enums/ScheduledTimePrecisionType.kt @@ -5,9 +5,3 @@ enum class ScheduledTimePrecisionType { DATE, DATE_AND_TIME_SLOT, } - -@Suppress("unused") -enum class PickupPrecisionType { - DATE_ONLY, - DATE_AND_TIME, -} From 778a8fa3d79ecabef1ce7a3b8868e8a788e4cf65 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Tue, 18 Mar 2025 15:32:11 +0100 Subject: [PATCH 7/9] ECWID-159524 Temporarily disable failing tests --- src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt | 2 ++ src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt | 1 + 2 files changed, 3 insertions(+) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt index 6544eaea..d2c32133 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -24,6 +24,7 @@ class CartsTest : BaseEntityTest() { } @Test + @Disabled("temporarily disabled, enable before merge") fun testCreateAndGetCart() { // Creating new cart val testOrder = generateTestOrder() @@ -203,6 +204,7 @@ class CartsTest : BaseEntityTest() { } @Test + @Disabled("temporarily disabled, enable before merge") fun testConvertCartToOrder() { // Creating new cart val testOrder = generateTestOrder() diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt index d875bd8a..e2c4d1ca 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt @@ -29,6 +29,7 @@ class OrdersTest : BaseEntityTest() { } @Test + @Disabled("temporarily disabled, enable before merge") fun testOrderLifecycle() { // Creating new order val orderCreateRequest = OrderCreateRequest( From 3d82fa718301f74b7ca3203785ab0fb536cdf1ca Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Wed, 19 Mar 2025 09:34:13 +0100 Subject: [PATCH 8/9] ECWID-159524 Enable disabled tests --- src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt | 2 -- src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt | 1 - 2 files changed, 3 deletions(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt index d2c32133..6544eaea 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -24,7 +24,6 @@ class CartsTest : BaseEntityTest() { } @Test - @Disabled("temporarily disabled, enable before merge") fun testCreateAndGetCart() { // Creating new cart val testOrder = generateTestOrder() @@ -204,7 +203,6 @@ class CartsTest : BaseEntityTest() { } @Test - @Disabled("temporarily disabled, enable before merge") fun testConvertCartToOrder() { // Creating new cart val testOrder = generateTestOrder() diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt index e2c4d1ca..d875bd8a 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt @@ -29,7 +29,6 @@ class OrdersTest : BaseEntityTest() { } @Test - @Disabled("temporarily disabled, enable before merge") fun testOrderLifecycle() { // Creating new order val orderCreateRequest = OrderCreateRequest( From b6303fa5948d2294645c3bd9f64bc82f8dd3f307 Mon Sep 17 00:00:00 2001 From: Amith Gotamey Date: Wed, 19 Mar 2025 09:49:46 +0100 Subject: [PATCH 9/9] ECWID-159524 just a test