Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

🌠Commodity Management

Overview

Commodity Management is a new module introduced in HCM v2.1 for tracking warehouse stock across health campaigns. Program managers can monitor stock levels, review pending and historical transactions, create shipments, and upload bulk stock data — all scoped to the selected campaign and boundary.

The module is accessible from the campaign home screen via a new dashboard card, visible only for commodity-type campaigns.

Commodity data is pulled from Kibana / Elasticsearch via the analytics dashboard API. All stock operations are scoped to the campaign and boundary selected by the user.

Before enabling: Commodity Management reads its campaign and stock configuration from MDMS at runtime. The required MDMS masters must be configured before enabling the commodity screens — otherwise the screens will not work correctly.


What's New

Commodity Dashboard

The main dashboard (CommodityCampaigns) is the central hub for all commodity activity. It has three tabs:

Tab
What it shows

Stock Summary

Current stock levels across all warehouses for the selected campaign

Pending Transactions

Stock transactions that are awaiting processing

Transaction Summary

Historical summary of all stock transactions

How to reach it:


Bulk Stock Upload

Upload multiple stock transactions at once using a file. Useful for recording large volumes of stock movements in one go rather than entering them one by one.


Shipment Management

Create and manage shipments scoped to a specific warehouse directly from the commodity dashboard.

Action
What it does

Create shipment

Opens a popup to define a new shipment for the selected warehouse

Edit shipment

Opens a popup to modify an existing shipment


New API Integrations

Endpoint
Method
Hook
Purpose

/dashboard-analytics/dashboard/getChartV2

POST

useKibanaStockSearch, useWarehouseManagerSync

Fetch stock balances and warehouse sync data from Kibana

/stock/v1/_search

POST

useStockSearch, useBatchStockCreation

Search stock records and verify bulk stock creation

/stock/v1/bulk/_create

POST

useBatchStockCreation

Batch-create stock transaction records


New Components

Component / Hook
What it is

CommodityCampaigns.js

Main commodity dashboard page

StockSummaryTab.js

Stock summary tab

PendingTransactionsTab.js

Pending transactions tab

TransactionSummaryTab.js

Transaction summary tab

BulkStockUpload.js

Bulk stock upload screen

NewShipmentPopup.js

Create shipment popup

CommodityShipmentPopup.js

Edit shipment popup

HCMCommodityRowCard

Campaign home card — entry point to commodity dashboard

CommodityProjectContext.js

Scopes all stock operations to the selected campaign and boundary

stockDataProcessor.js

Handles stock data transformation

useKibanaStockSearch

Queries Kibana / Elasticsearch for stock data

useStockData

Fetches stock data for dashboard tabs

useStockSearch

Stock search hook

useBatchStockCreation

Handles bulk stock record creation

useCommodityProjectSearch

Campaign search scoped to commodity projects

useWarehouseManagerSync

Syncs warehouse state with the backend

All commodity components are in src/components/CommodityManagement/.


MDMS Configuration

MDMS Module
What it configures

Campaign-specific (by projectType)

Stock and commodity config — payment rules, allowed statuses, rate structures

All commodity rules are read from MDMS at runtime. Configure these masters before enabling the Commodity Management screens.


Localisation

New translation keys for all Commodity Management screens have been added under I18N_KEYS.COMMODITY_MANAGEMENT in src/utils/i18nKeyConstants.js.


Access and Permissions

Role
What they can do

Campaign-scoped users

View commodity dashboard and stock data within their boundary scope

Campaign-scoped users

Create and edit shipments within their boundary scope

Campaign-scoped users

Perform bulk stock uploads

The commodity dashboard card only appears on the campaign home screen for campaigns that are of a commodity type. Users assigned to non-commodity campaigns will not see this card.

Last updated

Was this helpful?