Created
August 15, 2025 21:03
-
-
Save mitchtabian/e0e47cdde8e74fcfb27a052627a9bce0 to your computer and use it in GitHub Desktop.
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
override fun create( | |
workingItem: WorkingItem, | |
cartId: String?, | |
transactionInfo: TransactionInfo | |
): ItemConfigurationFlowHandlerReadWrite { | |
check(!workingItem.isItemPartOfCombo) { | |
"Use 'createForItemInCombo' for items that are part of a combo." | |
} | |
workingItem.lockConfiguration = transactionInfo.isItemLocked | |
workingItem.selectedVariation = getDefaultVariationIfNeeded( | |
variations = workingItem.sellableVariations, | |
skipConfigureItemDetailScreenSetting = workingItem.skipConfigureItemDetailScreenSetting, | |
currentSelectedVariation = workingItem.selectedVariation, | |
checkDefaultVariationAvailability = features.latest(SHOW_ITEM_COUNT_ON_TILES).value, | |
) | |
// Only set seating, course or quantity if we are not editing an item already in the cart. | |
if (cartId == null) { | |
workingItem.maybeOverrideQuantity() | |
workingItem.maybeSetSeating() | |
workingItem.maybeSelectCourse( | |
isStraightFire = workingItem.isStraightFireItem, | |
sortType = cartLayoutRepository.selectedCartSortType | |
) | |
} | |
val cartItem = workingItem.finish() | |
val (index, _) = transaction.findItemAndIndex(cartId!!) | |
val configureItemState = ConfigureOrderItemState.loadedOrderItemState( | |
voidCompSettings, | |
configureItemHost, | |
currencyCode, | |
index, | |
orderItemBundleKey, | |
cartItem | |
) | |
return createV2( | |
configureItemState = configureItemState, | |
transactionInfo = transactionInfo, | |
shouldSkipVariationStep = false, | |
priceAdjustmentAmountsForCombo = emptyMap(), | |
allowSeatChangesPostFire = itemConfigFlowFlags.canReassignSeatsPostFire, | |
cartIdForItemWithAppliedCombo = null, | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment