This codebase represents an assessment for Intergamma. It is a Stock management and reservation application.
The service enables managing StockItem
s. StockItem
s are unique items associated with a given product, that can be independently added, removed, reserved and updated (the store where they are located).
Here we provide an overview of the API of the service
Retrieves the total availability and reservations of StockItem
s for a given product.
Increment stock for a given product:
{
"storeCode": "someStoreCode",
"quantity": 1
}
Retrieves all the StockItem
s that carry the given product code.
Hard removes a given StockItem
. No business rules have been applied such as failure to remove if a reservation exists, as no such rules have been given.
Allows setting the storeCode
and/or reserved
properties of a StockItem
{
"storeCode": "updated-store-code",
"reserved": true
}
If reserved
is set, its reservation timestamp is set to the moment of receipt. It will be pruned after a configurable amount of time. This is currently configured in application.properties to 30 minutes.