diff --git a/src/lib.rs b/src/lib.rs index b9acfe8..53d6e04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,2 +1,3 @@ pub mod app; +pub mod service; pub mod version; diff --git a/src/main.rs b/src/main.rs index 96f01db..246d932 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ async fn main() -> Result<(), Box> { }; loop { - println!("Do some work"); + catapult::service::do_the_work(&app).await; tokio::time::sleep(tokio::time::Duration::from_secs(catapult::app::SECONDS_TO_SLEEP)).await; } } diff --git a/src/service.rs b/src/service.rs new file mode 100644 index 0000000..9dd4cb4 --- /dev/null +++ b/src/service.rs @@ -0,0 +1,22 @@ + + +pub async fn do_the_work(_app: &crate::app::App) { + println!("Do some work"); + todo!(r#" + Need to finish this + + This function should fetch a token, check if the token is valid, and obtain a refresh token if + it has expired. + + Then do the real work. + + 1. Check the queue + 2. If there is an item, get the data, + 3. Evaluate if it is schedulable + 4. Get the events and iterate each one + 5. starting with the message + 6. Get the contact + 7. Send the message + 8. Record the message event response + "#); +}