Skip to main content

mocra_core/common/model/
scope.rs

1//! Lightweight runtime account/platform information (no sea-orm dependency).
2//!
3//! Replaces the sea-orm entities `AccountModel` / `PlatformModel` that used to be embedded in
4//! `Task` / `Module`, decoupling the runtime data structures from the database layer — a
5//! prerequisite for gating sea-orm out of the default build (refactor Phase 2).
6//!
7//! The DB path fills these in by converting from the entities; the no-DB (standalone) path
8//! constructs them directly.
9
10use serde::{Deserialize, Serialize};
11use serde_json::Value;
12
13/// Account runtime information (lightweight).
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AccountInfo {
16    pub id: i32,
17    pub name: String,
18    #[serde(default)]
19    pub config: Value,
20}
21
22/// Platform runtime information (lightweight).
23#[derive(Debug, Clone, Default, Serialize, Deserialize)]
24pub struct PlatformInfo {
25    pub id: i32,
26    pub name: String,
27    #[serde(default)]
28    pub config: Value,
29}