Overview
TheCatalogRepository interface manages global catalog data that is shared across all tenants. This includes device categories and types, measurement units, alert types and severities, periods, and actuator states. Catalog data is used in dropdowns and forms throughout the application.
Catalog data is global and not tenant-specific. Changes affect all tenants in the system.
Device Categories
getDeviceCategories()
Fetches all device categories from the catalog (e.g., Sensor, Actuator). ReturnsResult containing list of device categories, or error on failure
createDeviceCategory()
Creates a new device category. ParametersThe category name (e.g., “Sensor”, “Actuator”)
Result containing the created category with auto-generated ID, or error on failure
updateDeviceCategory()
Updates an existing device category. ParametersThe category ID to update
The new category name
Result containing the updated category, or error on failure
deleteDeviceCategory()
Deletes a device category. ParametersThe category ID to delete
Result indicating success or failure
Device Types
getDeviceTypes()
Fetches all device types from the catalog (e.g., Temperature Sensor, Humidity Sensor, Water Valve). ReturnsResult containing list of device types with their properties, or error on failure
createDeviceType()
Creates a new device type with complete configuration. ParametersThe type name (e.g., “Temperature Sensor”)
Optional description of the device type
The category this type belongs to (1 = Sensor, 2 = Actuator)
Optional default unit ID for this type (e.g., Celsius for temperature)
Optional data type (e.g., “numeric”, “boolean”)
Optional minimum expected value for validation
Optional maximum expected value for validation
Optional control type for actuators (e.g., “on/off”, “variable”)
Whether the type is active and available for use
Result containing the created device type with auto-generated ID, or error on failure
updateDeviceType()
Updates an existing device type. All fields are optional for partial updates. ParametersThe type ID to update
Optional new name
Optional new description
Optional new category ID
Optional new default unit ID
Optional new data type
Optional new minimum expected value
Optional new maximum expected value
Optional new control type
Optional new active status
Result containing the updated device type, or error on failure
deleteDeviceType()
Deletes a device type from the catalog. ParametersThe type ID to delete
Result indicating success or failure
activateDeviceType()
Activates a previously deactivated device type. ParametersThe type ID to activate
Result containing the activated device type, or error on failure
deactivateDeviceType()
Deactivates a device type without deleting it. ParametersThe type ID to deactivate
Result containing the deactivated device type, or error on failure
Device Units
getDeviceUnits()
Fetches all measurement units from the catalog (e.g., °C, %, kPa). ReturnsResult containing list of device units, or error on failure
createDeviceUnit()
Creates a new measurement unit. ParametersThe unit symbol (e.g., “°C”, ”%”, “kPa”)
The unit name (e.g., “Celsius”, “Percent”, “Kilopascal”)
Optional description of the unit
Whether the unit is active and available for use
Result containing the created unit with auto-generated ID, or error on failure
updateDeviceUnit()
Updates an existing measurement unit. ParametersThe unit ID to update
Optional new symbol
Optional new name
Optional new description
Optional new active status
Result containing the updated unit, or error on failure
deleteDeviceUnit()
Deletes a measurement unit from the catalog. ParametersThe unit ID to delete
Result indicating success or failure
activateDeviceUnit()
Activates a previously deactivated unit. ParametersThe unit ID to activate
Result containing the activated unit, or error on failure
deactivateDeviceUnit()
Deactivates a unit without deleting it. ParametersThe unit ID to deactivate
Result containing the deactivated unit, or error on failure
Alert Types
getAlertTypes()
Fetches all alert types from the catalog. ReturnsResult containing list of alert types, or error on failure
createAlertType()
Creates a new alert type. ParametersThe alert type name
Optional description of the alert type
Result containing the created alert type, or error on failure
updateAlertType()
Updates an existing alert type. ParametersThe alert type ID to update
Optional new name
Optional new description
Result containing the updated alert type, or error on failure
deleteAlertType()
Deletes an alert type from the catalog. ParametersThe alert type ID to delete
Result indicating success or failure
Alert Severities
getAlertSeverities()
Fetches all alert severity levels from the catalog. ReturnsResult containing list of alert severities with levels, colors, and notification settings, or error on failure
createAlertSeverity()
Creates a new alert severity level. ParametersThe severity name (e.g., “Critical”, “Warning”, “Info”)
The severity level (lower numbers = less severe)
Optional description of the severity level
Optional color code in hex format (e.g., “#FF0000” for red)
Whether this severity requires user action
Delay in minutes before sending notifications for this severity
Result containing the created severity, or error on failure
updateAlertSeverity()
Updates an existing alert severity. ParametersThe severity ID to update
Optional new name
Optional new level
Optional new description
Optional new color
Optional new requires action flag
Optional new notification delay
Result containing the updated severity, or error on failure
deleteAlertSeverity()
Deletes an alert severity from the catalog. ParametersThe severity ID to delete
Result indicating success or failure
Periods
getPeriods()
Fetches all periods from the catalog (used for scheduling). ReturnsResult containing list of periods, or error on failure
createPeriod()
Creates a new period. ParametersThe period name
Result containing the created period, or error on failure
updatePeriod()
Updates an existing period. ParametersThe period ID to update
The new period name
Result containing the updated period, or error on failure
deletePeriod()
Deletes a period from the catalog. ParametersThe period ID to delete
Result indicating success or failure
Actuator States
getActuatorStates()
Fetches all actuator states from the catalog (e.g., ON, OFF, STANDBY). ReturnsResult containing list of all actuator states, or error on failure
getOperationalActuatorStates()
Fetches only operational actuator states (excludes error/maintenance states). ReturnsResult containing list of operational actuator states, or error on failure
createActuatorState()
Creates a new actuator state. ParametersThe state name (e.g., “ON”, “OFF”, “STANDBY”)
Optional description of the state
Whether this state represents an operational mode
The display order for sorting in UI
Optional color code in hex format for UI display
Result containing the created actuator state with auto-generated ID, or error on failure
updateActuatorState()
Updates an existing actuator state. ParametersThe state ID to update
Optional new name
Optional new description
Optional new operational status
Optional new display order
Optional new color
Result containing the updated actuator state, or error on failure
deleteActuatorState()
Deletes an actuator state from the catalog. ParametersThe state ID to delete
Result indicating success or failure
Usage Example
Related Documentation
Device Models
Device catalog data models
Alert Models
Alert type and severity models
DevicesRepository
Device instance management
SettingsRepository
Settings using catalog data