Skip to content

feat: Add configuration item pricing, section ID, and product snapshots#489

Merged
OlegoO merged 23 commits intodevfrom
feat/variation-configuration-type
Mar 13, 2026
Merged

feat: Add configuration item pricing, section ID, and product snapshots#489
OlegoO merged 23 commits intodevfrom
feat/variation-configuration-type

Conversation

@alexeyshibanov
Copy link
Copy Markdown
Contributor

@alexeyshibanov alexeyshibanov commented Mar 9, 2026

Summary

Adds configuration item pricing, section identification, product snapshots, and checkout-related filtering to the Orders module — supporting the Configurable Products feature.

Changes

1. ConfigurationItem Model Enhancements

  • LineItemId — FK to parent line item (set by EF navigation property)
  • SectionId — links configuration item to its product configuration section
  • Price / SalePrice — pricing fields mapped from cart's ListPrice / SalePrice
  • ExtendedPrice — computed property (SalePrice * Quantity)
  • ProductSnapshot — serialized JSON of the catalog product at order placement time
  • ICloneable interface added for proper deep-clone support

2. Product Snapshots

  • ProductSnapshot field on both LineItem and ConfigurationItem — stores serialized CatalogProduct JSON at order placement
  • SaveProductSnapshotsAsync in CustomerOrderBuilder — batch-loads products via IItemService.GetNoCloneAsync, serializes once per unique product, assigns to all matching items
  • ProductSnapshotResponseGroupprotected virtual property using ItemInfo | ItemAssets | ItemProperties | ItemEditorialReviews (excludes Inventory, Associations, SEO, Links, Outlines to minimize snapshot size)
  • ProductSnapshotBatchSizeprotected virtual property (default 50) for batch loading
  • Feature gated by Order.ProductSnapshot.Enable setting (default: false)
  • Uses ProductJsonSerializer from CatalogModule.Core.Serialization (extracted from CatalogModule.Data to fix layer violation)

3. Cart → Order Conversion Improvements

  • SelectedForCheckout filter: only configuration items with SelectedForCheckout=true are included in orders
  • vendorIds.Any()vendorIds.Count > 0 (avoids LINQ enumerator allocation)

4. LineItem.Clone() Fix

  • Added deep-clone for ConfigurationItems collection (was missing — shared reference after clone)
  • Modernized all collection clones to use .CloneTyped().ToList() pattern

5. Entity Mapping

  • ConfigurationItemEntity — full ToModel/FromModel/Patch for all new fields
  • LineItemEntity — ProductSnapshot mapping in all three methods
  • EF migrations for PostgreSQL and SQL Server
  • MySQL ConfigurationItemEntityConfiguration for decimal precision

Dependencies

  • VirtoCommerce.CartModule.Core3.1001.0-alpha.776-variation-configuration-type
  • VirtoCommerce.CatalogModule.Core3.1001.0-alpha.2470-variation-configuration-type

Test Plan

  • Verify configuration item pricing (Price, SalePrice, ExtendedPrice) persists correctly
  • Verify ProductSnapshot is populated when setting is enabled
  • Verify ProductSnapshot is NOT populated when setting is disabled (default)
  • Verify only SelectedForCheckout=true configuration items appear in orders
  • Verify LineItem.Clone() deep-clones ConfigurationItems
  • Run existing CustomerOrderBuilder unit tests
    Artifact URL:
    https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.1002.0-pr-489-aedd.zip

Note

Medium Risk
Adds new persisted fields and EF migrations for OrderLineItem/OrderConfigurationItem, which can affect database compatibility and downstream serialization/clone behavior. Changes are localized to order models/migrations with a feature flag for snapshots.

Overview
Extends order item models to support configurable product checkout details. ConfigurationItem now includes SectionId, Price/SalePrice (+ computed ExtendedPrice), and ProductSnapshot, and LineItem adds ProductSnapshot.

Updates behavior/compatibility around cloning and settings. LineItem.Clone() now deep-clones ConfigurationItems (and uses CloneTyped() for other collections), and a new setting Order.ProductSnapshot.Enable is introduced.

Applies persistence changes and dependency bumps. Adds MySQL/PostgreSQL EF migrations (and MySQL precision configuration) for the new columns, and updates platform/cart/package references to newer 3.1004.0 versions.

Written by Cursor Bugbot for commit aeddade. This will update automatically on new commits. Configure here.

alexeyshibanov and others added 14 commits December 9, 2025 14:27
- VirtoCommerce.CartModule.Core: 3.841.0-alpha.773-variation-configuration-type
- VirtoCommerce.CatalogModule.Data: 3.913.0-alpha.2458-variation-configuration-type
…ration-type

# Conflicts:
#	src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj
#	src/VirtoCommerce.OrdersModule.Data/VirtoCommerce.OrdersModule.Data.csproj
#	src/VirtoCommerce.OrdersModule.Web/Localizations/de.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/es.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/fr.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/it.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/ja.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/pl.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/pt.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/ru.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/Localizations/zh.VirtoCommerce.Orders.json
#	src/VirtoCommerce.OrdersModule.Web/module.manifest
Update CatalogModule.Data to 3.1001.0-alpha.2468-variation-configuration-type
Update CartModule.Core to 3.1001.0-alpha.776-variation-configuration-type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexeyshibanov alexeyshibanov marked this pull request as draft March 9, 2026 16:40
Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.52
Timestamp: 09-03-2026T16:50:18

…f Data

Replace CatalogModule.Data dependency with CatalogModule.Core in OrdersModule.Data.
Use ProductJsonSerializer.Serialize instead of IndexDocumentHelper.SerializeObject
for product snapshot serialization. This removes the cross-layer dependency
(Order.Data → Catalog.Data).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.392
Timestamp: 10-03-2026T09:11:35

…figurationItems

- Use ItemInfo|ItemAssets|ItemProperties|ItemEditorialReviews instead of Full & ~Variations
  to avoid loading Inventory, Associations, SEO, Links, Outlines into snapshots
- Extract ProductSnapshotResponseGroup as protected virtual property for downstream override
- Add ICloneable to ConfigurationItem
- Deep-clone ConfigurationItems in LineItem.Clone()
- Modernize all Clone() collections to use CloneTyped().ToList()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.557
Timestamp: 10-03-2026T16:04:04

@alexeyshibanov alexeyshibanov marked this pull request as ready for review March 10, 2026 16:43
Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.699
Timestamp: 10-03-2026T19:37:22

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.445
Timestamp: 10-03-2026T20:23:24

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.85
Timestamp: 11-03-2026T11:22:54

Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.633
Timestamp: 12-03-2026T10:50:46

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

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

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.635
Timestamp: 13-03-2026T12:19:32

@OlegoO OlegoO merged commit 3d5a278 into dev Mar 13, 2026
8 checks passed
@OlegoO OlegoO deleted the feat/variation-configuration-type branch March 13, 2026 12:30
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