rustkernel_accounting/
lib.rs1#![warn(missing_docs)]
17
18pub mod coa_mapping;
19pub mod detection;
20pub mod journal;
21pub mod network;
22pub mod network_generation;
23pub mod reconciliation;
24pub mod temporal;
25pub mod types;
26
27pub use coa_mapping::ChartOfAccountsMapping;
28pub use detection::{
29 GaapDetectionConfig, GaapViolationDetection, SuspenseAccountDetection, SuspenseDetectionConfig,
30};
31pub use journal::JournalTransformation;
32pub use network::NetworkAnalysis;
33pub use network_generation::{
34 AccountingFlow, AccountingNetwork, FixedPoint128, NetworkGeneration, NetworkGenerationConfig,
35 NetworkGenerationRing, NetworkGenerationStats, SolvingMethod,
36};
37pub use reconciliation::GLReconciliation;
38pub use temporal::TemporalCorrelation;
39
40pub fn register_all(
42 registry: &rustkernel_core::registry::KernelRegistry,
43) -> rustkernel_core::error::Result<()> {
44 tracing::info!("Registering accounting kernels");
45
46 registry.register_ring_metadata_from(coa_mapping::ChartOfAccountsMapping::new)?;
48
49 registry.register_ring_metadata_from(journal::JournalTransformation::new)?;
51
52 registry.register_ring_metadata_from(reconciliation::GLReconciliation::new)?;
54
55 registry.register_ring_metadata_from(network::NetworkAnalysis::new)?;
57
58 registry.register_ring_metadata_from(temporal::TemporalCorrelation::new)?;
60
61 registry.register_batch_typed(network_generation::NetworkGeneration::new)?;
63
64 registry.register_ring_metadata_from(network_generation::NetworkGenerationRing::new)?;
66
67 registry.register_ring_metadata_from(detection::SuspenseAccountDetection::new)?;
69 registry.register_ring_metadata_from(detection::GaapViolationDetection::new)?;
70
71 tracing::info!("Registered 9 accounting kernels");
72 Ok(())
73}
74
75#[cfg(test)]
76mod tests {
77 use super::*;
78 use rustkernel_core::registry::KernelRegistry;
79
80 #[test]
81 fn test_register_all() {
82 let registry = KernelRegistry::new();
83 register_all(®istry).expect("Failed to register accounting kernels");
84 assert_eq!(registry.total_count(), 9);
85 }
86}