Skip to content

Commit

Permalink
Merge pull request #346 from Ecwid/ECWID_128557
Browse files Browse the repository at this point in the history
ECWID-128538 - add tracking url to order
  • Loading branch information
Alexis2004 authored Nov 2, 2023
2 parents 1bd951f + a9b4add commit bee1c41
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder {

fulfillmentStatus = fulfillmentStatus,
trackingNumber = trackingNumber,
trackingUrl = trackingUrl ?: "https://track.aftership.com/$trackingNumber",
pickupTime = pickupTime,

paymentStatus = paymentStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ data class FetchedCart(
val additionalInfo: CartStringToStringMap? = null,
val orderComments: String? = null,
val trackingNumber: String? = null,
val trackingUrl: String? = null,

val paymentMethod: String? = null,
val paymentModule: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data class UpdatedOrder(

val fulfillmentStatus: OrderFulfillmentStatus? = null,
val trackingNumber: String? = null,
val trackingUrl: String? = null,
val pickupTime: Date? = null,

val paymentStatus: OrderPaymentStatus? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ data class FetchedOrder(
val latestShipDate: Date? = null,
val latestDeliveryDate: Date? = null,
val trackingNumber: String? = null,
val trackingUrl: String? = null,
val pickupTime: Date? = null,

val paymentStatus: OrderPaymentStatus? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ val nonUpdatablePropertyRules: List<NonUpdatablePropertyRule<*, *>> = listOf(
Ignored(FetchedCart::additionalInfo),
Ignored(FetchedCart::orderComments),
Ignored(FetchedCart::trackingNumber),
ReadOnly(FetchedCart::trackingUrl),
Ignored(FetchedCart::paymentMethod),
Ignored(FetchedCart::paymentModule),
Ignored(FetchedCart::paymentParams),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ val fetchedCartNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
IgnoreNullable(FetchedCart::total),
IgnoreNullable(FetchedCart::totalAndMembershipBasedDiscount),
IgnoreNullable(FetchedCart::trackingNumber),
AllowNullable(FetchedCart::trackingUrl),
IgnoreNullable(FetchedCart::updateDate),
IgnoreNullable(FetchedCart::updateTimestamp),
IgnoreNullable(FetchedCart::usdTotal),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
AllowNullable(FetchedOrder::totalBeforeGiftCardRedemption),
AllowNullable(FetchedOrder::totalWithoutTax),
AllowNullable(FetchedOrder::trackingNumber),
AllowNullable(FetchedOrder::trackingUrl),
AllowNullable(FetchedOrder::updateDate),
AllowNullable(FetchedOrder::updateTimestamp),
AllowNullable(FetchedOrder::usdTotal),
Expand Down
4 changes: 3 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fun generateTestOrder(): UpdatedOrder {
val externalFulfillment = randomBoolean()
val refererId = "Referer " + randomAlphanumeric(8)
val totalPrice = randomPrice()
val trackingNumber = randomAlphanumeric(16)
return UpdatedOrder(
email = randomEmail(),
ipAddress = randomIp(),
Expand All @@ -29,7 +30,8 @@ fun generateTestOrder(): UpdatedOrder {
privateAdminNotes = "Private admin note " + randomAlphanumeric(16),

fulfillmentStatus = randomEnumValue<OrderFulfillmentStatus>(),
trackingNumber = randomAlphanumeric(16),
trackingNumber = trackingNumber,
trackingUrl = "https://track.aftership.com/$trackingNumber",

paymentStatus = randomEnumValue(OrderPaymentStatus.INCOMPLETE),
paymentMethod = "Payment method " + randomAlphanumeric(8),
Expand Down

0 comments on commit bee1c41

Please sign in to comment.