Fluent Commerce Logo
Docs

Adobe commerce - Fulfillment

Feature

Changed on:

16 Nov 2023

Overview

The Fulfillment module allows Adobe Commerce to receive Fulfilment updates from Fluent and track these details against each order line.Key Features:
  • Adds a new handler to the order update webhook (from the order module) to accept and process fulfilment updates.
  • Currently only tracks the details at each order line. Does not drive any behavior in Adobe like status changes or updates to orders or shipments.

How it Works

Technical Details

The diagram below represents how an update from Fluent is processed in Adobe.No alt provided

Fulfillment Webhook

Configuration

The settings below demonstrate how the handler is mapped to a Fluent Webhook message name. It is possible through the Adobe’s dependency injection to add more or even override the default settings.

Validation

There are a few different validations executed before the actual webhook processing begins. These validations are part of a validation chain configured at di.xml as follows:Some of the validation includes:
  • Fluent account details are aligned with the configuration in Adobe
    • accountId
    • retailerId
  • Webhook entityType is  FULFILMENT
  • Order reference exists in Adobe

Processing

The webhook execution simply adds the message to a queue to be processed asynchronously.Topic name`fluentcommerce.fulfilment.updater`Message content: * retailerId (retailer id) * entityId (Fluent Fulfilment Id) * entityRef (Adobe Fulfilment ID) * rootEntityRef (Adobe Order increment Id)

Fulfilment Processing

The extensions use Adobes standard approach to process items waiting in a queue. The diagram below illustrates the sequence of events for each queued item.No alt provided
  • Consume messages from the queue
  • Fetch fulfilment entity by ID from Fluent
  • Run initial validation to make sure this fulfilment is related to our orders and order items
    • order exists and matches with the queued item
    • order item exists in the platform
  • Update order item fulfilment status,
    • use Command patterns for data processing
    • keep the fulfilment details on a new entity order item fulfilment linked to the standard order item

Custom entity Order Item Fulfilment

  • Entity structure
COLUMN NAMETYPEADDITIONAL INFO
entity_idINTauto increment
order_idINT
order_item_idINT
skuSTRING
nameSTRING
statusSTRINGFulfilment latest status
metadataJSON
  • Data mapping
Fluent FulfilmentAdobe order_item_fulfilmentComments

entity_idauto increment value
order.reforder_idorder id
items.fulfilmentItemEdges[].fulfilmentItemNode.orderItem.reforder_item_idorder item id
items.fulfilmentItemEdges[].fulfilmentItemNode.orderItem.product.namenameProduct name
fulfilmentById.statusstatusThe latest item fulfilment status, for Example: 'packing'

metadataAggregated fulfilment statuses per quantities [ {'status' : 'packing', 'quantity' : 1, 'fulfilment_id' : 123}, {'status' : 'handling', 'quantity' : 1, 'fulfilment_id' : 122}]

Module Architecture

  • FluentConnector/Order/Handler/FulfilmentStatusUpdateHandler.php
    • Handler to publish fulfilment messages to the message queue
  • FluentConnector/Order/Model/MessageQueue/Consumer/Data/FulfilmentUpdateMessage.php
    • Data interface for Message queue message
  • FluentConnector/Order/Model/MessageQueue/Consumer/FulfilmentUpdateConsumer.php
    • Fulfilment update Consumer
  • FluentConnector/Order/Model/Command/Order/Item/StatusUpdate.php
    • Order item status update command

CLI Commands

Force order ID to be updated from Fluent Commerce`1bin/magento fluent:order:updater [orderID]`Runs the consumer manually. Note that it normally starts automatically.`1bin/magento queue:consumers:start fluentcommerce.order.updater`

User Experience

Admin Interface -> Order Details View

The extension adds some information to the display of each order line in the order details view in the items ordered section
  • Fulfilment Status: display the latest order item fulfilment status
  • Qty: displays additional information to the regular Adobe fields
No alt provided