made_core/value_objects/ceremony/
step_deadline.rs1use super::{
2 RoleId, StateIteration, StateVisit, StepAttempt, StepClaimFence, StepId, StepIteration,
3};
4use serde::{Deserialize, Serialize};
5use time::OffsetDateTime;
6
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8pub struct StepDeadline {
9 step_id: StepId,
10 state_visit: StateVisit,
11 state_iteration: StateIteration,
12 step_iteration: StepIteration,
13 attempt: StepAttempt,
14 claim_fence: StepClaimFence,
15 finished_by: RoleId,
16 #[serde(with = "time::serde::rfc3339")]
17 at: OffsetDateTime,
18}
19impl StepDeadline {
20 #[allow(clippy::too_many_arguments)]
21 #[must_use]
22 pub fn new(
23 step_id: StepId,
24 state_visit: StateVisit,
25 state_iteration: StateIteration,
26 step_iteration: StepIteration,
27 attempt: StepAttempt,
28 claim_fence: StepClaimFence,
29 finished_by: RoleId,
30 at: OffsetDateTime,
31 ) -> Self {
32 Self {
33 step_id,
34 state_visit,
35 state_iteration,
36 step_iteration,
37 attempt,
38 claim_fence,
39 finished_by,
40 at,
41 }
42 }
43 #[must_use]
44 pub fn step_id(&self) -> &StepId {
45 &self.step_id
46 }
47 #[must_use]
48 pub fn state_visit(&self) -> StateVisit {
49 self.state_visit
50 }
51 #[must_use]
52 pub fn state_iteration(&self) -> StateIteration {
53 self.state_iteration
54 }
55 #[must_use]
56 pub fn step_iteration(&self) -> StepIteration {
57 self.step_iteration
58 }
59 #[must_use]
60 pub fn attempt(&self) -> StepAttempt {
61 self.attempt
62 }
63 #[must_use]
64 pub fn claim_fence(&self) -> &StepClaimFence {
65 &self.claim_fence
66 }
67 #[must_use]
68 pub fn finished_by(&self) -> &RoleId {
69 &self.finished_by
70 }
71 #[must_use]
72 pub fn at(&self) -> OffsetDateTime {
73 self.at
74 }
75}