diff --git a/scheduler/clients/rust/src/calendar.rs b/scheduler/clients/rust/src/calendar.rs index 92b60807..50cac8c8 100644 --- a/scheduler/clients/rust/src/calendar.rs +++ b/scheduler/clients/rust/src/calendar.rs @@ -3,14 +3,17 @@ use std::sync::Arc; use nettu_scheduler_api_structs::*; use nettu_scheduler_domain::{ providers::{google::GoogleCalendarAccessRole, outlook::OutlookCalendarAccessRole}, - IntegrationProvider, Metadata, ID, + IntegrationProvider, + Metadata, + ID, }; use reqwest::StatusCode; use crate::{ base::{APIResponse, BaseClient}, shared::MetadataFindInput, - Tz, Weekday, + Tz, + Weekday, }; #[derive(Clone)] diff --git a/scheduler/clients/rust/src/event.rs b/scheduler/clients/rust/src/event.rs index 1519eae3..ebaa4cb8 100644 --- a/scheduler/clients/rust/src/event.rs +++ b/scheduler/clients/rust/src/event.rs @@ -6,7 +6,12 @@ use reqwest::StatusCode; use serde::Serialize; use crate::{ - shared::MetadataFindInput, APIResponse, BaseClient, CalendarEventReminder, RRuleOptions, ID, + shared::MetadataFindInput, + APIResponse, + BaseClient, + CalendarEventReminder, + RRuleOptions, + ID, }; #[derive(Clone)] diff --git a/scheduler/clients/rust/src/lib.rs b/scheduler/clients/rust/src/lib.rs index 90ac146b..e5db5e0a 100644 --- a/scheduler/clients/rust/src/lib.rs +++ b/scheduler/clients/rust/src/lib.rs @@ -15,42 +15,77 @@ pub(crate) use base::BaseClient; pub use base::{APIError, APIErrorVariant, APIResponse}; use calendar::CalendarClient; pub use calendar::{ - CreateCalendarInput, GetCalendarEventsInput, GetGoogleCalendars, GetOutlookCalendars, - StopCalendarSyncInput, SyncCalendarInput, UpdateCalendarInput, + CreateCalendarInput, + GetCalendarEventsInput, + GetGoogleCalendars, + GetOutlookCalendars, + StopCalendarSyncInput, + SyncCalendarInput, + UpdateCalendarInput, }; use event::CalendarEventClient; pub use event::{CreateEventInput, GetEventsInstancesInput, UpdateEventInput}; // Domain pub use nettu_scheduler_api_structs::dtos::{ - AccountDTO as Account, AccountSettingsDTO as AccountSettings, - AccountWebhookSettingsDTO as AccountWebhookSettings, CalendarDTO as Calendar, - CalendarEventDTO as CalendarEvent, CalendarSettingsDTO as CalendarSettings, - EventWithInstancesDTO as EventWithIInstances, ScheduleDTO as Schedule, - ServiceResourceDTO as ServiceResource, ServiceWithUsersDTO as Service, UserDTO as User, + AccountDTO as Account, + AccountSettingsDTO as AccountSettings, + AccountWebhookSettingsDTO as AccountWebhookSettings, + CalendarDTO as Calendar, + CalendarEventDTO as CalendarEvent, + CalendarSettingsDTO as CalendarSettings, + EventWithInstancesDTO as EventWithIInstances, + ScheduleDTO as Schedule, + ServiceResourceDTO as ServiceResource, + ServiceWithUsersDTO as Service, + UserDTO as User, }; pub use nettu_scheduler_api_structs::{ - dtos::*, send_event_reminders::AccountRemindersDTO as AccountReminders, + dtos::*, + send_event_reminders::AccountRemindersDTO as AccountReminders, }; pub use nettu_scheduler_domain::{ providers::{google::*, outlook::*}, scheduling::RoundRobinAlgorithm, - BusyCalendar, CalendarEventReminder, IntegrationProvider, Metadata, Month, RRuleFrequency, - RRuleOptions, ScheduleRule, ServiceMultiPersonOptions, SyncedCalendar, TimePlan, Tz, WeekDay, - Weekday, ID, + BusyCalendar, + CalendarEventReminder, + IntegrationProvider, + Metadata, + Month, + RRuleFrequency, + RRuleOptions, + ScheduleRule, + ServiceMultiPersonOptions, + SyncedCalendar, + TimePlan, + Tz, + WeekDay, + Weekday, + ID, }; use schedule::ScheduleClient; pub use schedule::{CreateScheduleInput, UpdateScheduleInput}; use service::ServiceClient; pub use service::{ - AddBusyCalendar, AddServiceUserInput, CreateBookingIntendInput, CreateServiceInput, - GetServiceBookingSlotsInput, RemoveBookingIntendInput, RemoveBusyCalendar, - RemoveServiceUserInput, UpdateServiceInput, UpdateServiceUserInput, + AddBusyCalendar, + AddServiceUserInput, + CreateBookingIntendInput, + CreateServiceInput, + GetServiceBookingSlotsInput, + RemoveBookingIntendInput, + RemoveBusyCalendar, + RemoveServiceUserInput, + UpdateServiceInput, + UpdateServiceUserInput, }; pub use shared::{KVMetadata, MetadataFindInput}; use status::StatusClient; use user::UserClient; pub use user::{ - CreateUserInput, GetUserFreeBusyInput, OAuthInput, RemoveUserIntegrationInput, UpdateUserInput, + CreateUserInput, + GetUserFreeBusyInput, + OAuthInput, + RemoveUserIntegrationInput, + UpdateUserInput, }; /// Nettu Scheduler Server SDK diff --git a/scheduler/crates/api/src/calendar/add_sync_calendar.rs b/scheduler/crates/api/src/calendar/add_sync_calendar.rs index b0951d41..12542e16 100644 --- a/scheduler/crates/api/src/calendar/add_sync_calendar.rs +++ b/scheduler/crates/api/src/calendar/add_sync_calendar.rs @@ -2,10 +2,14 @@ use actix_web::{web, HttpRequest, HttpResponse}; use nettu_scheduler_api_structs::add_sync_calendar::{APIResponse, PathParams, RequestBody}; use nettu_scheduler_domain::{ providers::{google::GoogleCalendarAccessRole, outlook::OutlookCalendarAccessRole}, - IntegrationProvider, SyncedCalendar, User, ID, + IntegrationProvider, + SyncedCalendar, + User, + ID, }; use nettu_scheduler_infra::{ - google_calendar::GoogleCalendarProvider, outlook_calendar::OutlookCalendarProvider, + google_calendar::GoogleCalendarProvider, + outlook_calendar::OutlookCalendarProvider, NettuContext, }; diff --git a/scheduler/crates/api/src/calendar/mod.rs b/scheduler/crates/api/src/calendar/mod.rs index 1b9df628..be867311 100644 --- a/scheduler/crates/api/src/calendar/mod.rs +++ b/scheduler/crates/api/src/calendar/mod.rs @@ -18,10 +18,12 @@ use get_calendar::{get_calendar_admin_controller, get_calendar_controller}; use get_calendar_events::{get_calendar_events_admin_controller, get_calendar_events_controller}; use get_calendars_by_meta::get_calendars_by_meta_controller; use get_google_calendars::{ - get_google_calendars_admin_controller, get_google_calendars_controller, + get_google_calendars_admin_controller, + get_google_calendars_controller, }; use get_outlook_calendars::{ - get_outlook_calendars_admin_controller, get_outlook_calendars_controller, + get_outlook_calendars_admin_controller, + get_outlook_calendars_controller, }; use remove_sync_calendar::remove_sync_calendar_admin_controller; use update_calendar::{update_calendar_admin_controller, update_calendar_controller}; diff --git a/scheduler/crates/api/src/calendar/update_calendar.rs b/scheduler/crates/api/src/calendar/update_calendar.rs index ec6564d3..23e3c94a 100644 --- a/scheduler/crates/api/src/calendar/update_calendar.rs +++ b/scheduler/crates/api/src/calendar/update_calendar.rs @@ -9,8 +9,11 @@ use crate::{ error::NettuError, shared::{ auth::{ - account_can_modify_calendar, account_can_modify_user, protect_account_route, - protect_route, Permission, + account_can_modify_calendar, + account_can_modify_user, + protect_account_route, + protect_route, + Permission, }, usecase::{execute, execute_with_policy, PermissionBoundary, UseCase}, }, diff --git a/scheduler/crates/api/src/event/create_event.rs b/scheduler/crates/api/src/event/create_event.rs index a3fcc7da..2ab8dd43 100644 --- a/scheduler/crates/api/src/event/create_event.rs +++ b/scheduler/crates/api/src/event/create_event.rs @@ -1,7 +1,12 @@ use actix_web::{web, HttpRequest, HttpResponse}; use nettu_scheduler_api_structs::create_event::*; use nettu_scheduler_domain::{ - CalendarEvent, CalendarEventReminder, Metadata, RRuleOptions, User, ID, + CalendarEvent, + CalendarEventReminder, + Metadata, + RRuleOptions, + User, + ID, }; use nettu_scheduler_infra::NettuContext; diff --git a/scheduler/crates/api/src/event/delete_event.rs b/scheduler/crates/api/src/event/delete_event.rs index 3765db30..67407fea 100644 --- a/scheduler/crates/api/src/event/delete_event.rs +++ b/scheduler/crates/api/src/event/delete_event.rs @@ -2,7 +2,8 @@ use actix_web::{web, HttpRequest, HttpResponse}; use nettu_scheduler_api_structs::delete_event::*; use nettu_scheduler_domain::{CalendarEvent, IntegrationProvider, User, ID}; use nettu_scheduler_infra::{ - google_calendar::GoogleCalendarProvider, outlook_calendar::OutlookCalendarProvider, + google_calendar::GoogleCalendarProvider, + outlook_calendar::OutlookCalendarProvider, NettuContext, }; use tracing::error; @@ -11,8 +12,11 @@ use crate::{ error::NettuError, shared::{ auth::{ - account_can_modify_event, account_can_modify_user, protect_account_route, - protect_route, Permission, + account_can_modify_event, + account_can_modify_user, + protect_account_route, + protect_route, + Permission, }, usecase::{execute, execute_with_policy, PermissionBoundary, UseCase}, }, diff --git a/scheduler/crates/api/src/event/subscribers/mod.rs b/scheduler/crates/api/src/event/subscribers/mod.rs index 62c6371f..1a2ed13e 100644 --- a/scheduler/crates/api/src/event/subscribers/mod.rs +++ b/scheduler/crates/api/src/event/subscribers/mod.rs @@ -1,6 +1,7 @@ use nettu_scheduler_domain::{CalendarEvent, IntegrationProvider, SyncedCalendarEvent}; use nettu_scheduler_infra::{ - google_calendar::GoogleCalendarProvider, outlook_calendar::OutlookCalendarProvider, + google_calendar::GoogleCalendarProvider, + outlook_calendar::OutlookCalendarProvider, }; use tracing::{error, info}; diff --git a/scheduler/crates/api/src/event/update_event.rs b/scheduler/crates/api/src/event/update_event.rs index a7a81419..c196b410 100644 --- a/scheduler/crates/api/src/event/update_event.rs +++ b/scheduler/crates/api/src/event/update_event.rs @@ -2,7 +2,12 @@ use actix_web::{web, HttpRequest, HttpResponse}; use event::subscribers::SyncRemindersOnEventUpdated; use nettu_scheduler_api_structs::update_event::*; use nettu_scheduler_domain::{ - CalendarEvent, CalendarEventReminder, Metadata, RRuleOptions, User, ID, + CalendarEvent, + CalendarEventReminder, + Metadata, + RRuleOptions, + User, + ID, }; use nettu_scheduler_infra::NettuContext; @@ -11,8 +16,11 @@ use crate::{ event::{self, subscribers::UpdateSyncedEventsOnEventUpdated}, shared::{ auth::{ - account_can_modify_event, account_can_modify_user, protect_account_route, - protect_route, Permission, + account_can_modify_event, + account_can_modify_user, + protect_account_route, + protect_route, + Permission, }, usecase::{execute, execute_with_policy, PermissionBoundary, Subscriber, UseCase}, }, diff --git a/scheduler/crates/api/src/lib.rs b/scheduler/crates/api/src/lib.rs index e419bedb..4164d5b7 100644 --- a/scheduler/crates/api/src/lib.rs +++ b/scheduler/crates/api/src/lib.rs @@ -15,7 +15,12 @@ use actix_cors::Cors; use actix_web::{dev::Server, middleware, web, web::Data, App, HttpServer}; use job_schedulers::{start_reminder_generation_job_scheduler, start_send_reminders_job}; use nettu_scheduler_domain::{ - Account, AccountIntegration, AccountWebhookSettings, IntegrationProvider, PEMKey, ID, + Account, + AccountIntegration, + AccountWebhookSettings, + IntegrationProvider, + PEMKey, + ID, }; use nettu_scheduler_infra::NettuContext; use tracing::warn; diff --git a/scheduler/crates/api/src/service/add_busy_calendar.rs b/scheduler/crates/api/src/service/add_busy_calendar.rs index f108c1a4..66a0c77a 100644 --- a/scheduler/crates/api/src/service/add_busy_calendar.rs +++ b/scheduler/crates/api/src/service/add_busy_calendar.rs @@ -2,11 +2,17 @@ use actix_web::{web, HttpRequest, HttpResponse}; use nettu_scheduler_api_structs::add_busy_calendar::*; use nettu_scheduler_domain::{ providers::{google::GoogleCalendarAccessRole, outlook::OutlookCalendarAccessRole}, - Account, BusyCalendar, IntegrationProvider, ID, + Account, + BusyCalendar, + IntegrationProvider, + ID, }; use nettu_scheduler_infra::{ - google_calendar::GoogleCalendarProvider, outlook_calendar::OutlookCalendarProvider, - BusyCalendarIdentifier, ExternalBusyCalendarIdentifier, NettuContext, + google_calendar::GoogleCalendarProvider, + outlook_calendar::OutlookCalendarProvider, + BusyCalendarIdentifier, + ExternalBusyCalendarIdentifier, + NettuContext, }; use crate::{ diff --git a/scheduler/crates/api/src/service/create_service_event_intend.rs b/scheduler/crates/api/src/service/create_service_event_intend.rs index f280c6a2..b0876608 100644 --- a/scheduler/crates/api/src/service/create_service_event_intend.rs +++ b/scheduler/crates/api/src/service/create_service_event_intend.rs @@ -6,10 +6,13 @@ use nettu_scheduler_api_structs::create_service_event_intend::*; use nettu_scheduler_domain::{ format_date, scheduling::{ - RoundRobinAlgorithm, RoundRobinAvailabilityAssignment, + RoundRobinAlgorithm, + RoundRobinAvailabilityAssignment, RoundRobinEqualDistributionAssignment, }, - ServiceMultiPersonOptions, User, ID, + ServiceMultiPersonOptions, + User, + ID, }; use nettu_scheduler_infra::NettuContext; diff --git a/scheduler/crates/api/src/service/get_service_bookingslots.rs b/scheduler/crates/api/src/service/get_service_bookingslots.rs index a6032d1a..69084afc 100644 --- a/scheduler/crates/api/src/service/get_service_bookingslots.rs +++ b/scheduler/crates/api/src/service/get_service_bookingslots.rs @@ -3,16 +3,33 @@ use futures::future::join_all; use nettu_scheduler_api_structs::get_service_bookingslots::*; use nettu_scheduler_domain::{ booking_slots::{ - get_service_bookingslots, validate_bookingslots_query, validate_slots_interval, - BookingQueryError, BookingSlotsOptions, BookingSlotsQuery, ServiceBookingSlots, + get_service_bookingslots, + validate_bookingslots_query, + validate_slots_interval, + BookingQueryError, + BookingSlotsOptions, + BookingSlotsQuery, + ServiceBookingSlots, UserFreeEvents, }, - get_free_busy, BusyCalendar, Calendar, CompatibleInstances, EventInstance, - ServiceMultiPersonOptions, ServiceResource, ServiceWithUsers, TimePlan, TimeSpan, Tz, ID, + get_free_busy, + BusyCalendar, + Calendar, + CompatibleInstances, + EventInstance, + ServiceMultiPersonOptions, + ServiceResource, + ServiceWithUsers, + TimePlan, + TimeSpan, + Tz, + ID, }; use nettu_scheduler_infra::{ - google_calendar::GoogleCalendarProvider, outlook_calendar::OutlookCalendarProvider, - FreeBusyProviderQuery, NettuContext, + google_calendar::GoogleCalendarProvider, + outlook_calendar::OutlookCalendarProvider, + FreeBusyProviderQuery, + NettuContext, }; use tracing::error; @@ -482,7 +499,13 @@ mod test { use chrono::{prelude::*, Utc}; use nettu_scheduler_domain::{ - Account, Calendar, CalendarEvent, RRuleOptions, Service, ServiceResource, User, + Account, + Calendar, + CalendarEvent, + RRuleOptions, + Service, + ServiceResource, + User, }; use nettu_scheduler_infra::{setup_context, ISys}; diff --git a/scheduler/crates/api/src/service/update_service_user.rs b/scheduler/crates/api/src/service/update_service_user.rs index 82a16f94..f87194e1 100644 --- a/scheduler/crates/api/src/service/update_service_user.rs +++ b/scheduler/crates/api/src/service/update_service_user.rs @@ -4,7 +4,9 @@ use nettu_scheduler_domain::{Account, ServiceResource, TimePlan, ID}; use nettu_scheduler_infra::NettuContext; use super::add_user_to_service::{ - update_resource_values, ServiceResourceUpdate, UpdateServiceResourceError, + update_resource_values, + ServiceResourceUpdate, + UpdateServiceResourceError, }; use crate::{ error::NettuError, diff --git a/scheduler/crates/api/src/shared/auth/mod.rs b/scheduler/crates/api/src/shared/auth/mod.rs index 5e4db9f1..7fcd3557 100644 --- a/scheduler/crates/api/src/shared/auth/mod.rs +++ b/scheduler/crates/api/src/shared/auth/mod.rs @@ -3,6 +3,11 @@ mod route_guards; pub use policy::{Permission, Policy}; pub use route_guards::{ - account_can_modify_calendar, account_can_modify_event, account_can_modify_schedule, - account_can_modify_user, protect_account_route, protect_public_account_route, protect_route, + account_can_modify_calendar, + account_can_modify_event, + account_can_modify_schedule, + account_can_modify_user, + protect_account_route, + protect_public_account_route, + protect_route, }; diff --git a/scheduler/crates/api_structs/src/calendar/api.rs b/scheduler/crates/api_structs/src/calendar/api.rs index 927dc5a3..1cecaa4b 100644 --- a/scheduler/crates/api_structs/src/calendar/api.rs +++ b/scheduler/crates/api_structs/src/calendar/api.rs @@ -178,7 +178,8 @@ pub mod get_calendars_by_meta { pub mod get_google_calendars { use nettu_scheduler_domain::providers::google::{ - GoogleCalendarAccessRole, GoogleCalendarListEntry, + GoogleCalendarAccessRole, + GoogleCalendarListEntry, }; use super::*; diff --git a/scheduler/crates/api_structs/src/event/api.rs b/scheduler/crates/api_structs/src/event/api.rs index 3cc6e4ff..251407b5 100644 --- a/scheduler/crates/api_structs/src/event/api.rs +++ b/scheduler/crates/api_structs/src/event/api.rs @@ -1,5 +1,9 @@ use nettu_scheduler_domain::{ - CalendarEvent, CalendarEventReminder, EventInstance, RRuleOptions, ID, + CalendarEvent, + CalendarEventReminder, + EventInstance, + RRuleOptions, + ID, }; use serde::{Deserialize, Serialize}; diff --git a/scheduler/crates/api_structs/src/event/dtos.rs b/scheduler/crates/api_structs/src/event/dtos.rs index 36d70920..0579c228 100644 --- a/scheduler/crates/api_structs/src/event/dtos.rs +++ b/scheduler/crates/api_structs/src/event/dtos.rs @@ -1,5 +1,10 @@ use nettu_scheduler_domain::{ - CalendarEvent, CalendarEventReminder, EventInstance, Metadata, RRuleOptions, ID, + CalendarEvent, + CalendarEventReminder, + EventInstance, + Metadata, + RRuleOptions, + ID, }; use serde::{Deserialize, Serialize}; diff --git a/scheduler/crates/api_structs/src/lib.rs b/scheduler/crates/api_structs/src/lib.rs index fa3d7897..732e647a 100644 --- a/scheduler/crates/api_structs/src/lib.rs +++ b/scheduler/crates/api_structs/src/lib.rs @@ -7,11 +7,20 @@ mod status; mod user; pub mod dtos { pub use crate::{ - account::dtos::*, calendar::dtos::*, event::dtos::*, schedule::dtos::*, service::dtos::*, + account::dtos::*, + calendar::dtos::*, + event::dtos::*, + schedule::dtos::*, + service::dtos::*, user::dtos::*, }; } pub use crate::{ - account::api::*, calendar::api::*, event::api::*, schedule::api::*, service::api::*, - status::api::*, user::api::*, + account::api::*, + calendar::api::*, + event::api::*, + schedule::api::*, + service::api::*, + status::api::*, + user::api::*, }; diff --git a/scheduler/crates/api_structs/src/service/api.rs b/scheduler/crates/api_structs/src/service/api.rs index 3a76fb31..a2b3b811 100644 --- a/scheduler/crates/api_structs/src/service/api.rs +++ b/scheduler/crates/api_structs/src/service/api.rs @@ -1,5 +1,11 @@ use nettu_scheduler_domain::{ - BusyCalendar, Service, ServiceResource, ServiceWithUsers, TimePlan, Tz, ID, + BusyCalendar, + Service, + ServiceResource, + ServiceWithUsers, + TimePlan, + Tz, + ID, }; use serde::{Deserialize, Serialize}; @@ -215,7 +221,9 @@ pub mod update_service { pub mod get_service_bookingslots { use nettu_scheduler_domain::booking_slots::{ - ServiceBookingSlot, ServiceBookingSlots, ServiceBookingSlotsDate, + ServiceBookingSlot, + ServiceBookingSlots, + ServiceBookingSlotsDate, }; use super::*; diff --git a/scheduler/crates/domain/src/calendar.rs b/scheduler/crates/domain/src/calendar.rs index 845af181..a1a7d1d2 100644 --- a/scheduler/crates/domain/src/calendar.rs +++ b/scheduler/crates/domain/src/calendar.rs @@ -6,7 +6,9 @@ use crate::{ entity::{Entity, ID}, metadata::Metadata, }, - IntegrationProvider, Meta, Weekday, + IntegrationProvider, + Meta, + Weekday, }; #[derive(Debug, Clone)] diff --git a/scheduler/crates/domain/src/event.rs b/scheduler/crates/domain/src/event.rs index 8b8f1131..5062bac3 100644 --- a/scheduler/crates/domain/src/event.rs +++ b/scheduler/crates/domain/src/event.rs @@ -11,7 +11,8 @@ use crate::{ recurrence::RRuleOptions, }, timespan::TimeSpan, - IntegrationProvider, Meta, + IntegrationProvider, + Meta, }; #[derive(Debug, Clone, Default)] diff --git a/scheduler/crates/domain/src/lib.rs b/scheduler/crates/domain/src/lib.rs index edb87811..a7a7ae47 100644 --- a/scheduler/crates/domain/src/lib.rs +++ b/scheduler/crates/domain/src/lib.rs @@ -20,12 +20,21 @@ pub use chrono_tz::Tz; pub use date::format_date; pub use event::{CalendarEvent, CalendarEventReminder, SyncedCalendarEvent}; pub use event_instance::{ - get_free_busy, CompatibleInstances, EventInstance, EventWithInstances, FreeBusy, + get_free_busy, + CompatibleInstances, + EventInstance, + EventWithInstances, + FreeBusy, }; pub use reminder::{EventRemindersExpansionJob, Reminder}; pub use schedule::{Schedule, ScheduleRule}; pub use service::{ - BusyCalendar, Service, ServiceMultiPersonOptions, ServiceResource, ServiceWithUsers, TimePlan, + BusyCalendar, + Service, + ServiceMultiPersonOptions, + ServiceResource, + ServiceWithUsers, + TimePlan, }; pub use shared::{ entity::{Entity, ID}, diff --git a/scheduler/crates/domain/src/schedule.rs b/scheduler/crates/domain/src/schedule.rs index 8e9c5a9a..8669067e 100644 --- a/scheduler/crates/domain/src/schedule.rs +++ b/scheduler/crates/domain/src/schedule.rs @@ -9,7 +9,9 @@ use crate::{ event_instance::EventInstance, shared::entity::{Entity, ID}, timespan::TimeSpan, - CompatibleInstances, Meta, Metadata, + CompatibleInstances, + Meta, + Metadata, }; #[derive(Debug, Clone)] diff --git a/scheduler/crates/domain/src/service.rs b/scheduler/crates/domain/src/service.rs index 3106b7a3..15d63e2d 100644 --- a/scheduler/crates/domain/src/service.rs +++ b/scheduler/crates/domain/src/service.rs @@ -3,7 +3,8 @@ use serde::{Deserialize, Serialize}; use crate::{ scheduling::RoundRobinAlgorithm, shared::entity::{Entity, ID}, - Meta, Metadata, + Meta, + Metadata, }; /// A type that describes a time plan and is either a `Calendar` or a `Schedule` diff --git a/scheduler/crates/domain/src/user.rs b/scheduler/crates/domain/src/user.rs index b90d3b55..a986b68d 100644 --- a/scheduler/crates/domain/src/user.rs +++ b/scheduler/crates/domain/src/user.rs @@ -2,7 +2,8 @@ use serde::{Deserialize, Serialize}; use crate::{ shared::entity::{Entity, ID}, - Meta, Metadata, + Meta, + Metadata, }; #[derive(Debug, Clone, Default)] diff --git a/scheduler/crates/infra/src/repos/account/postgres.rs b/scheduler/crates/infra/src/repos/account/postgres.rs index b86e996e..5eeb829f 100644 --- a/scheduler/crates/infra/src/repos/account/postgres.rs +++ b/scheduler/crates/infra/src/repos/account/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{Account, PEMKey, ID}; use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/calendar/postgres.rs b/scheduler/crates/infra/src/repos/calendar/postgres.rs index 946d1d0f..693fe094 100644 --- a/scheduler/crates/infra/src/repos/calendar/postgres.rs +++ b/scheduler/crates/infra/src/repos/calendar/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{Calendar, ID}; use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/calendar_synced/mod.rs b/scheduler/crates/infra/src/repos/calendar_synced/mod.rs index 3869d237..f333d4a4 100644 --- a/scheduler/crates/infra/src/repos/calendar_synced/mod.rs +++ b/scheduler/crates/infra/src/repos/calendar_synced/mod.rs @@ -13,7 +13,12 @@ pub trait ICalendarSyncedRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, AccountIntegration, Calendar, IntegrationProvider, SyncedCalendar, User, + Account, + AccountIntegration, + Calendar, + IntegrationProvider, + SyncedCalendar, + User, UserIntegration, }; diff --git a/scheduler/crates/infra/src/repos/event/calendar_event/mod.rs b/scheduler/crates/infra/src/repos/event/calendar_event/mod.rs index 3c1723a4..8b20b594 100644 --- a/scheduler/crates/infra/src/repos/event/calendar_event/mod.rs +++ b/scheduler/crates/infra/src/repos/event/calendar_event/mod.rs @@ -49,7 +49,14 @@ pub trait IEventRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, Calendar, CalendarEvent, Entity, Service, TimeSpan, User, ID, + Account, + Calendar, + CalendarEvent, + Entity, + Service, + TimeSpan, + User, + ID, }; use crate::{setup_context, NettuContext}; diff --git a/scheduler/crates/infra/src/repos/event/calendar_event/postgres.rs b/scheduler/crates/infra/src/repos/event/calendar_event/postgres.rs index 398c5f3f..ccbaed4e 100644 --- a/scheduler/crates/infra/src/repos/event/calendar_event/postgres.rs +++ b/scheduler/crates/infra/src/repos/event/calendar_event/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{CalendarEvent, CalendarEventReminder, RRuleOptions, use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/event/event_reminders_expansion_jobs/mod.rs b/scheduler/crates/infra/src/repos/event/event_reminders_expansion_jobs/mod.rs index 33aa4f88..ce6a823b 100644 --- a/scheduler/crates/infra/src/repos/event/event_reminders_expansion_jobs/mod.rs +++ b/scheduler/crates/infra/src/repos/event/event_reminders_expansion_jobs/mod.rs @@ -12,7 +12,11 @@ pub trait IEventRemindersGenerationJobsRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, Calendar, CalendarEvent, EventRemindersExpansionJob, User, + Account, + Calendar, + CalendarEvent, + EventRemindersExpansionJob, + User, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/event/event_synced/mod.rs b/scheduler/crates/infra/src/repos/event/event_synced/mod.rs index 319e31b6..8ace2cc7 100644 --- a/scheduler/crates/infra/src/repos/event/event_synced/mod.rs +++ b/scheduler/crates/infra/src/repos/event/event_synced/mod.rs @@ -12,8 +12,15 @@ pub trait IEventSyncedRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, AccountIntegration, Calendar, CalendarEvent, IntegrationProvider, SyncedCalendar, - SyncedCalendarEvent, User, UserIntegration, + Account, + AccountIntegration, + Calendar, + CalendarEvent, + IntegrationProvider, + SyncedCalendar, + SyncedCalendarEvent, + User, + UserIntegration, }; use crate::setup_context; diff --git a/scheduler/crates/infra/src/repos/event/mod.rs b/scheduler/crates/infra/src/repos/event/mod.rs index 112649d3..7938e2af 100644 --- a/scheduler/crates/infra/src/repos/event/mod.rs +++ b/scheduler/crates/infra/src/repos/event/mod.rs @@ -5,7 +5,8 @@ mod reminder; pub use calendar_event::{IEventRepo, PostgresEventRepo}; pub use event_reminders_expansion_jobs::{ - IEventRemindersGenerationJobsRepo, PostgresEventReminderGenerationJobsRepo, + IEventRemindersGenerationJobsRepo, + PostgresEventReminderGenerationJobsRepo, }; pub use event_synced::{IEventSyncedRepo, PostgresEventSyncedRepo}; pub use reminder::{IReminderRepo, PostgresReminderRepo}; diff --git a/scheduler/crates/infra/src/repos/mod.rs b/scheduler/crates/infra/src/repos/mod.rs index cc321213..3bfd7687 100644 --- a/scheduler/crates/infra/src/repos/mod.rs +++ b/scheduler/crates/infra/src/repos/mod.rs @@ -20,8 +20,13 @@ use account_integrations::{IAccountIntegrationRepo, PostgresAccountIntegrationRe use calendar::{ICalendarRepo, PostgresCalendarRepo}; use calendar_synced::{ICalendarSyncedRepo, PostgresCalendarSyncedRepo}; use event::{ - IEventRemindersGenerationJobsRepo, IEventRepo, IEventSyncedRepo, IReminderRepo, - PostgresEventReminderGenerationJobsRepo, PostgresEventRepo, PostgresEventSyncedRepo, + IEventRemindersGenerationJobsRepo, + IEventRepo, + IEventSyncedRepo, + IReminderRepo, + PostgresEventReminderGenerationJobsRepo, + PostgresEventRepo, + PostgresEventSyncedRepo, PostgresReminderRepo, }; use reservation::{IReservationRepo, PostgresReservationRepo}; @@ -30,7 +35,8 @@ use service::{IServiceRepo, PostgresServiceRepo}; use service_user::{IServiceUserRepo, PostgresServiceUserRepo}; pub use service_user_busy_calendars::{BusyCalendarIdentifier, ExternalBusyCalendarIdentifier}; use service_user_busy_calendars::{ - IServiceUserBusyCalendarRepo, PostgresServiceUseBusyCalendarRepo, + IServiceUserBusyCalendarRepo, + PostgresServiceUseBusyCalendarRepo, }; pub use shared::query_structs::*; use sqlx::postgres::PgPoolOptions; diff --git a/scheduler/crates/infra/src/repos/schedule/postgres.rs b/scheduler/crates/infra/src/repos/schedule/postgres.rs index a4aa9471..6a1dd37d 100644 --- a/scheduler/crates/infra/src/repos/schedule/postgres.rs +++ b/scheduler/crates/infra/src/repos/schedule/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{Schedule, ID}; use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/service/postgres.rs b/scheduler/crates/infra/src/repos/service/postgres.rs index 573155ab..886c6ceb 100644 --- a/scheduler/crates/infra/src/repos/service/postgres.rs +++ b/scheduler/crates/infra/src/repos/service/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{Service, ServiceWithUsers, ID}; use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/service_user/mod.rs b/scheduler/crates/infra/src/repos/service_user/mod.rs index 69717682..16e9f7f4 100644 --- a/scheduler/crates/infra/src/repos/service_user/mod.rs +++ b/scheduler/crates/infra/src/repos/service_user/mod.rs @@ -15,7 +15,13 @@ pub trait IServiceUserRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, Calendar, Entity, Service, ServiceResource, TimePlan, User, + Account, + Calendar, + Entity, + Service, + ServiceResource, + TimePlan, + User, }; use crate::setup_context; diff --git a/scheduler/crates/infra/src/repos/service_user_busy_calendars/mod.rs b/scheduler/crates/infra/src/repos/service_user_busy_calendars/mod.rs index d41e9256..7b1e4ba8 100644 --- a/scheduler/crates/infra/src/repos/service_user_busy_calendars/mod.rs +++ b/scheduler/crates/infra/src/repos/service_user_busy_calendars/mod.rs @@ -32,8 +32,15 @@ pub trait IServiceUserBusyCalendarRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, AccountIntegration, Calendar, IntegrationProvider, Service, ServiceResource, - TimePlan, User, UserIntegration, + Account, + AccountIntegration, + Calendar, + IntegrationProvider, + Service, + ServiceResource, + TimePlan, + User, + UserIntegration, }; use crate::{setup_context, BusyCalendarIdentifier, ExternalBusyCalendarIdentifier}; diff --git a/scheduler/crates/infra/src/repos/user/postgres.rs b/scheduler/crates/infra/src/repos/user/postgres.rs index 1eb520b6..40f48901 100644 --- a/scheduler/crates/infra/src/repos/user/postgres.rs +++ b/scheduler/crates/infra/src/repos/user/postgres.rs @@ -2,7 +2,8 @@ use nettu_scheduler_domain::{User, ID}; use serde_json::Value; use sqlx::{ types::{Json, Uuid}, - FromRow, PgPool, + FromRow, + PgPool, }; use tracing::error; diff --git a/scheduler/crates/infra/src/repos/user_integrations/mod.rs b/scheduler/crates/infra/src/repos/user_integrations/mod.rs index 2bbf7ff7..db07a982 100644 --- a/scheduler/crates/infra/src/repos/user_integrations/mod.rs +++ b/scheduler/crates/infra/src/repos/user_integrations/mod.rs @@ -14,7 +14,11 @@ pub trait IUserIntegrationRepo: Send + Sync { #[cfg(test)] mod tests { use nettu_scheduler_domain::{ - Account, AccountIntegration, IntegrationProvider, User, UserIntegration, + Account, + AccountIntegration, + IntegrationProvider, + User, + UserIntegration, }; use crate::setup_context; diff --git a/scheduler/crates/infra/src/services/google_calendar/mod.rs b/scheduler/crates/infra/src/services/google_calendar/mod.rs index 3218781c..32cf2d17 100644 --- a/scheduler/crates/infra/src/services/google_calendar/mod.rs +++ b/scheduler/crates/infra/src/services/google_calendar/mod.rs @@ -3,11 +3,19 @@ pub mod auth_provider; mod calendar_api; use calendar_api::{ - FreeBusyCalendar, FreeBusyRequest, GoogleCalendarEvent, GoogleCalendarEventAttributes, - GoogleCalendarRestApi, GoogleDateTime, ListCalendarsResponse, + FreeBusyCalendar, + FreeBusyRequest, + GoogleCalendarEvent, + GoogleCalendarEventAttributes, + GoogleCalendarRestApi, + GoogleDateTime, + ListCalendarsResponse, }; use nettu_scheduler_domain::{ - providers::google::GoogleCalendarAccessRole, CalendarEvent, CompatibleInstances, EventInstance, + providers::google::GoogleCalendarAccessRole, + CalendarEvent, + CompatibleInstances, + EventInstance, User, }; use tracing::error; diff --git a/scheduler/crates/infra/src/services/outlook_calendar/calendar_api.rs b/scheduler/crates/infra/src/services/outlook_calendar/calendar_api.rs index ed6798b9..2b5af28c 100644 --- a/scheduler/crates/infra/src/services/outlook_calendar/calendar_api.rs +++ b/scheduler/crates/infra/src/services/outlook_calendar/calendar_api.rs @@ -2,11 +2,18 @@ use chrono::{SecondsFormat, TimeZone, Utc}; use futures::future::join_all; use nettu_scheduler_domain::{ providers::outlook::{ - OutlookCalendar, OutlookCalendarEvent, OutlookCalendarEventBody, - OutlookCalendarEventBodyContentType, OutlookCalendarEventOnlineMeeting, - OutlookCalendarEventShowAs, OutlookCalendarEventTime, OutlookOnlineMeetingProvider, + OutlookCalendar, + OutlookCalendarEvent, + OutlookCalendarEventBody, + OutlookCalendarEventBodyContentType, + OutlookCalendarEventOnlineMeeting, + OutlookCalendarEventShowAs, + OutlookCalendarEventTime, + OutlookOnlineMeetingProvider, }, - CalendarEvent, CompatibleInstances, EventInstance, + CalendarEvent, + CompatibleInstances, + EventInstance, }; use reqwest::Client; use serde::{Deserialize, Serialize}; diff --git a/scheduler/crates/infra/src/services/outlook_calendar/mod.rs b/scheduler/crates/infra/src/services/outlook_calendar/mod.rs index 2b5fc8a1..b2e0dc13 100644 --- a/scheduler/crates/infra/src/services/outlook_calendar/mod.rs +++ b/scheduler/crates/infra/src/services/outlook_calendar/mod.rs @@ -5,7 +5,9 @@ mod calendar_api; use calendar_api::OutlookCalendarRestApi; use nettu_scheduler_domain::{ providers::outlook::{OutlookCalendarAccessRole, OutlookCalendarEvent}, - CalendarEvent, CompatibleInstances, User, + CalendarEvent, + CompatibleInstances, + User, }; use self::calendar_api::{FreeBusyRequest, ListCalendarsResponse, OutlookCalendarEventAttributes}; diff --git a/scheduler/tests/api.rs b/scheduler/tests/api.rs index b28b01b1..6da00b51 100644 --- a/scheduler/tests/api.rs +++ b/scheduler/tests/api.rs @@ -5,11 +5,25 @@ use std::collections::HashMap; use helpers::setup::spawn_app; use nettu_scheduler_domain::{PEMKey, Weekday}; use nettu_scheduler_sdk::{ - AddServiceUserInput, CreateCalendarInput, CreateEventInput, CreateScheduleInput, - CreateServiceInput, CreateUserInput, GetCalendarEventsInput, GetEventsInstancesInput, - GetServiceBookingSlotsInput, GetUserFreeBusyInput, KVMetadata, MetadataFindInput, NettuSDK, - RemoveServiceUserInput, UpdateCalendarInput, UpdateEventInput, UpdateScheduleInput, - UpdateServiceUserInput, ID, + AddServiceUserInput, + CreateCalendarInput, + CreateEventInput, + CreateScheduleInput, + CreateServiceInput, + CreateUserInput, + GetCalendarEventsInput, + GetEventsInstancesInput, + GetServiceBookingSlotsInput, + GetUserFreeBusyInput, + KVMetadata, + MetadataFindInput, + NettuSDK, + RemoveServiceUserInput, + UpdateCalendarInput, + UpdateEventInput, + UpdateScheduleInput, + UpdateServiceUserInput, + ID, }; #[actix_web::main] diff --git a/scheduler/tests/collective_team_scheduling.rs b/scheduler/tests/collective_team_scheduling.rs index 36dc4b75..5589f967 100644 --- a/scheduler/tests/collective_team_scheduling.rs +++ b/scheduler/tests/collective_team_scheduling.rs @@ -7,9 +7,18 @@ use helpers::{ }; use nettu_scheduler_domain::{BusyCalendar, ServiceMultiPersonOptions, TimePlan, ID}; use nettu_scheduler_sdk::{ - AddBusyCalendar, AddServiceUserInput, Calendar, CreateBookingIntendInput, CreateCalendarInput, - CreateEventInput, CreateScheduleInput, CreateServiceInput, CreateUserInput, - GetServiceBookingSlotsInput, NettuSDK, User, + AddBusyCalendar, + AddServiceUserInput, + Calendar, + CreateBookingIntendInput, + CreateCalendarInput, + CreateEventInput, + CreateScheduleInput, + CreateServiceInput, + CreateUserInput, + GetServiceBookingSlotsInput, + NettuSDK, + User, }; async fn create_default_service_host(admin_client: &NettuSDK, service_id: &ID) -> (User, Calendar) { diff --git a/scheduler/tests/group_team_scheduling.rs b/scheduler/tests/group_team_scheduling.rs index 88a5cc8e..5a84ca3c 100644 --- a/scheduler/tests/group_team_scheduling.rs +++ b/scheduler/tests/group_team_scheduling.rs @@ -7,9 +7,19 @@ use helpers::{ }; use nettu_scheduler_domain::{BusyCalendar, ServiceMultiPersonOptions, TimePlan, ID}; use nettu_scheduler_sdk::{ - AddBusyCalendar, AddServiceUserInput, Calendar, CreateBookingIntendInput, CreateCalendarInput, - CreateEventInput, CreateScheduleInput, CreateServiceInput, CreateUserInput, - GetServiceBookingSlotsInput, NettuSDK, UpdateServiceInput, User, + AddBusyCalendar, + AddServiceUserInput, + Calendar, + CreateBookingIntendInput, + CreateCalendarInput, + CreateEventInput, + CreateScheduleInput, + CreateServiceInput, + CreateUserInput, + GetServiceBookingSlotsInput, + NettuSDK, + UpdateServiceInput, + User, }; async fn create_default_service_host(admin_client: &NettuSDK, service_id: &ID) -> (User, Calendar) { diff --git a/scheduler/tests/round_robin_scheduling.rs b/scheduler/tests/round_robin_scheduling.rs index 1298e657..a6145e05 100644 --- a/scheduler/tests/round_robin_scheduling.rs +++ b/scheduler/tests/round_robin_scheduling.rs @@ -7,9 +7,19 @@ use helpers::{ }; use nettu_scheduler_domain::{BusyCalendar, ServiceMultiPersonOptions, TimePlan, ID}; use nettu_scheduler_sdk::{ - AddBusyCalendar, AddServiceUserInput, Calendar, CreateBookingIntendInput, CreateCalendarInput, - CreateEventInput, CreateScheduleInput, CreateServiceInput, CreateUserInput, - GetServiceBookingSlotsInput, NettuSDK, RoundRobinAlgorithm, User, + AddBusyCalendar, + AddServiceUserInput, + Calendar, + CreateBookingIntendInput, + CreateCalendarInput, + CreateEventInput, + CreateScheduleInput, + CreateServiceInput, + CreateUserInput, + GetServiceBookingSlotsInput, + NettuSDK, + RoundRobinAlgorithm, + User, }; async fn create_default_service_host(admin_client: &NettuSDK, service_id: &ID) -> (User, Calendar) {