made_core/value_objects/delivery/
attention_summary.rs1use serde::{Deserialize, Serialize};
2use time::OffsetDateTime;
3
4use super::{AttentionEventId, AttentionKind, AttentionReason};
5
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
12pub struct AttentionSummary {
13 id: AttentionEventId,
14 kind: AttentionKind,
15 #[serde(with = "time::serde::rfc3339")]
16 occurred_at: OffsetDateTime,
17 reason: AttentionReason,
18}
19
20impl AttentionSummary {
21 #[must_use]
22 pub const fn new(
23 id: AttentionEventId,
24 kind: AttentionKind,
25 occurred_at: OffsetDateTime,
26 reason: AttentionReason,
27 ) -> Self {
28 Self {
29 id,
30 kind,
31 occurred_at,
32 reason,
33 }
34 }
35
36 #[must_use]
37 pub const fn id(&self) -> &AttentionEventId {
38 &self.id
39 }
40
41 #[must_use]
42 pub const fn kind(&self) -> AttentionKind {
43 self.kind
44 }
45
46 #[must_use]
47 pub const fn occurred_at(&self) -> OffsetDateTime {
48 self.occurred_at
49 }
50
51 #[must_use]
52 pub const fn reason(&self) -> &AttentionReason {
53 &self.reason
54 }
55}