add contract md folder support

This commit is contained in:
timurgordon
2025-05-01 03:56:55 +03:00
parent 457f3c8268
commit c05803ff58
15 changed files with 365 additions and 76 deletions

View File

@@ -136,6 +136,14 @@ impl ContractRevision {
}
}
/// Table of Contents item for multi-page contracts
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TocItem {
pub title: String,
pub file: String,
pub children: Vec<TocItem>,
}
/// Contract model
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Contract {
@@ -153,6 +161,9 @@ pub struct Contract {
pub revisions: Vec<ContractRevision>,
pub current_version: u32,
pub organization_id: Option<String>,
// Multi-page markdown support
pub content_dir: Option<String>,
pub toc: Option<Vec<TocItem>>,
}
impl Contract {
@@ -171,8 +182,10 @@ impl Contract {
expiration_date: None,
signers: Vec::new(),
revisions: Vec::new(),
current_version: 0,
current_version: 1,
organization_id,
content_dir: None,
toc: None,
}
}