Skip to content

Commit

Permalink
add cve impl
Browse files Browse the repository at this point in the history
  • Loading branch information
n1nj4t4nuk1 committed Dec 2, 2024
1 parent 4f45c19 commit 08ea760
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions libs/cti/src/cves/domain/entities/cve.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use aggregate_root::domain::aggregate_root::AggregateRoot;

use super::{cve_description::CveDescription, cve_id::CveId, cve_publication_date::CvePublicationDate, cve_state::CveState};


Expand All @@ -7,4 +9,37 @@ pub struct Cve {
pub date_published: CvePublicationDate,

pub description: CveDescription,
}

impl Cve {
pub fn new(
id: CveId,
state: CveState,
date_published: CvePublicationDate,
description: CveDescription
) -> Self {
Self {
id,
state,
date_published,
description,
}
}
}

impl AggregateRoot for Cve {
fn get_type() -> String {
"com.tanukibox.tanuki-library.cti.cve".to_string()
}
}

impl Clone for Cve {
fn clone(&self) -> Self {
Self::new(
self.id.clone(),
self.state.clone(),
self.date_published.clone(),
self.description.clone(),
)
}
}

0 comments on commit 08ea760

Please sign in to comment.