Fluent Commerce Logo
Docs
Sign In

CreateFulfilmentInventoryQuantity

Rule

Changed on:

29 Nov 2023

Overview

Create quantity of type {inventoryQuantityType} using attributes, or set default type as {defaultType}, condition as {defaultCondition} and storageRef as {defaultStorageAreaRef}

Plugin NameInventory Reference Module
Namespace[[account.id]].globalinventory

The is the foundation for related implementations. It provides reference Workflows for inventory ingestion and processing. Extensible by design, use this Module as a base to build a solution to the needs of your customers.

The Module includes the following areas:

  • Product Catalogue workflow
  • Inventory Catalogue workflow
  • Control Group workflow
  • Virtual Catalogue workflow

UI Description

Create inventory quantity of type {inventoryQuantityType} using event attributes, or set default type as {defaultType}, condition as {defaultCondition} and storageRef as {defaultStorageAreaRef}

Accepts

  • INVENTORY_POSITION

Actions

  • This rule produces multiple MutationActions that will create a list of inventory quantities

Rule parameters

Parameter

Description

defaultType

quantity type

defaultCondition

Default quantity Condition

defaultStorageAreaRef

Default quantity Storage Area Ref

inventoryQuantityType

Expected Type

Event attributes

This uses all the attributes to create a list of quantities. Note that some attributes represent complex types and their definitions follow the main definition.

Inventory Position sub-attribute

Parameter

Description

Data Type

Required?

inventoryPosition

position json object

Object

Required

Exceptions

If any of the required property fields are null or missing, a PropertyNotFoundException will be thrown.

Configuration example

1{
2  "name": "{{accountId}}.globalinventory.CreateFulfilmentInventoryQuantity",
3  "props": {
4    "defaultType": "DEFAULT",
5    "defaultCondition": "NEW",
6    "defaultStorageAreaRef": "",
7    "inventoryQuantityType": "RESERVED"
8  }
9}

Detailed Technical Description

InventoryPosition Java Class Definition
1public class InventoryPosition {
2
3    private String ref;
4
5    private String type;
6
7    private String status;
8
9    @NonNull
10    private String productRef;
11
12    @NonNull
13    private String locationRef;
14
15    private List<InventoryQuantity> inventoryQuantities;
16
17    private List<Attribute> attributes;
18
19    @JsonPOJOBuilder(withPrefix = "")
20    public static final class Builder {
21
22    }
23}
InventoryQuantity Java Class Definition
1public class InventoryQuantity {
2
3    private String ref;
4
5    private String type;
6
7    private String status;
8
9    @NonNull
10    private Integer quantity;
11
12    private String condition;
13
14    private Date expectedOn;
15
16    private String storageAreaRef;
17
18    private String action;
19}

An example JSON payload that represents the attributes of an incoming

1{
2  "rootEntityRef": "DEFAULT:1",
3  "rootEntityType": "INVENTORY_CATALOGUE",
4  "attributes": {
5    "inventoryPosition": {
6       "ref": "required",
7       "type" : "",
8       "status" : "",
9       "productRef" : "" ,
10       "locationRef" : "",
11       "inventoryQuantities" : [
12          {
13            "ref":"required",
14            "quantity" : "required",
15            "type" : "optional if does not exists will use the one defined in workflow",
16            "condition" : "optional if does not exists will use the one defined in workflow",
17            "storageAreaRef" : "optional if does not exists will use the one defined in workflow"
18          }
19      ]
20    }
21  }
22}


This will get a list of quantities against a given position from the incoming , it will only create quantities if their types are same as the one defined in the `inventoryQuantityType` input parameter.

If a given quantity already exists in the database, the mutation of adding the quantity will fail.

Version History

2023-07-28

v2.0.0

refers to