backbone-activity 0.5.0

Sales activity / touchpoints + rep tasks — the substrate lead/deal sit on
Documentation
//! HTTP route configuration
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! This module provides consolidated Axum route configuration using backbone-core's
//! BackboneCrudHandler for all 12 standard Backbone CRUD endpoints per entity.

use axum::Router;
use std::sync::Arc;

use super::{
    activity_handler::create_activity_routes,
};

use crate::application::service::{
    ActivityService,
};

/// Services collection for all CRUD endpoints
pub struct HttpServices {
    pub activity: Arc<ActivityService>,
}

/// Configure all HTTP routes for this module using Axum and BackboneCrudHandler.
///
/// Each entity gets 12 standard Backbone CRUD endpoints:
/// 1. GET /api/v1/{collection} - List with pagination
/// 2. POST /api/v1/{collection} - Create
/// 3. GET /api/v1/{collection}/:id - Get by ID
/// 4. PUT /api/v1/{collection}/:id - Full update
/// 5. PATCH /api/v1/{collection}/:id - Partial update
/// 6. DELETE /api/v1/{collection}/:id - Soft delete
/// 7. POST /api/v1/{collection}/bulk - Bulk create
/// 8. POST /api/v1/{collection}/upsert - Upsert
/// 9. GET /api/v1/{collection}/trash - List deleted
/// 10. POST /api/v1/{collection}/:id/restore - Restore
/// 11. DELETE /api/v1/{collection}/empty - Empty trash
/// 12. GET /api/v1/{collection}/:id/deleted - Get deleted by ID
pub fn configure_routes(services: HttpServices) -> Router {
    Router::new()
        // Activity routes (12 Backbone endpoints)
        .merge(create_activity_routes(services.activity))
}

/// Create an individual entity's routes (for modular configuration)
pub mod individual {
    use super::*;

    pub fn activity_routes(service: Arc<ActivityService>) -> Router {
        create_activity_routes(service)
    }

}