1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use crate::value_objects::Specialty;
use super::RoleId;
/// Who sits in a role's seat for one working session.
///
/// A definition says what a role *does*; it does not say who plays it.
/// Left alone, that is settled by the step's own configuration, the
/// same way for every session the ceremony ever runs. A binding is how
/// one session says otherwise: this review is being done by the panel
/// that knows this system, not by whoever the document names in
/// general.
///
/// What is bound is a specialty, because a specialty is what the
/// engine already resolves a council from. Seating a different panel
/// *is* choosing a different council, so binding a specialty says
/// exactly that and nothing is invented alongside the machinery that
/// already decides who deliberates.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CeremonyParticipantBinding {
role_id: RoleId,
specialty: Specialty,
#[serde(with = "time::serde::rfc3339")]
bound_at: OffsetDateTime,
}
impl CeremonyParticipantBinding {
#[must_use]
pub fn record(role_id: RoleId, specialty: Specialty, bound_at: OffsetDateTime) -> Self {
Self {
role_id,
specialty,
bound_at,
}
}
#[must_use]
pub fn role_id(&self) -> &RoleId {
&self.role_id
}
#[must_use]
pub fn specialty(&self) -> &Specialty {
&self.specialty
}
#[must_use]
pub fn bound_at(&self) -> OffsetDateTime {
self.bound_at
}
}