-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Issue: ready for confirmationReported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Description
This issue is automatically created based on existing pull request: #40395: Move SetGuestEmailOnCart logic in a separated class
Description (*)
This PR refactors the setGuestEmailOnCart GraphQL mutation by extracting business logic from the resolver into a dedicated model class, improving code organization and testability.
Changes
- New Model Class: Created
Magento\QuoteGraphQl\Model\Cart\SetGuestEmailOnCartto handle the business logic of setting guest email on cart - Refactored Resolver: Updated
Magento\QuoteGraphQl\Model\Resolver\SetGuestEmailOnCartto delegate business logic to the new model class - Unit Tests: Added comprehensive unit test coverage for the new model class (
SetGuestEmailOnCartTest)
Motivation
The objective of this modification is to be able to more easily add logic (such as a custom control) before saving the email.
Today, the only solution is to make a beforeExecute plugin on the SetShippingMethodsOnCart class without benefiting from the controls already in place.
Manual testing scenarios (*)
Execute the graphQL setGuestEmailOnCart mutation, it must not have an error.
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- All automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Issue: ready for confirmationReported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Ready for Confirmation