Skip to main content

backbone_integrations/application/service/
mod.rs

1//! Application services
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! Each entity service is a type alias over `GenericCrudService`.
6
7pub mod error;
8pub use error::{ServiceError, ServiceResult};
9
10pub mod integration_connector_service;
11pub mod integration_account_service;
12pub mod integration_event_service;
13
14
15pub use integration_connector_service::IntegrationConnectorService;
16pub use integration_account_service::IntegrationAccountService;
17pub use integration_event_service::IntegrationEventService;
18pub use integration_connector_service::IntegrationConnectorRowRules;
19pub use integration_account_service::IntegrationAccountRowRules;
20pub use integration_event_service::IntegrationEventRowRules;
21
22/// A `IntegrationConnectorService` over `repository` with its write guard attached: the way to build it, so its writes are
23/// served only with the rules the schema declares.
24pub fn build_integration_connector_service(
25    repository: std::sync::Arc<crate::infrastructure::persistence::IntegrationConnectorRepository>,
26) -> IntegrationConnectorService {
27    IntegrationConnectorService::with_repository(repository).with_guard(std::sync::Arc::new(IntegrationConnectorRowRules))
28}
29
30/// A `IntegrationAccountService` over `repository` with its write guard attached: the way to build it, so its writes are
31/// served only with the rules the schema declares.
32pub fn build_integration_account_service(
33    repository: std::sync::Arc<crate::infrastructure::persistence::IntegrationAccountRepository>,
34) -> IntegrationAccountService {
35    IntegrationAccountService::with_repository(repository).with_guard(std::sync::Arc::new(IntegrationAccountRowRules))
36}
37
38/// A `IntegrationEventService` over `repository` with its write guard attached: the way to build it, so its writes are
39/// served only with the rules the schema declares.
40pub fn build_integration_event_service(
41    repository: std::sync::Arc<crate::infrastructure::persistence::IntegrationEventRepository>,
42) -> IntegrationEventService {
43    IntegrationEventService::with_repository(repository).with_guard(std::sync::Arc::new(IntegrationEventRowRules))
44}
45
46// This directory's extension (hand-written; ADR-0031).
47include!("mod.ext.rs");