pub struct ConvocationRecipient {Show 15 fields
pub id: Uuid,
pub convocation_id: Uuid,
pub owner_id: Uuid,
pub email: String,
pub email_sent_at: Option<DateTime<Utc>>,
pub email_opened_at: Option<DateTime<Utc>>,
pub email_failed: bool,
pub email_failure_reason: Option<String>,
pub reminder_sent_at: Option<DateTime<Utc>>,
pub reminder_opened_at: Option<DateTime<Utc>>,
pub attendance_status: AttendanceStatus,
pub attendance_updated_at: Option<DateTime<Utc>>,
pub proxy_owner_id: Option<Uuid>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Individual recipient of a convocation
Tracks delivery, opening, and attendance for each owner
Fields§
§id: Uuid§convocation_id: Uuid§owner_id: Uuid§email: String§email_sent_at: Option<DateTime<Utc>>§email_opened_at: Option<DateTime<Utc>>§email_failed: bool§email_failure_reason: Option<String>§reminder_sent_at: Option<DateTime<Utc>>§reminder_opened_at: Option<DateTime<Utc>>§attendance_status: AttendanceStatus§attendance_updated_at: Option<DateTime<Utc>>§proxy_owner_id: Option<Uuid>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl ConvocationRecipient
impl ConvocationRecipient
Sourcepub fn new(
convocation_id: Uuid,
owner_id: Uuid,
email: String,
) -> Result<Self, String>
pub fn new( convocation_id: Uuid, owner_id: Uuid, email: String, ) -> Result<Self, String>
Create a new convocation recipient
Sourcepub fn mark_email_sent(&mut self)
pub fn mark_email_sent(&mut self)
Mark email as sent
Sourcepub fn mark_email_failed(&mut self, reason: String)
pub fn mark_email_failed(&mut self, reason: String)
Mark email as failed
Sourcepub fn mark_email_opened(&mut self) -> Result<(), String>
pub fn mark_email_opened(&mut self) -> Result<(), String>
Mark email as opened (read receipt)
Sourcepub fn mark_reminder_sent(&mut self) -> Result<(), String>
pub fn mark_reminder_sent(&mut self) -> Result<(), String>
Mark reminder as sent
Sourcepub fn mark_reminder_opened(&mut self) -> Result<(), String>
pub fn mark_reminder_opened(&mut self) -> Result<(), String>
Mark reminder as opened
Sourcepub fn update_attendance_status(
&mut self,
status: AttendanceStatus,
) -> Result<(), String>
pub fn update_attendance_status( &mut self, status: AttendanceStatus, ) -> Result<(), String>
Update attendance status
Sourcepub fn remove_proxy(&mut self)
pub fn remove_proxy(&mut self)
Remove proxy delegation
Sourcepub fn has_opened_email(&self) -> bool
pub fn has_opened_email(&self) -> bool
Check if email was opened
Sourcepub fn has_opened_reminder(&self) -> bool
pub fn has_opened_reminder(&self) -> bool
Check if reminder was opened
Sourcepub fn needs_reminder(&self) -> bool
pub fn needs_reminder(&self) -> bool
Check if recipient needs reminder (email sent but not opened, no reminder sent yet)
Sourcepub fn has_confirmed_attendance(&self) -> bool
pub fn has_confirmed_attendance(&self) -> bool
Check if owner has confirmed attendance (either will attend or will not attend)
Sourcepub fn days_since_email_sent(&self) -> Option<i64>
pub fn days_since_email_sent(&self) -> Option<i64>
Get days since email sent (if sent)
Trait Implementations§
Source§impl Clone for ConvocationRecipient
impl Clone for ConvocationRecipient
Source§fn clone(&self) -> ConvocationRecipient
fn clone(&self) -> ConvocationRecipient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConvocationRecipient
impl Debug for ConvocationRecipient
Source§impl<'de> Deserialize<'de> for ConvocationRecipient
impl<'de> Deserialize<'de> for ConvocationRecipient
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ConvocationRecipient> for ConvocationRecipientResponse
impl From<ConvocationRecipient> for ConvocationRecipientResponse
Source§fn from(recipient: ConvocationRecipient) -> Self
fn from(recipient: ConvocationRecipient) -> Self
Converts to this type from the input type.
Source§impl From<ConvocationRecipient> for RecipientSummaryResponse
impl From<ConvocationRecipient> for RecipientSummaryResponse
Source§fn from(recipient: ConvocationRecipient) -> Self
fn from(recipient: ConvocationRecipient) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ConvocationRecipient
impl RefUnwindSafe for ConvocationRecipient
impl Send for ConvocationRecipient
impl Sync for ConvocationRecipient
impl Unpin for ConvocationRecipient
impl UnwindSafe for ConvocationRecipient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.