pjson_rs/application/
mod.rs

1//! Application layer - Use cases and orchestration
2//!
3//! Implements CQRS pattern with separate command and query handlers.
4//! Orchestrates domain logic and infrastructure concerns.
5
6pub mod commands;
7pub mod dto;
8pub mod handlers;
9pub mod queries;
10pub mod services;
11pub mod shared;
12
13pub use commands::*;
14pub use queries::*;
15pub use shared::AdjustmentUrgency;
16
17/// Application Result type
18pub type ApplicationResult<T> = Result<T, ApplicationError>;
19
20/// Application-specific errors
21#[derive(Debug, thiserror::Error)]
22pub enum ApplicationError {
23    #[error("Domain error: {0}")]
24    Domain(#[from] crate::domain::DomainError),
25
26    #[error("Validation error: {0}")]
27    Validation(String),
28
29    #[error("Authorization error: {0}")]
30    Authorization(String),
31
32    #[error("Concurrency error: {0}")]
33    Concurrency(String),
34
35    #[error("Not found: {0}")]
36    NotFound(String),
37
38    #[error("Conflict: {0}")]
39    Conflict(String),
40
41    #[error("Application logic error: {0}")]
42    Logic(String),
43}