-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
86 lines (71 loc) · 2.96 KB
/
lib.rs
File metadata and controls
86 lines (71 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! # RustKernel Accounting
//!
//! GPU-accelerated accounting kernels.
//!
//! ## Kernels
//! - `ChartOfAccountsMapping` - Entity-specific CoA mapping
//! - `JournalTransformation` - GL mapping
//! - `GLReconciliation` - Account matching
//! - `NetworkAnalysis` - Intercompany analysis
//! - `TemporalCorrelation` - Account correlations
//! - `NetworkGeneration` - Journal entry to accounting network transformation
//! - `NetworkGenerationRing` - Streaming network generation
//! - `SuspenseAccountDetection` - Centrality-based suspense account detection
//! - `GaapViolationDetection` - GAAP prohibited flow pattern detection
#![warn(missing_docs)]
pub mod coa_mapping;
pub mod detection;
pub mod journal;
pub mod network;
pub mod network_generation;
pub mod reconciliation;
pub mod temporal;
pub mod types;
pub use coa_mapping::ChartOfAccountsMapping;
pub use detection::{
GaapDetectionConfig, GaapViolationDetection, SuspenseAccountDetection, SuspenseDetectionConfig,
};
pub use journal::JournalTransformation;
pub use network::NetworkAnalysis;
pub use network_generation::{
AccountingFlow, AccountingNetwork, FixedPoint128, NetworkGeneration, NetworkGenerationConfig,
NetworkGenerationRing, NetworkGenerationStats, SolvingMethod,
};
pub use reconciliation::GLReconciliation;
pub use temporal::TemporalCorrelation;
/// Register all accounting kernels.
pub fn register_all(
registry: &rustkernel_core::registry::KernelRegistry,
) -> rustkernel_core::error::Result<()> {
tracing::info!("Registering accounting kernels");
// CoA mapping kernel (1) — Batch
registry.register_ring_metadata_from(coa_mapping::ChartOfAccountsMapping::new)?;
// Journal kernel (1) — Batch
registry.register_ring_metadata_from(journal::JournalTransformation::new)?;
// Reconciliation kernel (1) — Batch
registry.register_ring_metadata_from(reconciliation::GLReconciliation::new)?;
// Network analysis kernel (1) — Batch
registry.register_ring_metadata_from(network::NetworkAnalysis::new)?;
// Temporal kernel (1) — Batch
registry.register_ring_metadata_from(temporal::TemporalCorrelation::new)?;
// Network generation batch kernel (1) — Batch
registry.register_batch_typed(network_generation::NetworkGeneration::new)?;
// Network generation ring kernel (1) — Ring
registry.register_ring_metadata_from(network_generation::NetworkGenerationRing::new)?;
// Detection kernels (2) — Batch
registry.register_ring_metadata_from(detection::SuspenseAccountDetection::new)?;
registry.register_ring_metadata_from(detection::GaapViolationDetection::new)?;
tracing::info!("Registered 9 accounting kernels");
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use rustkernel_core::registry::KernelRegistry;
#[test]
fn test_register_all() {
let registry = KernelRegistry::new();
register_all(®istry).expect("Failed to register accounting kernels");
assert_eq!(registry.total_count(), 9);
}
}