-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixing start date to avoid event processing repetition (#187)
- Loading branch information
Showing
5 changed files
with
199 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use super::EventMetadata; | ||
use integrationos_domain::{prefix::IdPrefix, Id}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Serialize, Deserialize, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct DateChosen { | ||
#[serde(rename = "_id")] | ||
id: Id, | ||
reference: Id, | ||
starts_from: i64, | ||
ends_at: i64, | ||
} | ||
|
||
impl DateChosen { | ||
pub fn new(reference: Id, starts_from: i64, ends_at: i64) -> Self { | ||
Self { | ||
id: Id::now(IdPrefix::Archive), | ||
reference, | ||
starts_from, | ||
ends_at, | ||
} | ||
} | ||
|
||
pub fn event_date(&self) -> i64 { | ||
self.ends_at | ||
} | ||
} | ||
|
||
impl EventMetadata for DateChosen { | ||
fn reference(&self) -> Id { | ||
self.reference | ||
} | ||
} |
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
Oops, something went wrong.