|
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | + |
| 3 | +//! Submission Status — Datatracker Query Interface. |
| 4 | +//! |
| 5 | +//! This module provides a stub for querying the IETF Datatracker for |
| 6 | +//! the submission state of a named document. The actual API integration |
| 7 | +//! lives in the `intsoc-api` crate; this module exposes the domain types |
| 8 | +//! and a convenience facade used by the Gossamer GUI backend. |
| 9 | +
|
| 10 | +use serde::{Deserialize, Serialize}; |
| 11 | + |
| 12 | +/// The submission status of a document on the IETF Datatracker. |
| 13 | +#[derive(Debug, Clone, Serialize, Deserialize)] |
| 14 | +pub struct SubmissionStatus { |
| 15 | + /// The canonical document name (e.g. "draft-ietf-example-protocol-07"). |
| 16 | + pub document_name: String, |
| 17 | + /// The IETF stream (e.g. "IETF", "IAB", "IRTF", "ISE"). |
| 18 | + pub stream: String, |
| 19 | + /// Current submission state (e.g. "posted", "auth", "ietf"). |
| 20 | + pub state: String, |
| 21 | + /// Whether the document has been submitted to the Datatracker. |
| 22 | + pub submitted: bool, |
| 23 | + /// URL to the Datatracker page, if available. |
| 24 | + pub datatracker_url: Option<String>, |
| 25 | + /// Human-readable status message. |
| 26 | + pub message: String, |
| 27 | +} |
| 28 | + |
| 29 | +/// Query the IETF Datatracker for the submission status of a document. |
| 30 | +/// |
| 31 | +/// # Errors |
| 32 | +/// |
| 33 | +/// Returns an error description if the query fails (network, auth, etc.). |
| 34 | +pub fn get_status(document_name: &str) -> Result<SubmissionStatus, String> { |
| 35 | + // TODO: Implement actual Datatracker API query via intsoc-api. |
| 36 | + // For now, return a "not submitted" stub so the GUI can boot. |
| 37 | + Ok(SubmissionStatus { |
| 38 | + document_name: document_name.to_string(), |
| 39 | + stream: String::new(), |
| 40 | + state: "unknown".to_string(), |
| 41 | + submitted: false, |
| 42 | + datatracker_url: None, |
| 43 | + message: "Submission status not yet implemented".to_string(), |
| 44 | + }) |
| 45 | +} |
0 commit comments