Vendor Management
Relevant source files
The following files were used as context for generating this wiki page:
The Vendor Management module in Horizon is a specialized component of the Configuration Management Database (CMDB) designed to track, manage, and audit third-party service providers and their relationships with organizational assets. Its primary purpose is to provide visibility into vendor performance, contract lifecycles, and Service Level Agreement (SLA) compliance to ensure IT infrastructure stability and financial accountability.
This module integrates closely with Asset Inventory Core to link physical and logical assets to specific procurement contracts, and with the Notification System to automate alerts for contract renewals and performance deviations.
Sources: README.md:104-109, IMPLEMENTATION_PLAN.md:434-436
Architecture and Components
The Vendor Management system follows the project's standard three-tier architecture, utilizing a Rust backend (Axum/Sea-ORM) and a React-based frontend. The logic is partitioned into four primary functional areas: Profile Management, Contract Lifecycle, Asset Association, and Performance Tracking.
Sources: IMPLEMENTATION_PLAN.md:434-469, AGENTS.md:12-16
Component Overview
| Component | Description |
|---|---|
| Vendor Profiles | Centralized registry of third-party entities, including contact metadata and document storage. |
| Contract Management | Tracking of legal agreements, including statuses (draft, active, expiring) and renewal logic. |
| Asset-Vendor Linker | Mapping service that associates CMDB assets with specific vendor contracts and coverage. |
| SLA Monitor | Tool for tracking Service Level Agreements and evaluating vendor performance metrics. |
Sources: README.md:104-109, IMPLEMENTATION_PLAN.md:434-455
Data Flow for Contract Renewal
The following diagram illustrates the automated flow when a contract enters the "Expiring" status.
The system continuously monitors the vendor_contracts table to identify records nearing their end_date. When a threshold is met, the status is updated, and the notification engine delivers alerts through configured channels like email or Slack.
Sources: IMPLEMENTATION_PLAN.md:447-452, IMPLEMENTATION_PLAN.md:470-496
Database Schema and Entities
The data layer for Vendor Management is implemented via Sea-ORM entities and PostgreSQL migrations. It utilizes a relational structure to link vendors to multiple contacts, contracts, and documents.
Sources: IMPLEMENTATION_PLAN.md:437-446
Core Tables
The system defines several key tables to manage vendor-related data:
- vendors: The primary registry containing unique vendor IDs, names, and profiles.
- vendor_contacts: Stores individual point-of-contact information linked to a specific vendor.
- vendor_contracts: Manages the lifecycle of agreements, including start/end dates and status enums.
- vendor_contract_assets: A junction table that maps specific assets from the CMDB to contracts.
- vendor_performance: Records metrics and evaluation scores for periodic reviews.
Sources: IMPLEMENTATION_PLAN.md:437-446, IMPLEMENTATION_PLAN.md:456-462
Entity Relationship Diagram
The diagram below shows how Vendor Management entities relate to the broader Asset Inventory.
Contract Lifecycle Management
The system tracks contracts through five distinct states: Draft, Pending, Active, Expiring, and Expired. Automation within the server-side logic handles the transition between Active and Expiring based on pre-defined notice periods.
Features
- Automatic Expiration Detection: Scheduled tasks check contract dates against the current system time.
- Renewal Alerts: Integration with the notification system to alert managers during the "Expiring" phase.
- Notice Period Tracking: Logic for calculating auto-renewal deadlines and termination windows.
Sources: IMPLEMENTATION_PLAN.md:447-455
Asset-Vendor Association
A critical feature of the module is the ability to link assets directly to the vendors that provide or service them. This ensures that during a hardware failure or software audit, the responsible vendor and contract details are immediately accessible.
Mapping Logic
- Coverage Tracking: Identifies which assets are covered under specific maintenance or support contracts.
- SLA Association: Links vendor performance directly to the uptime or response requirements of specific assets.
- Reporting: Generates contract-asset reports to identify uncovered hardware or redundant licensing.
Sources: IMPLEMENTATION_PLAN.md:456-462
API and Error Handling
Vendor Management operations use the standard ApiResponse<T> wrapper and specialized error codes for validation and conflict resolution.
Response Structure
All vendor-related API calls return a structured JSON response:
{
"status": "success",
"data": {
"id": "vendor_123",
"name": "CloudProvider X",
"status": "active"
},
"meta": {
"request_id": "req-abc-789"
}
}
Sources: crates/error/src/response.rs:90-112
Error Handling
The module utilizes the error crate to handle common vendor management failures, such as attempting to delete a vendor with active contracts (CONFLICT) or providing invalid contract dates (VALIDATION_ERROR).
Sources: crates/error/src/codes.rs:248-265, crates/error/src/codes.rs:135-150
Conclusion
Vendor Management in Horizon provides a structured framework for overseeing the external dependencies that support IT infrastructure. By integrating vendor profiles, contract lifecycles, and asset associations into the core CMDB, the system enables organizations to maintain compliance, optimize contract spend, and ensure that all infrastructure components are backed by valid support agreements.