Skip to main content

backbone_maintenance/exports/
services.rs

1//! Public services for Maintenance module
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! These services provide the public API for other modules.
6//! They only expose read operations - writes go through events.
7
8
9// ============================================================================
10// CUSTOM SERVICES
11// ============================================================================
12
13// <<< CUSTOM SERVICES START >>>
14// The generator emits no query-service trait for this module (it stopped emitting them for
15// hand-service modules), so the trait lives here — user-owned via the CUSTOM marker — and the
16// module builder hands out `Arc<dyn MaintenanceQueryService>` through it.
17
18use anyhow::Result;
19use async_trait::async_trait;
20
21use super::types::*;
22
23/// Public query service for Maintenance module
24///
25/// This trait defines read-only operations that other modules can use.
26/// Implementations should NOT expose internal domain logic.
27#[async_trait]
28pub trait MaintenanceQueryService: Send + Sync {
29    /// Get MaintenanceSchedule by ID
30    async fn get_maintenance_schedule(&self, id: MaintenanceScheduleId) -> Result<Option<MaintenanceScheduleDto>>;
31
32    /// Get MaintenanceSchedule summary by ID
33    async fn get_maintenance_schedule_summary(&self, id: MaintenanceScheduleId) -> Result<Option<MaintenanceScheduleSummary>>;
34
35    /// Check if MaintenanceSchedule exists
36    async fn maintenance_schedule_exists(&self, id: MaintenanceScheduleId) -> Result<bool>;
37
38    /// Get MaintenanceVisit by ID
39    async fn get_maintenance_visit(&self, id: MaintenanceVisitId) -> Result<Option<MaintenanceVisitDto>>;
40
41    /// Get MaintenanceVisit summary by ID
42    async fn get_maintenance_visit_summary(&self, id: MaintenanceVisitId) -> Result<Option<MaintenanceVisitSummary>>;
43
44    /// Check if MaintenanceVisit exists
45    async fn maintenance_visit_exists(&self, id: MaintenanceVisitId) -> Result<bool>;
46
47    /// Get MaintenanceVisitPart by ID
48    async fn get_maintenance_visit_part(&self, id: MaintenanceVisitPartId) -> Result<Option<MaintenanceVisitPartDto>>;
49
50    /// Get MaintenanceVisitPart summary by ID
51    async fn get_maintenance_visit_part_summary(&self, id: MaintenanceVisitPartId) -> Result<Option<MaintenanceVisitPartSummary>>;
52
53    /// Check if MaintenanceVisitPart exists
54    async fn maintenance_visit_part_exists(&self, id: MaintenanceVisitPartId) -> Result<bool>;
55}
56// <<< CUSTOM SERVICES END >>>