Fundamental_Analysis/services/common-contracts/src/registry.rs
Lv, Qi 0cb31e363e Refactor E2E tests and improve error handling in Orchestrator
- Fix `simple_test_analysis` template in E2E test setup to align with Orchestrator's data fetch logic.
- Implement and verify additional E2E scenarios:
    - Scenario C: Partial Provider Failure (verified error propagation fix in Orchestrator).
    - Scenario D: Invalid Symbol input.
    - Scenario E: Analysis Module failure.
- Update `WorkflowStateMachine::handle_report_failed` to correctly scope error broadcasting to the specific task instead of failing effectively silently or broadly.
- Update testing strategy documentation to reflect completed Phase 4 testing.
- Skip Scenario B (Orchestrator Restart) as persistence is not yet implemented (decision made to defer persistence).
2025-11-21 20:44:32 +08:00

41 lines
1.0 KiB
Rust

use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)]
pub enum ServiceStatus {
Active,
Degraded,
Maintenance,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum ServiceRole {
DataProvider,
ReportGenerator,
Persistence,
Gateway,
Other,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct ServiceRegistration {
/// Unique ID for this service instance (e.g., "tushare-provider-uuid")
pub service_id: String,
/// Service type/name (e.g., "tushare")
pub service_name: String,
/// The role/category of the service
pub role: ServiceRole,
/// Base URL for the service (e.g., "http://10.0.1.5:8000")
pub base_url: String,
/// Health check endpoint
pub health_check_url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct Heartbeat {
pub service_id: String,
pub status: ServiceStatus,
}