Struct LetterLogic
pub struct LetterLogic {}
Implementations§
§impl LetterLogic
impl LetterLogic
pub fn create( conn: &PgConnection, letter1: Json<LetterRequest>, jwt_token: JwtToken, ) -> Result<LetterResponse, StatusMessage>
pub fn update( conn: &PgConnection, updated_letter1: Json<LetterRequest>, ) -> Result<LetterResponse, StatusMessage>
pub fn delete(conn: &PgConnection, id: Uuid) -> Result<usize, StatusMessage>
pub fn find( conn: &PgConnection, id: Uuid, ) -> Result<LetterResponse, StatusMessage>
pub fn get_credentials() -> Credentials
pub fn get_from_email() -> String
pub fn get_mail_server() -> String
pub fn make_letter( letter_dto: LetterCreateDto, pool: &PgConnection, org_id: Option<Uuid>, user_id: Uuid, name: Option<String>, ) -> Letter
pub fn render_send_save_letter<T>(
subject: Option<String>,
name: Option<String>,
email: Option<String>,
pool: &PgConnection,
user_id: Uuid,
org_id: Option<Uuid>,
template: Template,
data_for_template: T,
footer_dto: FooterDto,
header_dto: HeaderDto,
from_u: Option<Uuid>,
creds: Option<LetterCreds>,
attachment: Option<SinglePart>,
template_name: Option<Templates>,
) -> Result<Response, StatusMessage>where
T: Serialize,
pub fn send_singlepart( subject: Option<String>, name: Option<String>, email: Option<String>, text: String, credentials: Option<LetterCreds>, attachment: Option<SinglePart>, ) -> Result<Response, Error>
pub fn send_singlepart_save_letter( subject: Option<String>, name: Option<String>, email: Option<String>, text: String, letter: Option<Letter>, pool: Option<&PgConnection>, user_id: Uuid, credentials: Option<LetterCreds>, attachment: Option<SinglePart>, ) -> Result<Response, StatusMessage>
pub fn init_data_for_template<T>(entity: &T) -> BTreeMap<String, String>where
T: Serialize,
pub fn send_generic_dto_letter<T>( pool: &PgConnection, dto: T, org_id: Uuid, user_id: Uuid, template_name: Option<Templates>, ) -> Result<Response, StatusMessage>
pub fn get_template_from_resources( template: &Templates, locale: Option<String>, ) -> Option<Template>
pub fn get_template_and_header( pool: &PgConnection, template: Templates, locale: Option<String>, org_id: Option<Uuid>, ) -> Result<(Template, HeaderDto), StatusMessage>
pub fn send_registrations( pool: &PgConnection, send_registrations: SendRegistrationRequest, org_id: Option<Uuid>, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn notification_user( noti: NotificationUserRequest, ) -> Result<Response, StatusMessage>
pub fn notification_user_bulk( noti: Vec<NotificationUserRequest>, ) -> Result<(), StatusMessage>
pub fn send_password_to_user( pool: &PgConnection, send_password: SendPasswordToUserRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_enroll( pool: &PgConnection, enroll: EnrollRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, accept: bool, ) -> Result<Response, StatusMessage>
pub fn send_access_request( pool: &PgConnection, access_request: AccessRequestRequest, ) -> Result<Response, StatusMessage>
pub fn send_access_request_approve( pool: &PgConnection, access_request: AccessRequestApproveRequest, ) -> Result<Response, StatusMessage>
pub fn send_meeting_invitation( pool: &PgConnection, meeting_request: MeetingRequest, jwt_token: JwtToken, ) -> Result<Response, StatusMessage>
pub fn send_form_request( pool: &PgConnection, form_request: FormRequestRequest, jwt_token: JwtToken, headers: HeaderMap, loc: String, revoke: bool, ) -> Result<Response, StatusMessage>
pub fn redirect_enroll( pool: &PgConnection, redirect_enroll: RedirectEnrollRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_invitation( pool: &PgConnection, invitation: SendVerificationAndRecoveryRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, public_bytes: &Vec<u8>, ) -> Result<Response, StatusMessage>
pub fn send_support( request: SendSupportRequest, ) -> Result<Response, StatusMessage>
pub fn send_school_invitation( pool: &PgConnection, invitation: SendVerificationAndRecoveryRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_guest_request( pool: &PgConnection, guest_request: SendGuestRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_guest_feedback( pool: &PgConnection, guest_feedback: SendGuestFeedbackRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_verification( pool: &PgConnection, send_verification: SendVerificationAndRecoveryRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_approve_ur( pool: &PgConnection, send_approve_ur: SendApproveURRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_recovery( pool: &PgConnection, send_recovery: SendVerificationAndRecoveryRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn do_feedback( pool: &PgConnection, do_feedback: DoFeedbackRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn generate_calendar(cal_obj: Calendar) -> SinglePart
pub fn mailing_letters( pool: &PgConnection, mailing_letters: Vec<MailingLettersRequest>, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn resend_failed( conn: &PgConnection, resend_request: ResendFailedRequest, ) -> Result<Response, StatusMessage>
pub fn send_auth_code( app_data: Data<AppData>, jwt_token: JwtToken, _: HeaderMap, code: String, email: String, ) -> Result<StatusMessage, StatusMessage>
pub fn begin_events( pool: &PgConnection, begin_events: BeginEventRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn send_invitation_user_create( pool: &PgConnection, send_invitation_user_create: SendInvitationUserCreateRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn invite_registration_for_event( pool: &PgConnection, invite_reg_for_event: InviteRegistrationForEvent, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn notify_application_for_event( pool: &PgConnection, notify_app_for_event: NotifyApplicationForEventRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn notify_cancel( pool: &PgConnection, notify_cancel: NotifyCancelRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn notify_approve( pool: &PgConnection, notify_approve: NotifyApproveRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
pub fn notify_transmission( pool: &PgConnection, notify_transmission: NotifyTransmissionRequest, org_id: Uuid, user_id: Uuid, _user_role_id: Uuid, ) -> Result<Response, StatusMessage>
Auto Trait Implementations§
impl Freeze for LetterLogic
impl RefUnwindSafe for LetterLogic
impl Send for LetterLogic
impl Sync for LetterLogic
impl Unpin for LetterLogic
impl UnwindSafe for LetterLogic
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.