Functionality
Buffers are used to protect a certain number of stock units. The most common use case is to protect a few units (2-3) of stock from the overall saleable stock, in order to mitigate desynchronisation between in-store and online sales.
Application par type de stock
Buffers can be applied globally or by endpoint, but their application is always open by stock type. There is no unified application that encompasses more than one type of stock at a time.
Example: If there is a global buffer of 2 for the on_hand stock type and another of 3 for the ASN stock type, when the buffers are applied globally, their application corresponds to the sum of the global application for on_hand + the global application for ASN.
Buffer groups
Any buffer to a buffer_group
to which it belongs and that allows it to be referred to from a stock request.
Buffer groups in stock requests
{ "aggregates": { "0": { "deduction": { "endpoint_buffer": [ "FR", "IT" ], "global_buffer": [ "stores_FR" ] } } } }
Types of Buffers
There are two types of buffers, endpoint buffers and global buffers. The first will be assigned and deducted at endpoint level, the second will be assigned without a notion of endpoint and will be deducted once the endpoints have been aggregated. As a result, the global buffers are only taken into account in the stock query with unification by endpoint.
Buffer endpoint
Declaration by item, endpoint ID pair
The simplest buffers, corresponding to a number of buffered units for a couple item_id
, endpoint_id.
endpoint_id | item_id | qty | buffer_group |
---|---|---|---|
store_1 | i1 | 2 | FR |
store_1 | i1 | 3 | US |
Declaration avec key requests
Very similar to hard buffers, but more flexible. They allow you to specify filters to take into account the dynamic handling of endpoints and items.
endpoint_id | item_id | qty | buffer_group |
---|---|---|---|
endpoint_type = store AND address.region.country.code = FR | * | 9 | FR |
endpoint_type = warehouse | * | 12 | WORLD |
Buffer Global
Allows a buffer to be allocated globally, i.e. without filtering the endpoints affected. If an endpoint filter is declared, it will be ignored. Allows a number of units to be buffered globally.
item_id | qty | buffer_group |
---|---|---|
category = "bebe" | 9 | FR |
* | 12 | WORLD |
Buffer structure
API signature
Routes BIP - Buffer Inventory Processor
item_filter: If nil, applies to all items
id (string): item_id on which the buffer will be applied (hard buffer)
request_name (string): Used to apply the buffer to a request item (all items with a certain category). Must be empty if id is set
endpoint_filter: If nil, applies to all endpoints
id (string): endpoint_id to which the buffer will be applied (hard buffer)
request_name (string): Used to apply the buffer to a request endpoint (all endpoints of type store). Must be empty if id is set
stock_type (string): required type of stock on which the buffer is applied.
global (bool): true in the case of a global buffer, false otherwise.
buffer_group (string): required buffer group to which the buffer belongs, allows it to be referenced in a stock request..
qty (int): required number of buffered units.
Impact of buffers on stock calculations
Taken into account in stock requests
The global buffers/endpoints that are applied depend on the configuration of the stock requests. The stock request lists the buffer groups - the groups into which the buffers are distributed - that need to be taken into account. If there are 3 global buffers configured for the same stock key, and the aim is to apply arbitrarily 1 of these 3, all you have to do is distribute them in 3 different buffers groups, and indicate ONLY 1 in the stock request.
Calculation
When buffers are taken into account in a stock request, available stock is calculated as follows:
Without endpoint unification
Detaille
Stock per endpoint => MAX( RawStock - ResEndpoint - Dispositions - MAX ( BufDur, BufEndpoint ) , 0 )
With endpoint unification
MIN( SUM( MAX_par_endpoint( RawStock - ResEndpoint - Dispositions - MAX(BufDur, BufEndpoint), 0 ) ), SUM(RawStock - ResEndpoint - Dispositions) - BufGlob )