Releases: i-love-flamingo/flamingo-commerce
New GraphQL Place Order Process
The release mainly improves the checkout experience when using the GraphQL interfaces, by introducing a new place order process which is backed by a state machine. This encapsulates all critical parts of the checkout into separate states which are easier to test and allow us to rollback each process part seperatly.
dependencies
- Update flamingo core to v3.2.0
- Update dingo to v0.2.9
tests
- Added GraphQL integration tests for new Place Order Process, run manually with
make integrationtest
- To run the GraphQL Demo project use
make run-integrationtest-demo-project
- To regenerate the GraphQL files used by the integration tests / demo project use
make generate-integrationtest-graphql
cart
-
Add
additionalData
to theAddRequest
used during add to cart- Breaking: Update helper/builder function
BuildAddRequest
- Breaking: Update helper/builder function
-
Breaking: Change to
EventPublisher
interface,PublishChangedQtyInCartEvent
and
PublishAddToCartEvent
now include a cart as a parameter -
Breaking: Change to behaviour of
AddToCartEvent
andChangedQtyInCartEvent
, they are now thrown after the cart has been adjusted and written back to cache -
Events deferred from
ModifyBehaviour
are dispatched beforeAddToCartEvent
andChangedQtyInCartEvent
-
The
AddToCartEvent
includes the current cart (with added product) -
The
ChangedQtyInCartEvent
includes the current cart (with updated quantities) -
Mark
CartReceiverService.RestoreCart()
as deprecated, useCartService.RestoreCart()
instead,
the cart adapter therefore needs to implement theCompleteBehaviour
interface. -
Add
CartReceiverService.ModifyBehaviour()
to easily receive the current behaviour (guest/customer) -
Add
CompleteBehaviour
interface which ensures that the cart adapter offers Complete / Restore functionality -
Add
CartService.CompleteCurrentCart()
andCartService.RestoreCart()
which rely on the newCompleteBehaviour
interface -
Breaking: Update
CartService.CancelOrder()
to useCartService.RestoreCart()
instead ofCartReceiverService.RestoreCart()
,
if your cart supports completing/restoring please implementCompleteBehaviour
interface -
Add
CartService.CancelOrderWithoutRestore()
to allow order cancellation without restoring the cart -
Mark
GuestCartService.RestoreCart
as deprecated, will be replaced byCompleteBehaviour
-
Mark
CustomerCartService.RestoreCart
as deprecated, will be replaced byCompleteBehaviour
-
Add mocks for all behaviours, you can use a specific one e.g.
&mocks.CompleteBehaviour{}
or the all in one&mocks.AllBehaviour{}
-
Update
InMemoryBehaviour
to fulfill theCompleteBehaviour
interface (addsComplete()
/Restore()
) -
Update
InMemoryCartStorage
, add Mutex to be thread safe -
Update
SimplePaymentFormService
to allow gift cards in thePaymentSelection
, please use the
configcommerce.cart.simplePaymentForm.giftCardPaymentMethod
to specify the default payment method for gift cards -
Add missing
product
module dependency to cart module
checkout
-
Move config to commerce namespace, from
checkout
tocommerce.checkout
-
Add legacy config mapping so old mappings can still be used
-
Add cue based config to have config validation in place
-
Add
OrderService.CancelOrderWithoutRestore()
which uses the newCartService
function -
Add
OrderService.CartPlaceOrder()
to place a provided cart instead of fetching it from theCartService
-
Add new GraphQL Place Order process which relies on a new state machine please referer to the module readme for more details
- Transition all actions of the checkout controller to separate states
- Add new
ContextStore
port to provide a storage for the place order process- Provide InMemory and Redis Adapter
- Add new
TryLocker
port to provide an easy way to sync multiple order processes across different nodes- Provide InMemory and Redis Adapter
- Breaking: Add new GraphQL mutations / queries to start / stop / refresh the place order process
payment
-
Add
PaymentService
to easily work with bound PaymentGateway'sPaymentService.AvailablePaymentGateways()
returns all bound gatewaysPaymentService.PaymentGateway()
gets the payment gateway by gateway codePaymentService.PaymentGatewayByCart()
gets the payment gateway of the cart payment selection
-
Extend the
FlowStatus
struct with more standardizedFlowActionData
-
Add standardized Flow Actions
PaymentFlowActionShowIframe
,PaymentFlowActionShowHTML
,PaymentFlowActionRedirect
,
PaymentFlowActionPostRedirect
please use these in your payment adapter since the standard place order relies on them.
search
- Extend
Suggestion
struct withType
andAdditionalAttributes
to be able to distinguish between product/category suggestions
Minor bug fixes and dependency updates
v3.0.1 Update dingo and form to the latest version (#188)