Skip to content

Commit bf1ed33

Browse files
authored
chore: improve description of findOrCreateCustomerStep (medusajs#12840)
1 parent 2005188 commit bf1ed33

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/core/core-flows/src/cart/steps/find-or-create-customer.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ interface StepCompensateInput {
3838

3939
export const findOrCreateCustomerStepId = "find-or-create-customer"
4040
/**
41-
* This step either finds a customer matching the specified ID, or finds / create a customer
42-
* matching the specified email. If both ID and email are provided, ID takes precedence.
43-
* If the customer is a guest, the email is updated to the provided email.
41+
* This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email.
42+
*
43+
* The step creates a new customer either if:
44+
*
45+
* - No customer is found with the provided ID and email;
46+
* - Or if it found the customer by ID but their email does not match the email in the input.
47+
*
48+
* The step returns the details of the customer found or created, along with their email.
4449
*/
4550
export const findOrCreateCustomerStep = createStep(
4651
findOrCreateCustomerStepId,

0 commit comments

Comments
 (0)