versa_semval/
lib.rs

1#![deny(clippy::all)]
2
3use model::SemanticValidationOutput;
4
5mod helpers;
6mod itemization;
7mod model;
8mod rules;
9mod schema_version;
10mod subtotal;
11mod total;
12pub mod validation;
13
14#[cfg(feature = "nodejs")]
15#[macro_use]
16extern crate napi_derive;
17
18#[cfg_attr(feature = "nodejs", napi)]
19pub fn run_semantic_validation(data: serde_json::Value) -> SemanticValidationOutput {
20  validation::execute(data).unwrap_or_else(|e| SemanticValidationOutput {
21    violations: Vec::new(),
22    error: Some(e.to_string()),
23  })
24}