Skip to content

Commit

Permalink
ECWID-145233 Change IDs type from int to long (bigint) in node: Categ…
Browse files Browse the repository at this point in the history
…ory entity, id field.

Modified the corresponding classes to make the category id type to Long.
  • Loading branch information
VHripsime committed Aug 12, 2024
1 parent c2d92fc commit a43b522
Show file tree
Hide file tree
Showing 32 changed files with 57 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ data class OrderForCalculate(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ data class CalculateOrderDetailsResult(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ data class FetchedCart(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0,
val productIds: List<Int> = emptyList()
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createPostRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int>? = null,
val categoryIds: List<Long>? = null,
val hiddenCategories: Boolean? = null,
val returnProductIds: Boolean? = null,
val baseUrl: String? = null,
Expand All @@ -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 = 0) : ParentCategory()
}

private fun toParams(): Map<String, String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createDeleteRequest(
pathSegments = listOf(
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
import com.ecwid.apiclient.v3.responsefields.ResponseFields

data class CategoryDetailsRequest(
val categoryId: Int = 0,
val categoryId: Long = 0,
val baseUrl: String? = null,
val cleanUrls: Boolean? = null,
val slugsWithoutIds: 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.httptransport.HttpBody
import com.ecwid.apiclient.v3.impl.RequestInfo

data class CategoryImageAsyncUploadRequest(
val categoryId: Int = 0,
val categoryId: Long = 0,
val asyncPictureData: AsyncPictureData = AsyncPictureData()

) : ApiRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createDeleteRequest(
pathSegments = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0,
val fileData: UploadFileData = UploadFileData.ExternalUrlData("")
) : ApiRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0,
val updatedCategory: UpdatedCategory = UpdatedCategory()
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createPutRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0,
val productIds: List<Int> = emptyList()
) : ApiRequest {
override fun toRequestInfo() = RequestInfo.createPostRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0
) : ApiResultDTO
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0,
val parentId: Long? = null,
val orderBy: Int? = null,
val name: String = "",
val isSampleCategory: Boolean? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data class UpdatedCoupon(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = null
)

override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCoupon::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data class FetchedCoupon(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = null
)

override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCoupon::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OrderItemOption>? = null,
val dimensions: ProductDimensions? = null,
val productPrice: Double? = null,
val categoryIds: List<Int>? = null,
val categoryIds: List<Long>? = null,
val categories: List<Category>? = null,
val quantity: Int? = null,
val unlimited: Boolean? = null,
Expand Down Expand Up @@ -91,7 +91,7 @@ data class CustomAppRequest(
val originalImage: PictureInfo? = null,
val borderInfo: BorderInfo? = null,
val galleryImages: List<GalleryImage>? = null,
val defaultCategoryId: Int? = null,
val defaultCategoryId: Long? = null,
val seoTitle: String? = null,
val seoDescription: String? = null,
val favorites: FavoritesInfo? = null,
Expand All @@ -104,7 +104,7 @@ data class CustomAppRequest(
)

data class Category(
val id: Int? = null,
val id: Long? = null,
val enabled: Boolean? = null
)

Expand Down Expand Up @@ -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
)

Expand Down Expand Up @@ -241,7 +241,7 @@ data class CustomAppRequest(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = null
)

data class HandlingFeeInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ data class UpdatedOrder(

// data class DiscountCouponCatalogLimit(
// val products: List<Int>? = null,
// val categories: List<Int>? = null
// val categories: List<Long>? = null
// )

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ data class FetchedOrder(

data class DiscountCouponCatalogLimit(
val products: List<Int>? = null,
val categories: List<Int>? = null
val categories: List<Long>? = 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sealed class ProductsSearchRequest : ApiRequest {
val externalReferenceId: String? = null,
val priceFrom: Double? = null,
val priceTo: Double? = null,
val categories: List<Int>? = null,
val categories: List<Long>? = null,
val includeProductsFromSubcategories: Boolean? = null,
val sortBy: SortOrder? = null,
val createdFrom: Date? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ data class UpdatedProduct(
val unlimited: Boolean? = null,
val warningLimit: Int? = null,

val categoryIds: List<Int>? = null,
val defaultCategoryId: Int? = null,
val categoryIds: List<Long>? = null,
val defaultCategoryId: Long? = null,
val showOnFrontpage: Int? = null,

val price: Double? = null,
Expand Down Expand Up @@ -65,7 +65,7 @@ data class UpdatedProduct(
val customPriceTiers: List<CustomPriceTier>? = null,
val priceDefaultTier: Int? = null,
val subscriptionSettings: SubscriptionSettings? = null,
val googleProductCategory: NullableUpdatedValue<Int>? = null,
val googleProductCategory: NullableUpdatedValue<Long>? = null,
val productCondition: ProductCondition? = null,
val externalReferenceId: String? = null,
val customsHsTariffCode: String? = null,
Expand Down Expand Up @@ -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
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ data class FetchedProduct(
val inStock: Boolean? = null,
val warningLimit: Int? = null,

val categoryIds: List<Int>? = null,
val categoryIds: List<Long>? = null,
val categories: List<CategoryInfo>? = null,
val defaultCategoryId: Int? = null,
val defaultCategoryId: Long? = null,
val showOnFrontpage: Int? = null,

val price: Double? = null,
Expand Down Expand Up @@ -131,7 +131,7 @@ data class FetchedProduct(
val customPriceTiers: List<CustomPriceTier>? = null,
val priceDefaultTier: Int? = null,
val subscriptionSettings: SubscriptionSettings? = null,
val googleProductCategory: Int? = null,
val googleProductCategory: Long? = null,
val googleProductCategoryName: String? = null,
val productCondition: ProductCondition = ProductCondition.NEW,
val externalReferenceId: String? = null,
Expand Down Expand Up @@ -190,7 +190,7 @@ data class FetchedProduct(
)

data class CategoryInfo(
val id: Int = 0,
val id: Long = 0,
val enabled: Boolean = true
)

Expand Down Expand Up @@ -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
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ data class UpdatedStoreProfile(
val fbPixelId: String? = null,
val googleAnalyticsId: String? = null,
val googleEventId: String? = null,
val googleProductCategory: Int? = null,
val googleProductCategory: Long? = null,
val googleRemarketingEnabled: Boolean? = null,
val googleTagId: String? = null,
val hideOutOfStockProductsInStorefront: Boolean? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ data class FetchedStoreProfile(
val fbPixelId: String? = null,
val googleAnalyticsId: String? = null,
val googleEventId: String? = null,
val googleProductCategory: Int? = null,
val googleProductCategory: Long? = null,
val googleProductCategoryName: String? = null,
val googleRemarketingEnabled: Boolean? = null,
val googleTagId: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit a43b522

Please sign in to comment.