1use chrono::{DateTime, Utc};
2
3use crate::prelude::SnowFlake;
4
5#[derive(Debug, Clone)]
6pub struct OutBox {
7 pub id: i64,
8 pub aggregate_id: String,
9 pub aggregate_name: String,
10 pub topic: String,
11 pub state: String,
12 pub processed: bool,
13 pub create_dt: DateTime<Utc>,
14}
15
16impl OutBox {
17 pub fn new(aggregate_id: String, aggregate_name: String, topic: String, state: String) -> Self {
18 Self {
19 id: *SnowFlake::generate(),
20 aggregate_id,
21 aggregate_name,
22 topic,
23 state,
24 processed: false,
25 create_dt: Default::default(),
26 }
27 }
28}