Skip to main content

dpm_model/
project.rs

1use crate::{Key, ProjectId, WorkspaceId};
2use serde::{Deserialize, Serialize};
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4/// Top-level namespace for a plan.
5#[serde(deny_unknown_fields)]
6pub struct Workspace {
7    /// Stable entity identity; it must match its containing map key.
8    pub id: WorkspaceId,
9    /// Non-empty local name.
10    pub name: String,
11}
12
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
14/// Project objective, optionally nested under another project.
15#[serde(deny_unknown_fields)]
16pub struct Project {
17    /// Stable entity identity; it must match its containing map key.
18    pub id: ProjectId,
19    /// Human-readable key, unique in this entity category.
20    pub key: Key,
21    /// Optional parent; containment must be acyclic.
22    pub parent: Option<ProjectId>,
23    /// Non-empty human-readable title.
24    pub title: String,
25    /// Observable purpose of this work.
26    pub objective: String,
27}