feat: persist ConfigurationItem.SectionName + virtual order-model construction seam#498
Open
alexeyshibanov wants to merge 7 commits into
Open
feat: persist ConfigurationItem.SectionName + virtual order-model construction seam#498alexeyshibanov wants to merge 7 commits into
alexeyshibanov wants to merge 7 commits into
Conversation
…ual seam CreateOrderLineItem / CreateOrderConfigurationItem split construction from population so a subclass can dispatch a polymorphic subtype from the source cart item; default impl preserves AbstractTypeFactory.TryCreateInstance() behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns the Cart dependency with the x-cart branch (PR 127) build, which targets cart alpha-799. The previous alpha-794 pin predated the cart dev merge to the 3.1006 line and the ICartProductService/CartProduct keying changes, causing a binary-incompatible pairing with x-cart in auto-tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-sectionname # Conflicts: # src/VirtoCommerce.OrdersModule.Core/VirtoCommerce.OrdersModule.Core.csproj # src/VirtoCommerce.OrdersModule.Web/module.manifest
…ruction seam Rewrite the CreateOrderModel seam-override tests to dispatch distinct order LineItem/ConfigurationItem subtypes by a source cart property (ProductType / SectionName), asserting different values yield different CLR types in the order. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
artem-dudarev
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Persist the configuration section name on the order
ConfigurationItem, and add a construction seam toCustomerOrderBuilderso subclasses can dispatch polymorphic order subtypes during cart-to-order conversion.ConfigurationItem.SectionName
SectionNametoConfigurationItem(Core) andConfigurationItemEntity(Data), wired throughToModel/FromModel/Patch.SectionNamecolumn migration for PostgreSQL, SQL Server and MySQL.SectionNamefrom the source cart configuration item when an order is built from a cart — symmetric with the CartModule change.Virtual order-model construction seam
LineItem/ConfigurationIteminstantiation inCustomerOrderBuilderintoCreateOrderModel(...)protected virtualmethods (default =AbstractTypeFactory<T>.TryCreateInstance()).Depends on
VirtoCommerce.CartModule(sibling change addingConfigurationItem.SectionName, which the cart-to-order propagation reads). The package reference currently points at an alpha; replace it with the released version before merge.References
QA-test:
Jira-link:
Artifact URL:
https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.1011.0-pr-498-5422.zip
Note
Medium Risk
Adds a database migration and changes cart-to-order mapping; risk is moderate but mitigated by a nullable column and backward-compatible default factory behavior.
Overview
Adds
SectionNameto orderConfigurationItemso configured line items can keep the human-readable section label (alongsideSectionId) after checkout. The property is mapped on the persistence entity and carried throughToModel/FromModel/Patch, with nullableSectionNamecolumns onOrderConfigurationItemvia new EF migrations (MySQL and PostgreSQL in this diff; SQL Server per the PR scope).CustomerOrderBuildernow copiesSectionNamefrom the cart configuration item when building an order.CustomerOrderBuilderalso introducesprotected virtual CreateOrderModel(...)forLineItemandConfigurationItem, defaulting toAbstractTypeFactory, so subclasses can instantiate polymorphic order types during cart conversion instead of always using the registered base type.VirtoCommerce.CartModule.Coreis temporarily referenced from an alpha build that exposes cartSectionName; swap to a released package before merge.Reviewed by Cursor Bugbot for commit 5422b56. Bugbot is set up for automated code reviews on this repo. Configure here.