Skip to content

Commit

Permalink
chore: expose created_at fn for entry entity (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
thevaibhav-dixit authored Feb 11, 2025
1 parent 1be4c79 commit 14ae6db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cala-ledger/src/entry/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ impl Entry {
pub fn into_values(self) -> EntryValues {
self.values
}

pub fn created_at(&self) -> chrono::DateTime<chrono::Utc> {
self.events
.entity_first_persisted_at()
.expect("Entity not persisted")
}
}

impl TryFromEvents<EntryEvent> for Entry {
Expand Down

0 comments on commit 14ae6db

Please sign in to comment.