pub mod clear_all_notifications; pub mod create_block; pub mod create_subscription; pub mod create_template; pub mod delete_block; pub mod delete_notification; pub mod delete_subscription; pub mod delete_template; pub mod dismiss_notification; pub mod get_template; pub mod get_unread_count; pub mod list_blocks; pub mod list_deliveries; pub mod list_deliveries_for_notification; pub mod list_notifications; pub mod list_subscriptions; pub mod list_templates; pub mod mark_all_as_read; pub mod mark_as_read; pub mod update_subscription; pub mod update_template; use actix_web::web; /// Configure notification routes under `/api/v1/notifications` pub fn configure(cfg: &mut web::ServiceConfig) { cfg.service( web::scope("/notifications") // Non-parameterized paths first .route("", web::get().to(list_notifications::list_notifications)) .route( "", web::delete().to(clear_all_notifications::clear_all_notifications), ) .route( "/unread-count", web::get().to(get_unread_count::get_unread_count), ) .route( "/read-all", web::put().to(mark_all_as_read::mark_all_as_read), ) // Parameterized notification paths .route( "/{notification_id}", web::delete().to(delete_notification::delete_notification), ) .route( "/{notification_id}/read", web::put().to(mark_as_read::mark_as_read), ) .route( "/{notification_id}/dismiss", web::post().to(dismiss_notification::dismiss_notification), ) .route( "/{notification_id}/deliveries", web::get().to(list_deliveries_for_notification::list_deliveries_for_notification), ) // Subscriptions .route( "/subscriptions", web::get().to(list_subscriptions::list_subscriptions), ) .route( "/subscriptions", web::post().to(create_subscription::create_subscription), ) .route( "/subscriptions/{subscription_id}", web::put().to(update_subscription::update_subscription), ) .route( "/subscriptions/{subscription_id}", web::delete().to(delete_subscription::delete_subscription), ) // Blocks .route("/blocks", web::get().to(list_blocks::list_blocks)) .route("/blocks", web::post().to(create_block::create_block)) .route( "/blocks/{block_id}", web::delete().to(delete_block::delete_block), ) // Deliveries .route( "/deliveries", web::get().to(list_deliveries::list_deliveries), ) // Templates .route("/templates", web::get().to(list_templates::list_templates)) .route( "/templates", web::post().to(create_template::create_template), ) .route( "/templates/{template_id}", web::get().to(get_template::get_template), ) .route( "/templates/{template_id}", web::put().to(update_template::update_template), ) .route( "/templates/{template_id}", web::delete().to(delete_template::delete_template), ), ); }