Fluent Commerce Logo
Docs
Sign In

CreateFulfilmentInventoryQuantity

Rule

Changed on:

29 Nov 2023

Overview

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

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

The Inventory Reference Module is the foundation for inventory 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 Inventory 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

Inventory quantity type

defaultCondition

Default inventory quantity Condition

defaultStorageAreaRef

Default inventory quantity Storage Area Ref

inventoryQuantityType

Expected Inventory Type

Event attributes

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

Inventory Position sub-attribute

Parameter

Description

Data Type

Required?

inventoryPosition

Inventory 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}

Language: json

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}

Language: java

Name: InventoryPosition

Description:

[Warning: empty required content area]
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}

Language: java

Name: InventoryQuantity

Description:

[Warning: empty required content area]

An example JSON payload that represents the event attributes of an incoming event

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}

Language: json

Name: JSON Sample

Description:

[Warning: empty required content area]


This rule will get a list of inventory quantities against a given inventory position from the incoming event, it will only create inventory quantities if their types are same as the one defined in the 

`inventoryQuantityType`
 input parameter.

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

Version History

2023-07-28

v2.0.0

refers to plugin

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo