Skip to content

Long variation ID - #564

Open
ChesterEcwid wants to merge 5 commits into
masterfrom
long-variation-id
Open

Long variation ID#564
ChesterEcwid wants to merge 5 commits into
masterfrom
long-variation-id

Conversation

@ChesterEcwid

Copy link
Copy Markdown
Contributor

This pull request updates several data models and related test utilities to use Long instead of Int for various identifier fields, particularly for combination and variation IDs. This change ensures compatibility with larger identifier values and improves consistency across the codebase. The update also introduces new random ID generation functions for Long values in the test utilities.

Model updates for identifier types:

  • Changed the type of combinationId from Int? to Long? in the following data classes: OrderForCalculate.OrderItem, CalculateOrderDetailsResult.OrderItem, FetchedCart.OrderItem, UpdatedOrder.OrderItem, and FetchedOrder.OrderItem (src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt, [1]; src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt, [2]; src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt, [3]; src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt, [4]; src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt, [5]
  • Changed the type of defaultCombinationId from Int? to Long? in FetchedProduct (src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt, src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.ktL123-R123)
  • Changed the type of id from Int to Long in FetchedVariation (src/main/kotlin/com/ecwid/apiclient/v3/dto/variation/result/FetchedVariation.kt, src/main/kotlin/com/ecwid/apiclient/v3/dto/variation/result/FetchedVariation.ktL12-R12)

Test utility and test data updates:

  • Added randomLongId() and randomLong() helper functions for generating random Long IDs in tests (src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt, [1] [2]
  • Updated test data generation to use randomLongId() for fields now typed as Long (src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt, [1] [2]; src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt, [3]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Moderate findings remain in the custom-app combination ID and variation-ID DTO surfaces.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates combination and variation identifiers from Int to Long, including related test utilities and fixtures.

Changes:

  • Migrates combination and variation IDs to Long.
  • Adds Long-based random ID helpers.
  • Updates affected test data and DTOs.
File summaries
File Change Review
src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt Adds Long random ID helpers.
src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt Uses Long combination IDs.
src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt Updates cart fixtures for Long IDs.
src/main/kotlin/com/ecwid/apiclient/v3/dto/variation/result/FetchedVariation.kt Changes variation IDs to Long. Moderate: variation request DTOs and CreateProductVariationResult.id remain Int (3 votes).
src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt Changes default combination IDs to Long. Moderate: custom-app default combination ID remains Int? (3 votes).
src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt Changes combination IDs to Long.
src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt Changes combination IDs to Long.
src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt Changes combination IDs to Long.
src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt Changes combination IDs to Long.
src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt Changes combination IDs to Long.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@gutorovas
gutorovas self-requested a review September 14, 2026 17:54
@ChesterEcwid ChesterEcwid self-assigned this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants