Skip to main content

canic_host/deployment_truth/model/lifecycle/completion/
mod.rs

1use super::proposal::{
2    ExternalUpgradeConsentEvidenceV1, ExternalUpgradeConsentStateV1, ExternalUpgradeProposalV1,
3    ExternalUpgradeVerificationResultV1,
4};
5use super::verification::{
6    ExternalUpgradeVerificationCheckV1, ExternalVerificationObservationSourceV1,
7};
8use serde::{Deserialize, Serialize};
9
10///
11/// ExternalUpgradeCompletionReportV1
12///
13#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
14pub struct ExternalUpgradeCompletionReportV1 {
15    pub schema_version: u32,
16    pub report_id: String,
17    pub report_digest: String,
18    pub proposal_id: String,
19    pub proposal_digest: String,
20    pub consent_evidence_id: String,
21    pub consent_evidence_digest: String,
22    pub verification_check_id: String,
23    pub verification_check_digest: String,
24    pub subject: String,
25    pub canister_id: Option<String>,
26    pub role: Option<String>,
27    pub consent_state: ExternalUpgradeConsentStateV1,
28    pub verification_result: ExternalUpgradeVerificationResultV1,
29    pub verification_observation_source: ExternalVerificationObservationSourceV1,
30    pub completion_status: ExternalUpgradeCompletionStatusV1,
31    pub blockers: Vec<String>,
32    pub next_actions: Vec<String>,
33    pub status_summary: String,
34}
35
36///
37/// ExternalUpgradeCompletionStatusV1
38///
39#[derive(Clone, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
40pub enum ExternalUpgradeCompletionStatusV1 {
41    AwaitingConsent,
42    ConsentRefused,
43    SuppliedEvidenceConsistent,
44    AwaitingVerification,
45    VerifiedComplete,
46    VerificationFailed,
47}
48
49///
50/// ExternalUpgradeCompletionReportRequest
51///
52#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
53pub struct ExternalUpgradeCompletionReportRequest {
54    pub report_id: String,
55    pub proposal: ExternalUpgradeProposalV1,
56    pub consent_evidence: ExternalUpgradeConsentEvidenceV1,
57    pub verification_check: ExternalUpgradeVerificationCheckV1,
58}