How zera-interdisciplinar/ms-inventory works
ms-inventory is a Zera inventory microservice for tracking equipment across registration, approval, stock, maintenance, evaluation, and disposal. Its main workflow begins with an authenticated user using the HTTP API; item use cases manage state transitions and history, with persistence in Neo4j. Separate capabilities cover catalog management, dashboards, rules and alerts, failure prediction, photo storage, and MCP tools for the AI assistant. The README documents these subsystem roles and integrations; source excerpts additionally show item-controller dispatch and photo-storage implementations, but not most use-case or adapter internals.
Main entry points: controller HTTP controllers · item Item lifecycle · neo4j Neo4j persistence · model Catalog management
Components 22
API and access
- HTTP controllers
src/main/java/com/zera/ms_inventory/infrastructure/http/controller - JWT authorization
src/main/java/com/zera/ms_inventory/infrastructure/security
Inventory domain
- Item lifecycle
src/main/java/com/zera/ms_inventory/core/usecase/item - Catalog management
src/main/java/com/zera/ms_inventory/core/usecase/model - Categories
src/main/java/com/zera/ms_inventory/core/usecase/category - Material catalog
src/main/java/com/zera/ms_inventory/core/usecase/material - Disposal records
src/main/java/com/zera/ms_inventory/core/usecase/disposal - Domain entities
src/main/java/com/zera/ms_inventory/core/domain/entity
Operational insights
- Dashboard metrics
src/main/java/com/zera/ms_inventory/core/usecase/dashboard - Rules and alerts
src/main/java/com/zera/ms_inventory/core/usecase/rule - Rule evaluation job
src/main/java/com/zera/ms_inventory/infrastructure/job/RuleEvaluationJob.java - Failure prediction
src/main/java/com/zera/ms_inventory/core/usecase/prediction - Prediction job
src/main/java/com/zera/ms_inventory/infrastructure/job/FailurePredictionJob.java
Infrastructure adapters
- Neo4j persistence
src/main/java/com/zera/ms_inventory/infrastructure/persistence/neo4j - Photo storage
src/main/java/com/zera/ms_inventory/infrastructure/storage
Assistant interface
- MCP tools
src/main/java/com/zera/ms_inventory/infrastructure/mcp/tools
Other components
- Authenticated user
- Google Cloud Storage
- Administrative core
- Prediction service
- AI assistant
- Gemini embeddings
Connections 29
- Authenticated user → HTTP controllers: calls API
README.md - HTTP controllers → JWT authorization: authorizes
README.md - HTTP controllers → Item lifecycle: dispatches
src/main/java/com/zera/ms_inventory/infrastructure/http/controller/ItemController.java - HTTP controllers → Catalog management: dispatches
src/main/java/com/zera/ms_inventory/infrastructure/http/controller/ModelController.java - HTTP controllers → Categories: dispatches
README.md - HTTP controllers → Disposal records: dispatches
README.md - HTTP controllers → Dashboard metrics: dispatches
README.md - HTTP controllers → Rules and alerts: dispatches
README.md - HTTP controllers → Failure prediction: dispatches
- Item lifecycle → Domain entities: changes state
README.md - Catalog management → Material catalog: uses catalog
README.md - Catalog management → Domain entities: manages models
README.md - Categories → Domain entities: manages categories
README.md - Disposal records → Domain entities: records disposal
README.md - Dashboard metrics → Neo4j persistence: reads metrics
- Rules and alerts → Neo4j persistence: evaluates inventory
- Rule evaluation job → Rules and alerts: triggers evaluation
README.md - Rules and alerts → Administrative core: sends alerts
README.md - Prediction job → Failure prediction: triggers update
README.md - Failure prediction → Prediction service: requests forecasts
README.md - Item lifecycle → Photo storage: uploads photos
- Photo storage → Google Cloud Storage: stores photos
src/main/java/com/zera/ms_inventory/infrastructure/storage/GcsPhotoStorage.java - MCP tools → AI assistant: provides tools
README.md - AI assistant → MCP tools: invokes tools
README.md - MCP tools → Item lifecycle: queries inventory
src/main/java/com/zera/ms_inventory/infrastructure/mcp/tools/SearchInventoryTool.java - Item lifecycle → Neo4j persistence: persists items
README.md - Catalog management → Neo4j persistence: persists catalog
README.md - Disposal records → Neo4j persistence: persists records
- MCP tools → Gemini embeddings: uses embeddings