Skip to main content

backbone_support/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 issue_service;
11pub mod service_level_agreement_service;
12pub mod service_level_priority_service;
13pub mod warranty_claim_service;
14
15
16pub use issue_service::IssueService;
17pub use service_level_agreement_service::ServiceLevelAgreementService;
18pub use service_level_priority_service::ServiceLevelPriorityService;
19pub use warranty_claim_service::WarrantyClaimService;
20pub use issue_service::IssueRowRules;
21pub use service_level_agreement_service::ServiceLevelAgreementRowRules;
22pub use service_level_priority_service::ServiceLevelPriorityRowRules;
23pub use warranty_claim_service::WarrantyClaimRowRules;
24
25/// A `IssueService` over `repository` with its write guard attached: the way to build it, so its writes are
26/// served only with the rules the schema declares.
27pub fn build_issue_service(
28    repository: std::sync::Arc<crate::infrastructure::persistence::IssueRepository>,
29) -> IssueService {
30    IssueService::with_repository(repository).with_guard(std::sync::Arc::new(IssueRowRules))
31}
32
33/// A `ServiceLevelAgreementService` over `repository` with its write guard attached: the way to build it, so its writes are
34/// served only with the rules the schema declares.
35pub fn build_service_level_agreement_service(
36    repository: std::sync::Arc<crate::infrastructure::persistence::ServiceLevelAgreementRepository>,
37) -> ServiceLevelAgreementService {
38    ServiceLevelAgreementService::with_repository(repository).with_guard(std::sync::Arc::new(ServiceLevelAgreementRowRules))
39}
40
41/// A `ServiceLevelPriorityService` over `repository` with its write guard attached: the way to build it, so its writes are
42/// served only with the rules the schema declares.
43pub fn build_service_level_priority_service(
44    repository: std::sync::Arc<crate::infrastructure::persistence::ServiceLevelPriorityRepository>,
45) -> ServiceLevelPriorityService {
46    ServiceLevelPriorityService::with_repository(repository).with_guard(std::sync::Arc::new(ServiceLevelPriorityRowRules))
47}
48
49/// A `WarrantyClaimService` over `repository` with its write guard attached: the way to build it, so its writes are
50/// served only with the rules the schema declares.
51pub fn build_warranty_claim_service(
52    repository: std::sync::Arc<crate::infrastructure::persistence::WarrantyClaimRepository>,
53) -> WarrantyClaimService {
54    WarrantyClaimService::with_repository(repository).with_guard(std::sync::Arc::new(WarrantyClaimRowRules))
55}
56
57// This directory's extension (hand-written; ADR-0031).
58include!("mod.ext.rs");