From bf1ed331be4ee686ca944ef6e76a9f3e5c2d37b7 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 26 Jun 2025 19:02:52 +0300 Subject: [PATCH] chore: improve description of findOrCreateCustomerStep (#12840) --- .../src/cart/steps/find-or-create-customer.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/core-flows/src/cart/steps/find-or-create-customer.ts b/packages/core/core-flows/src/cart/steps/find-or-create-customer.ts index ff7462456f..b6ed2100ec 100644 --- a/packages/core/core-flows/src/cart/steps/find-or-create-customer.ts +++ b/packages/core/core-flows/src/cart/steps/find-or-create-customer.ts @@ -38,9 +38,14 @@ interface StepCompensateInput { export const findOrCreateCustomerStepId = "find-or-create-customer" /** - * This step either finds a customer matching the specified ID, or finds / create a customer - * matching the specified email. If both ID and email are provided, ID takes precedence. - * If the customer is a guest, the email is updated to the provided email. + * This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email. + * + * The step creates a new customer either if: + * + * - No customer is found with the provided ID and email; + * - Or if it found the customer by ID but their email does not match the email in the input. + * + * The step returns the details of the customer found or created, along with their email. */ export const findOrCreateCustomerStep = createStep( findOrCreateCustomerStepId,