Store Warehousing Adapter
Basic physical warehousing that always reports stock as available. Use it when inventory is managed outside the system, for drop-shipping, or during development.
Included in Base Preset
Registered automatically by registerBasePlugins() and registerAllPlugins().
If you register plugins individually instead of using a preset:
import { pluginRegistry } from '@unchainedshop/core';
import { StorePlugin } from '@unchainedshop/plugins/warehousing/store';
pluginRegistry.register(StorePlugin);
Setup
mutation CreateStoreWarehousing {
createWarehousingProvider(warehousingProvider: {
type: PHYSICAL
adapterKey: "shop.unchained.warehousing.store"
}) {
_id
}
}
Adapter Details
| Property | Value |
|---|---|
| Key | shop.unchained.warehousing.store |
| Type | PHYSICAL |
| Order Index | 0 |
| Source | warehousing/store |
Configuration Options
| Key | Description | Default |
|---|---|---|
name | Store/warehouse name | "Flagship Store" |
Behavior
isActive()returnstruestock()returns99999(effectively unlimited)productionTime()returns0commissioningTime()returns0
Real Inventory
For production inventory tracking, register a custom adapter with the registerPhysicalWarehousing factory. stock, productionTime, and commissioningTime accept either a constant or a callback:
import { registerPhysicalWarehousing } from '@unchainedshop/core';
registerPhysicalWarehousing({
adapterId: 'real-store',
stock: async (referenceDate, configuration, { product }) => {
const sku = product?.warehousing?.sku;
if (!sku) return 0;
const inventory = await inventoryDb.findOne({ sku });
return inventory?.quantity || 0;
},
commissioningTime: 4 * 60 * 60 * 1000,
});
Query Stock Status
query ProductAvailability($productId: ID!) {
product(productId: $productId) {
... on SimpleProduct {
simulatedStocks {
warehousingProvider {
_id
interface { label }
}
quantity
}
}
}
}
Related
- ETH Minter - Virtual/NFT inventory
- Custom Warehousing Plugins - Write your own