Standard Categories
Standard Categories are the foundational data classification system in AquaGen that organize monitoring data into logical groups. Each category represents a specific aspect of water or energy monitoring and contains subcategories and units for detailed tracking.
Overview
AquaGen uses a hierarchical category system to organize all monitoring data:
Standard Category → Services → Subcategories → Units
Example:
Source Category (Water Consumption)
└─ Borewell Service
└─ Borewell 1 (Subcategory)
└─ Flow Meter 1 (Unit)
└─ Pressure Sensor 1 (Unit)
Standard Category Types
There are 6 standard category types defined in the system:
1. SOURCE_CATEGORY (Water Consumption)
Display Name: Consumption
Purpose: Tracks water inflow/consumption from various sources
Common Services:
- Borewell water
- Corporation/Municipal water
- Treated water
- Raw water intake
- Tanker water
Typical Measurements:
- Flow rate (kL/hr)
- Total consumption (kL)
- Pressure (bar)
- Cumulative volume
Route Pattern: /monitoring/source_category/{categoryId}
Report Type: water
Use Cases:
- Daily water consumption tracking
- Source-wise water usage analysis
- Trend analysis and forecasting
- Cost allocation by source
2. STOCK_CATEGORY (Water Levels)
Display Name: Level
Purpose: Monitors water storage tank levels and capacity
Common Services:
- Overhead tanks
- Underground tanks
- Sump tanks
- Storage reservoirs
- Buffer tanks
Typical Measurements:
- Current level (meters)
- Percentage filled (%)
- Volume stored (kL)
- Capacity (kL)
- Level alerts
Route Pattern: /monitoring/stock_category/{categoryId}
Report Type: level
Use Cases:
- Tank capacity monitoring
- Storage optimization
- Refill scheduling
- Emergency stock tracking
3. QUALITY_CATEGORY (Water Quality)
Display Name: Quality
Purpose: Monitors water quality parameters for safety and compliance
Common Services:
- Drinking water quality
- Raw water quality
- Treated water quality
- Wastewater quality
- Process water quality
Typical Measurements:
- pH (6.5-8.5)
- TDS (mg/L)
- Turbidity (NTU)
- Chlorine (mg/L)
- Temperature (°C)
- Conductivity (μS/cm)
Route Pattern: /monitoring/quality_category/{categoryId}
Report Type: quality
Use Cases:
- Compliance monitoring (WHO, IS 10500)
- Treatment effectiveness
- Quality threshold alerts
- Historical quality trends
4. GROUND_WATER_LEVEL
Display Name: Ground Water
Purpose: Tracks groundwater and borewell water levels
Common Services:
- Borewell monitoring
- Aquifer level tracking
- Recharge monitoring
- Seasonal variations
Typical Measurements:
- Water level depth (meters)
- Water table elevation
- Recharge rate
- Drawdown measurements
Route Pattern: /monitoring/ground_water_level/{categoryId}
Report Type: borewell
Use Cases:
- Groundwater depletion monitoring
- Borewell health assessment
- Recharge effectiveness
- Sustainability tracking (GWI)
5. ENERGY_CATEGORY
Display Name: Energy
Purpose: Monitors electrical energy consumption for water operations
Common Services:
- Pump energy consumption
- Treatment plant energy
- Total facility energy
- Energy by process
Typical Measurements:
- Energy consumption (kWh)
- Power (kW)
- Voltage (V)
- Current (A)
- Power factor
- Specific Energy Consumption (kWh/kL)
Route Pattern: /monitoring/energy_category/{categoryId}
Report Type: energy
Use Cases:
- Energy cost optimization
- Pump efficiency monitoring
- SEC tracking
- Energy sustainability metrics
6. ID_RAIN_WATER (Rainwater)
Display Name: Rain Water
Purpose: Tracks rainwater harvesting and rainfall data
Common Services:
- Rainfall measurement
- Rainwater harvesting
- Runoff collection
- Recharge tracking
Typical Measurements:
- Rainfall (mm)
- Harvested volume (kL)
- Recharge efficiency (%)
- Runoff coefficient
Route Pattern: Special routes (RWI module)
Report Type: rwi
Use Cases:
- Rainwater harvesting efficiency
- Rain Water Index (RWI) calculation
- Sustainability metrics
- Seasonal planning
Category Hierarchy
Three-Level Structure
{
// Standard Category
standardCategoryId: "SOURCE_CATEGORY",
standardCategoryName: "Consumption",
// Service/Category Level
categoryId: "BW001",
categoryName: "Borewell Water",
categoryDisplayName: "Borewell",
// Subcategory Level
subCategoryId: "BW001_SC1",
subCategoryName: "Borewell 1",
// Unit Level
units: [
{
unitId: "FM001",
unitName: "Flow Meter 1",
unitType: "FLOW",
measurementUnit: "kL"
}
]
}
Standard Category Enums
CategoryType.js
Located at: libs/shared/src/enums/categoryType.js
const StandardCategoryType = {
SOURCE_CATEGORY: 'source_category',
STOCK_CATEGORY: 'stock_category',
QUALITY_CATEGORY: 'quality_category',
GROUND_WATER_LEVEL: 'ground_water_level',
ENERGY_CATEGORY: 'energy_category',
ID_RAIN_WATER: 'rain_water',
};
const StandardCategoryReportType = {
SOURCE_CATEGORY: 'water',
STOCK_CATEGORY: 'level',
QUALITY_CATEGORY: 'quality',
GROUND_WATER_LEVEL: 'borewell',
ENERGY_CATEGORY: 'energy',
ID_RAIN_WATER: 'rwi',
CONSOLIDATED: 'consolidated',
SUMMARY: 'summary',
ENERGY_CONSOLIDATED: 'energy_consolidated',
};
const StandardCategoryTypeToName = {
SOURCE_CATEGORY: 'Consumption',
STOCK_CATEGORY: 'Level',
QUALITY_CATEGORY: 'Quality',
GROUND_WATER_LEVEL: 'Ground Water',
ENERGY_CATEGORY: 'Energy',
};
Usage in Navigation
Route Generation
Standard categories are used to generate dynamic routes:
// Pattern
/monitoring/{standardCategoryId}/{categoryId}
// Examples
/monitoring/source_category/BW001
/monitoring/stock_category/OHT001
/monitoring/quality_category/DW001
/monitoring/ground_water_level/GWL001
/monitoring/energy_category/PUMP001
Service Navigation
When users log in, the system:
- Fetches user's accessible services from backend
- Each service has a
standardCategoryId - Routes are dynamically generated based on standard category
- Default navigation goes to first accessible service
// From navigationHelper.js
setSelectedCategory(response.services[0]);
navigate(`/monitoring/${response.services[0].standardCategoryId.toLowerCase()}/${response.services[0].categoryId}`);
Category Data Flow
1. Login Response
{
"services": [
{
"standardCategoryId": "SOURCE_CATEGORY",
"categoryId": "BW001",
"categoryName": "Borewell Water",
"subCategories": [...],
"units": [...]
}
]
}
2. API Endpoints
Each standard category uses specific API endpoints:
// Device data by category
GET /deviceData/{categoryId}
GET /deviceDataV2/{categoryId}
// Granular data
GET /granular/category
GET /granular/unit
// Ground water specific
GET /groundWaterLevel/graph
// Report generation
GET /industries/{industryId}/report/{reportType}/{format}
3. Data Retrieval
// Example: Fetch source category data
const fetchSourceData = async (categoryId) => {
const response = await fetch(`/deviceDataV2/${categoryId}`, {
params: {
startDate: '2026-02-26',
endDate: '2026-02-26',
standardCategory: 'SOURCE_CATEGORY'
}
});
return response.data;
};
Search and Discovery
Universal Search
Standard categories are searchable through the universal search bar:
Search Types:
- Category Search: Find by category name (shows with "Category" badge)
- Subcategory Search: Find by subcategory (shows with "SubCategory" badge)
- Unit Search: Find by unit name (shows with "Unit" badge)
Search Grouping:
// Water categories grouped
WATER_CONSUMPTION
└─ Borewell Water
└─ Borewell 1
└─ Flow Meter 1
// Energy categories grouped
ENERGY_CONSUMPTION
└─ Pump Energy
└─ Raw Water Pumps
└─ Pump 1 Energy Meter
Search Configuration:
- Debounce delay: 150ms
- Minimum query length: 0 (shows all on empty)
- Supports partial matching
- Case-insensitive search
Report Generation
Standard Category Reports
Each standard category has specific report types:
reportUrl(industryId, standardCategory, reportType, format, startDate, endDate, unitId)
// Example
/industries/IND123/report/water/daily/pdf?startDate=2026-02-01&endDate=2026-02-28
/industries/IND123/report/level/monthly/excel?startDate=2026-02-01
/industries/IND123/report/quality/weekly/pdf?startDate=2026-02-01&unitId=UNIT123
Report Types by Category:
| Standard Category | Report Type | Available Formats |
|---|---|---|
| SOURCE_CATEGORY | water | PDF, Excel, CSV |
| STOCK_CATEGORY | level | PDF, Excel, CSV |
| QUALITY_CATEGORY | quality | PDF, Excel, CSV |
| GROUND_WATER_LEVEL | borewell | PDF, Excel, CSV |
| ENERGY_CATEGORY | energy | PDF, Excel, CSV |
| ID_RAIN_WATER | rwi | PDF, Excel |
Report Intervals:
- Daily
- Weekly
- Monthly
- Custom range
- Consolidated (multi-category)
Virtual Categories
VIRTUAL_CATEGORY is a special category type for calculated/virtual nodes:
const StandardCategoryTypeUppercase = {
...
VIRTUAL_CATEGORY: 'VIRTUAL_CATEGORY',
};
Virtual nodes:
- Calculated from other physical nodes
- Formula-based values (e.g., Total = Source1 + Source2)
- Used for aggregations and derived metrics
- No physical sensor attached
API Endpoints:
GET /virtual/device_data- Fetch virtual node dataPOST /virtual/device_data- Create virtual node
Integration with Features
Dashboard
Standard categories appear on the dashboard as summary cards:
- Consumption Card (SOURCE_CATEGORY)
- Quality Card (QUALITY_CATEGORY)
- Energy Card (ENERGY_CATEGORY)
- Water Stock Card (STOCK_CATEGORY)
Monitoring Module
The monitoring module (libs/monitoring) organizes data by standard category:
- Water Flow Monitoring → SOURCE_CATEGORY
- Water Quality Monitoring → QUALITY_CATEGORY
- Water Stock Levels → STOCK_CATEGORY
- Ground Water Level → GROUND_WATER_LEVEL
Energy Module
Dedicated module for ENERGY_CATEGORY:
- Energy consumption tracking
- Pump efficiency
- SEC (Specific Energy Consumption) calculation
Permissions
Standard category access is controlled by permissions:
// Example permissions
WATER_FLOW_MONITORING // Access to SOURCE_CATEGORY data
WATER_QUALITY_MONITORING // Access to QUALITY_CATEGORY data
WATER_STOCK_MONITORING // Access to STOCK_CATEGORY data
GROUND_WATER_LEVEL // Access to ground water data
ENERGY_MONITORING // Access to ENERGY_CATEGORY data
Users only see standard categories they have permission to access.
Best Practices
1. Category Selection
- Group similar monitoring points under same category
- Use appropriate standard category for each service
- Keep hierarchy logical and consistent
2. Naming Conventions
// Good naming
categoryName: "Borewell Water"
subCategoryName: "Borewell 1"
unitName: "Flow Meter BW1-FM1"
// Avoid
categoryName: "BW"
subCategoryName: "Cat1"
unitName: "FM1"
3. Data Organization
- One standard category per service type
- Logical subcategory grouping (by location, process, etc.)
- Unique unit IDs across entire system
4. API Usage
// Always specify standard category in requests
const params = {
categoryId: 'BW001',
standardCategory: 'SOURCE_CATEGORY',
startDate: '2026-02-26',
endDate: '2026-02-26'
};
Related Documentation
- Water Flow Monitoring - SOURCE_CATEGORY implementation
- Water Quality Monitoring - QUALITY_CATEGORY implementation
- Water Stock Levels - STOCK_CATEGORY implementation
- Ground Water Level - GROUND_WATER_LEVEL implementation
- Energy Monitoring - ENERGY_CATEGORY implementation
- API & Services - API endpoints by category
- Enums & Configuration - Category enum definitions
Last Updated: February 2026
Module Location: libs/shared/src/enums/categoryType.js
Key Concept: Standard categories provide the foundational data organization structure for all monitoring in AquaGen