-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34d2bc8
commit 5e19c24
Showing
4 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,20 @@ use events::domain::domain_event::DomainEvent; | |
use crate::cves::domain::entities::{cve_description::CveDescription, cve_id::CveId, cve_publication_date::CvePublicationDate, cve_state::CveState}; | ||
|
||
|
||
pub struct CveCreatedEvent { | ||
pub struct CveCreatedEvent<'a> { | ||
pub id: String, | ||
|
||
pub cve_id: CveId, | ||
pub cve_id: &'a CveId, | ||
pub cve_state: CveState, | ||
pub cve_date_published: CvePublicationDate, | ||
pub cve_description: CveDescription, | ||
|
||
pub occurred_on: String, | ||
} | ||
|
||
impl CveCreatedEvent { | ||
impl<'a> CveCreatedEvent<'a> { | ||
pub fn new( | ||
cve_id: CveId, | ||
cve_id: &'a CveId, | ||
cve_state: CveState, | ||
cve_date_published: CvePublicationDate, | ||
cve_description: CveDescription, | ||
|
@@ -28,7 +28,7 @@ impl CveCreatedEvent { | |
} | ||
|
||
pub fn new_shared( | ||
cve_id: CveId, | ||
cve_id: &'a CveId, | ||
cve_state: CveState, | ||
cve_date_published: CvePublicationDate, | ||
cve_description: CveDescription, | ||
|
@@ -37,16 +37,16 @@ impl CveCreatedEvent { | |
} | ||
} | ||
|
||
impl DomainEvent for CveCreatedEvent { | ||
impl<'a> DomainEvent for CveCreatedEvent<'a> { | ||
fn event_type(&self) -> String { | ||
"[email protected]".to_string() | ||
} | ||
} | ||
|
||
impl Clone for CveCreatedEvent { | ||
impl<'a> Clone for CveCreatedEvent<'a> { | ||
fn clone(&self) -> Self { | ||
let mut event = Self::new( | ||
self.cve_id.clone(), | ||
self.cve_id, | ||
self.cve_state.clone(), | ||
self.cve_date_published.clone(), | ||
self.cve_description.clone(), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters