Introduction
MicroCBM uses TypeScript to provide type safety across the entire application. This section documents all type definitions organized by domain, extracted directly from the source code.Type Categories
Inventory Types
Asset, Sites, and related analytics types for equipment management
Sample Types
Oil sample analysis types including wear metals, contaminants, and measurements
Alarm Types
Alarm monitoring and acknowledgment types with analytics
Recommendation Types
Maintenance recommendation types with severity levels and attachments
RCA Types
Root Cause Analysis types including 5 Whys, Logic Tree, and Fishbone diagrams
Common Patterns
Timestamps
All entities include timestamp fields for tracking creation and updates:Entity References
Related entities are embedded as nested objects with at minimum anid field:
Filter Types
Most collections have corresponding filter types for querying:Analytics Types
Analytics types follow a consistent pattern with totals and trend data:Type Safety Best Practices
All types are exported from
@/types and can be imported directly:Using Discriminated Unions
Severity and status fields use literal types for type safety:Payload Types
Create and update operations have dedicated payload types that may differ from the full entity:Next Steps
Server Actions
Learn how to use these types with server actions
Hooks
Explore custom hooks that work with these types