Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ data class OrderForCalculate(
val giftCard: Boolean? = null,

val selectedOptions: List<OrderItemOption>? = null,
val combinationId: Int? = null,
val combinationId: Long? = null,
val taxes: List<OrderItemTax>? = null,
val files: List<OrderItemProductFile>? = null,
val dimensions: ProductDimensions? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ data class CalculateOrderDetailsResult(
val giftCard: Boolean? = null,

val selectedOptions: List<OrderItemOption>? = null,
val combinationId: Int? = null,
val combinationId: Long? = null,
val taxes: List<OrderItemTax>? = null,
val files: List<OrderItemProductFile>? = null,
val dimensions: ProductDimensions? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ data class FetchedCart(
val giftCard: Boolean? = null,

val selectedOptions: List<OrderItemOption>? = null,
val combinationId: Int? = null,
val combinationId: Long? = null,
val taxes: List<OrderItemTax>? = null,
val files: List<OrderItemProductFile>? = null,
val dimensions: ProductDimensions? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ data class CustomAppRequest(
val updated: String? = null,
val createTimestamp: Long? = null,
val updateTimestamp: Long? = null,
val defaultCombinationId: Int? = null,
val defaultCombinationId: Long? = null,
val imageUrl: String? = null,
val thumbnailUrl: String? = null,
val smallThumbnailUrl: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ data class UpdatedOrder(
val giftCard: Boolean? = null,

val selectedOptions: List<OrderItemSelectedOption>? = null,
val combinationId: Int? = null,
val combinationId: Long? = null,
val taxes: List<OrderItemTax>? = null,
val dimensions: ProductDimensions? = null,
val discountsAllowed: Boolean? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ data class FetchedOrder(
val subscriptionId: Long? = null,

val selectedOptions: List<OrderItemSelectedOption>? = null,
val combinationId: Int? = null,
val combinationId: Long? = null,
val files: List<OrderItemProductFile>? = null,
val taxable: Boolean? = null,
val taxes: List<OrderItemTax>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ data class FetchedProduct(
val files: List<ProductFile>? = null,
val favorites: FavoritesStats? = null, // TODO Figure out how to test

val defaultCombinationId: Int? = null, // TODO implement combinations support
val defaultCombinationId: Long? = null, // TODO implement combinations support
Comment thread
ChesterEcwid marked this conversation as resolved.
val combinations: List<FetchedVariation>? = null, // TODO implement combinations support
val isGiftCard: Boolean? = null, // TODO from ECWID-67826: this flag is read-only. API for creating gift cards in the plans (BACKLOG-4157)
val discountsAllowed: Boolean? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class AdjustVariationInventoryRequest(
val productId: Int = 0,
val variationId: Int = 0,
val variationId: Long = 0,
val checkLowStockNotification: Boolean = false,
val quantityDelta: Int = 0
) : ApiRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class DeleteProductVariationRequest(
val productId: Int = 0,
val variationId: Int = 0
val variationId: Long = 0
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createDeleteRequest(
pathSegments = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.ecwid.apiclient.v3.responsefields.ResponseFields

data class ProductVariationDetailsRequest(
val productId: Int = 0,
val variationId: Int = 0,
val variationId: Long = 0,
val responseFields: ResponseFields = ResponseFields.All,
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createGetRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class ProductVariationImageAsyncUploadRequest(
val productId: Int = 0,
val variationId: Int = 0,
val variationId: Long = 0,
val asyncPictureData: AsyncPictureData = AsyncPictureData()
) : ApiRequest {
override fun toRequestInfo(): RequestInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class ProductVariationImageDeleteRequest(
val productId: Int = 0,
val variationId: Int = 0
val variationId: Long = 0
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createDeleteRequest(
pathSegments = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class ProductVariationImageUploadRequest(
val productId: Int = 0,
val variationId: Int = 0,
val variationId: Long = 0,
val fileData: UploadFileData = UploadFileData.ExternalUrlData("")
) : ApiRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo

data class UpdateProductVariationRequest(
val productId: Int = 0,
val variationId: Int = 0,
val variationId: Long = 0,
val checkLowStockNotification: Boolean = false,
val variation: UpdatedVariation = UpdatedVariation()
) : ApiRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package com.ecwid.apiclient.v3.dto.variation.result
import com.ecwid.apiclient.v3.dto.common.ApiResultDTO

data class CreateProductVariationResult(
val id: Int = 0
val id: Long = 0
) : ApiResultDTO
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.ecwid.apiclient.v3.dto.producttype.enums.AttributeType
import com.ecwid.apiclient.v3.dto.variation.request.UpdatedVariation

data class FetchedVariation(
val id: Int = 0,
val id: Long = 0,
Comment thread
ChesterEcwid marked this conversation as resolved.
val sku: String? = null,

val combinationNumber: Int = 0,
Expand Down
4 changes: 3 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ class CartsTest : BaseEntityTest() {

private fun generateTestItem(): OrderForCalculate.OrderItem {
return OrderForCalculate.OrderItem(
// TODO change to randomLongId() after API server changes
id = randomId().toLong(),
productId = randomId(),
categoryId = randomId(),
Expand Down Expand Up @@ -506,7 +507,8 @@ class CartsTest : BaseEntityTest() {
generateDateSelectedOption(),
generateFilesSelectedOption()
),
combinationId = randomId(),
// TODO change to randomLongId() after API server changes
combinationId = randomId().toLong(),
taxes = listOf(
generateTestOrderItemTax()
),
Expand Down
3 changes: 2 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 @@ -253,7 +253,8 @@ private fun generateTestOrderItem() = UpdatedOrder.OrderItem(
generateDateSelectedOption(),
generateFilesSelectedOption()
),
combinationId = randomId(),
// TODO change to randomLongId() after API server changes
combinationId = randomId().toLong(),
taxes = listOf(
generateTestOrderItemTax(),
generateTestOrderItemTax()
Expand Down
4 changes: 4 additions & 0 deletions src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ internal fun randomByte() = Random.nextBytes(1)[0] + 128

internal fun randomId() = randomInt(10000, 1000000)

internal fun randomLongId() = randomLong(100000000000, 10000000000000)

internal fun <T> randomIndex(collection: Collection<T>) = randomInt(0, collection.size - 1)

internal fun randomPrice() = Random
Expand Down Expand Up @@ -89,6 +91,8 @@ internal fun randomFileName(prefix: String, extension: String) = "$prefix-${Rand

internal fun randomInt(min: Int, max: Int) = Random.nextInt(min, max)

internal fun randomLong(min: Long, max: Long) = Random.nextLong(min, max)

internal fun randomDouble(min: Double, max: Double) = Random.nextDouble(min, max)

private fun Double.roundDouble(): Double {
Expand Down
Loading