diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt index a9d069263..ba2410bcf 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt @@ -67,14 +67,14 @@ data class OrderForCalculate( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) data class OrderItem( val id: Int? = null, val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt index 6c1636130..8edeb0006 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt @@ -126,14 +126,14 @@ data class CalculateOrderDetailsResult( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) data class OrderItem( val id: Int? = null, val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt index 296cdc32e..8e9a96540 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt @@ -120,14 +120,14 @@ data class FetchedCart( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) data class OrderItem( val id: Int? = null, val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/AssignProductsToCategoryRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/AssignProductsToCategoryRequest.kt index 1efb8c7f4..7c7e6038f 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/AssignProductsToCategoryRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/AssignProductsToCategoryRequest.kt @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.httptransport.HttpBody import com.ecwid.apiclient.v3.impl.RequestInfo data class AssignProductsToCategoryRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val productIds: List = emptyList() ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createPostRequest( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoriesSearchRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoriesSearchRequest.kt index 7dc93c24f..4c7f2fa61 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoriesSearchRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoriesSearchRequest.kt @@ -8,7 +8,7 @@ import com.ecwid.apiclient.v3.responsefields.ResponseFields data class CategoriesSearchRequest( val keyword: String? = null, val parentCategoryId: ParentCategory = ParentCategory.Any, - val categoryIds: List? = null, + val categoryIds: List? = null, val hiddenCategories: Boolean? = null, val returnProductIds: Boolean? = null, val baseUrl: String? = null, @@ -31,7 +31,7 @@ data class CategoriesSearchRequest( sealed class ParentCategory { object Any : ParentCategory() object Root : ParentCategory() - data class WithId(val id: Int = 0) : ParentCategory() + data class WithId(val id: Long = 0L) : ParentCategory() } private fun toParams(): Map { diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDeleteRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDeleteRequest.kt index 51d48a3bc..5e5a4148b 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDeleteRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDeleteRequest.kt @@ -4,7 +4,7 @@ import com.ecwid.apiclient.v3.dto.ApiRequest import com.ecwid.apiclient.v3.impl.RequestInfo data class CategoryDeleteRequest( - val categoryId: Int = 0 + val categoryId: Long = 0L ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createDeleteRequest( pathSegments = listOf( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDetailsRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDetailsRequest.kt index e8cfc05f2..f316ca757 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDetailsRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryDetailsRequest.kt @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.impl.RequestInfo import com.ecwid.apiclient.v3.responsefields.ResponseFields data class CategoryDetailsRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val baseUrl: String? = null, val cleanUrls: Boolean? = null, val slugsWithoutIds: Boolean? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageAsyncUploadRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageAsyncUploadRequest.kt index de4bb1354..6d4f9b248 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageAsyncUploadRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageAsyncUploadRequest.kt @@ -6,7 +6,7 @@ import com.ecwid.apiclient.v3.httptransport.HttpBody import com.ecwid.apiclient.v3.impl.RequestInfo data class CategoryImageAsyncUploadRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val asyncPictureData: AsyncPictureData = AsyncPictureData() ) : ApiRequest { diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageDeleteRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageDeleteRequest.kt index 0c858433b..bbf71a4c4 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageDeleteRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageDeleteRequest.kt @@ -4,7 +4,7 @@ import com.ecwid.apiclient.v3.dto.ApiRequest import com.ecwid.apiclient.v3.impl.RequestInfo data class CategoryImageDeleteRequest( - val categoryId: Int = 0 + val categoryId: Long = 0L ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createDeleteRequest( pathSegments = listOf( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageUploadRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageUploadRequest.kt index 01af32598..9427f68a7 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageUploadRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryImageUploadRequest.kt @@ -7,7 +7,7 @@ import com.ecwid.apiclient.v3.impl.MIME_TYPE_OCTET_STREAM import com.ecwid.apiclient.v3.impl.RequestInfo data class CategoryImageUploadRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val fileData: UploadFileData = UploadFileData.ExternalUrlData("") ) : ApiRequest { diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryUpdateRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryUpdateRequest.kt index 099c278eb..94e6418f9 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryUpdateRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/CategoryUpdateRequest.kt @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.httptransport.HttpBody import com.ecwid.apiclient.v3.impl.RequestInfo data class CategoryUpdateRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val updatedCategory: UpdatedCategory = UpdatedCategory() ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createPutRequest( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UnassignProductsFromCategoryRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UnassignProductsFromCategoryRequest.kt index 62f92ff7c..4d3fef68d 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UnassignProductsFromCategoryRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UnassignProductsFromCategoryRequest.kt @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.httptransport.HttpBody import com.ecwid.apiclient.v3.impl.RequestInfo data class UnassignProductsFromCategoryRequest( - val categoryId: Int = 0, + val categoryId: Long = 0L, val productIds: List = emptyList() ) : ApiRequest { override fun toRequestInfo() = RequestInfo.createPostRequest( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt index 4a3839955..1ce888d3a 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt @@ -7,7 +7,7 @@ import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap import com.ecwid.apiclient.v3.dto.common.UpdatedAlt data class UpdatedCategory( - val parentId: Int? = null, + val parentId: Long? = null, val orderBy: Int? = null, val name: String? = null, val isSampleCategory: Boolean? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/CategoryCreateResult.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/CategoryCreateResult.kt index 5da3a0b61..39412101d 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/CategoryCreateResult.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/CategoryCreateResult.kt @@ -3,5 +3,5 @@ package com.ecwid.apiclient.v3.dto.category.result import com.ecwid.apiclient.v3.dto.common.ApiResultDTO data class CategoryCreateResult( - val id: Int = 0 + val id: Long = 0L ) : ApiResultDTO diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt index 0fb605b07..c7e5735a3 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt @@ -9,8 +9,8 @@ import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap import com.ecwid.apiclient.v3.dto.common.PictureInfo data class FetchedCategory( - val id: Int = 0, - val parentId: Int? = null, + val id: Long = 0L, + val parentId: Long? = null, val orderBy: Int? = null, val name: String = "", val isSampleCategory: Boolean? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/request/UpdatedCoupon.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/request/UpdatedCoupon.kt index 3c94705fd..65c27f4ad 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/request/UpdatedCoupon.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/request/UpdatedCoupon.kt @@ -27,7 +27,7 @@ data class UpdatedCoupon( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCoupon::class) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/result/FetchedCoupon.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/result/FetchedCoupon.kt index f3a4d8765..e48f4fdd4 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/result/FetchedCoupon.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/coupon/result/FetchedCoupon.kt @@ -30,7 +30,7 @@ data class FetchedCoupon( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCoupon::class) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt index 56f692502..b0790463d 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt @@ -56,12 +56,12 @@ data class CustomAppRequest( val productId: Int? = null, val combinationId: Long? = null, val name: String? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val sku: String? = null, val selectedOptions: List? = null, val dimensions: ProductDimensions? = null, val productPrice: Double? = null, - val categoryIds: List? = null, + val categoryIds: List? = null, val categories: List? = null, val quantity: Int? = null, val unlimited: Boolean? = null, @@ -91,7 +91,7 @@ data class CustomAppRequest( val originalImage: PictureInfo? = null, val borderInfo: BorderInfo? = null, val galleryImages: List? = null, - val defaultCategoryId: Int? = null, + val defaultCategoryId: Long? = null, val seoTitle: String? = null, val seoDescription: String? = null, val favorites: FavoritesInfo? = null, @@ -104,7 +104,7 @@ data class CustomAppRequest( ) data class Category( - val id: Int? = null, + val id: Long? = null, val enabled: Boolean? = null ) @@ -155,7 +155,7 @@ data class CustomAppRequest( data class RelatedCategory( val enabled: Boolean? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val productCount: Int? = null ) @@ -241,7 +241,7 @@ data class CustomAppRequest( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) data class HandlingFeeInfo( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt index cdca867a1..931fbeb98 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt @@ -137,7 +137,7 @@ data class UpdatedOrder( data class OrderItem( val id: Long? = null, val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, 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 db85e017c..d428d15ad 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 @@ -158,14 +158,14 @@ data class FetchedOrder( data class DiscountCouponCatalogLimit( val products: List? = null, - val categories: List? = null + val categories: List? = null ) data class OrderItem( val id: Long? = null, // TODO Figure out how to test val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/ProductsSearchRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/ProductsSearchRequest.kt index 63303036d..e12875d31 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/ProductsSearchRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/ProductsSearchRequest.kt @@ -15,7 +15,7 @@ sealed class ProductsSearchRequest : ApiRequest { val externalReferenceId: String? = null, val priceFrom: Double? = null, val priceTo: Double? = null, - val categories: List? = null, + val categories: List? = null, val includeProductsFromSubcategories: Boolean? = null, val sortBy: SortOrder? = null, val createdFrom: Date? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt index af9c01e87..2b6e1df84 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt @@ -21,8 +21,8 @@ data class UpdatedProduct( val unlimited: Boolean? = null, val warningLimit: Int? = null, - val categoryIds: List? = null, - val defaultCategoryId: Int? = null, + val categoryIds: List? = null, + val defaultCategoryId: Long? = null, val showOnFrontpage: Int? = null, val price: Double? = null, @@ -349,7 +349,7 @@ data class UpdatedProduct( data class RelatedCategory( val enabled: Boolean? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val productCount: Int? = null ) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt index fd03d5507..7e91eb08f 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt @@ -32,9 +32,9 @@ data class FetchedProduct( val inStock: Boolean? = null, val warningLimit: Int? = null, - val categoryIds: List? = null, + val categoryIds: List? = null, val categories: List? = null, - val defaultCategoryId: Int? = null, + val defaultCategoryId: Long? = null, val showOnFrontpage: Int? = null, val price: Double? = null, @@ -190,7 +190,7 @@ data class FetchedProduct( ) data class CategoryInfo( - val id: Int = 0, + val id: Long = 0L, val enabled: Boolean = true ) @@ -302,7 +302,7 @@ data class FetchedProduct( data class RelatedCategory( val enabled: Boolean? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val productCount: Int? = null ) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt index 8149503b4..768472282 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt @@ -102,7 +102,7 @@ data class FetchedSubscription( val id: Int? = null, val productId: Int? = null, - val categoryId: Int? = null, + val categoryId: Long? = null, val price: Double? = null, val productPrice: Double? = null, 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 71f890156..a3b952216 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -472,7 +472,7 @@ class CartsTest : BaseEntityTest() { return OrderForCalculate.OrderItem( id = randomId(), productId = randomId(), - categoryId = randomId(), + categoryId = randomLongId(), price = 22.2, productPrice = 33.3, shipping = 44.4, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt index ad1a023c7..debe9af90 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt @@ -504,7 +504,7 @@ class CategoriesTest : BaseEntityTest() { } private fun assertCategory( - desiredId: Int, + desiredId: Long, desiredProductIds: List?, categoriesSearchResult: CategoriesSearchResult ) { @@ -569,7 +569,7 @@ private fun generateTestProduct( } private fun generateTestCategory( - parentCategoryId: Int? = null, + parentCategoryId: Long? = null, productIds: List = listOf(), enabled: Boolean = randomBoolean() ): UpdatedCategory { diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CouponsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CouponsTest.kt index 336be1b9f..fd46edb50 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CouponsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CouponsTest.kt @@ -214,7 +214,7 @@ class CouponsTest : BaseEntityTest() { return apiClient.createCategory(categoryCreateRequest) } - private fun generateTestCouponForCreate(existingProductId: Int, existingCategoryId: Int): UpdatedCoupon { + private fun generateTestCouponForCreate(existingProductId: Int, existingCategoryId: Long): UpdatedCoupon { val launchDate = randomDateFrom(Date()) val expirationDate = randomDateFrom(launchDate) @@ -240,7 +240,7 @@ class CouponsTest : BaseEntityTest() { ) } - private fun generateTestCouponForUpdate(existingProductId: Int, existingCategoryId: Int): UpdatedCoupon { + private fun generateTestCouponForUpdate(existingProductId: Int, existingCategoryId: Long): UpdatedCoupon { val launchDate = randomDateFrom(Date()) val expirationDate = randomDateFrom(launchDate) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt index d97f608db..23ddd61af 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt @@ -1334,7 +1334,7 @@ class ProductsTest : BaseEntityTest() { } } -private fun generateTestCategory(parentId: Int? = null): UpdatedCategory { +private fun generateTestCategory(parentId: Long? = null): UpdatedCategory { return UpdatedCategory( name = "Category " + randomAlphanumeric(8), description = "Description " + randomAlphanumeric(16), @@ -1343,7 +1343,7 @@ private fun generateTestCategory(parentId: Int? = null): UpdatedCategory { ) } -private fun generateTestProduct(categoryIds: List = listOf(), discountsAllowed: Boolean = true): UpdatedProduct { +private fun generateTestProduct(categoryIds: List = listOf(), discountsAllowed: Boolean = true): UpdatedProduct { val basePrice = randomPrice() val enName = "Product " + randomAlphanumeric(8) val enDescription = "Description " + randomAlphanumeric(16) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/responsefields/ResponseFieldsBuilderUnitTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/responsefields/ResponseFieldsBuilderUnitTest.kt index de9a9d15b..bf2c3d5ed 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/responsefields/ResponseFieldsBuilderUnitTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/responsefields/ResponseFieldsBuilderUnitTest.kt @@ -115,7 +115,7 @@ private data class TestProduct( val taxes: List, val options: List?, val checkboxes: List?, - val categoryIds: ArrayList, + val categoryIds: ArrayList, val generic1: Simple1Generic, val generic2: Simple2Generic, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt index f1ba2b1d6..fa791983d 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt @@ -192,7 +192,7 @@ private fun generateTestCustomDiscountInfo() = UpdatedOrder.DiscountInfo( private fun generateTestOrderItem() = UpdatedOrder.OrderItem( // var id: Int? = null, // TODO readonly // productId = com.ecwid.api.v3.randomId(), // TODO need to pass existing product id - categoryId = randomId(), + categoryId = randomLongId(), price = randomPrice(), productPrice = randomPrice(), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt b/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt index c5ea6fd11..df1b45e2c 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt @@ -18,6 +18,8 @@ internal fun randomByte() = Random.nextBytes(1)[0] + 128 internal fun randomId() = randomInt(10000, 1000000) +internal fun randomLongId() = randomLong(10000L, 1000000L) + internal fun randomIndex(collection: Collection) = randomInt(0, collection.size - 1) internal fun randomPrice() = Random @@ -81,6 +83,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 {