nomy_data_models/
lib.rs

1//! Nomy Data Models
2//!
3//! This crate provides data model definitions for Nomy wallet analysis data processing.
4//! These models are shared across multiple services and are generated from Python Pydantic models.
5
6pub mod models;
7
8/// Re-export all models for convenience
9pub use models::*;
10
11/// Error types for the crate
12pub mod error {
13    use thiserror::Error;
14
15    /// Error type for Nomy Data Models
16    #[derive(Error, Debug)]
17    pub enum NomyDataModelError {
18        /// Error when serializing or deserializing data
19        #[error("Serialization error: {0}")]
20        SerializationError(#[from] serde_json::Error),
21
22        /// Error when parsing a date or time
23        #[error("Date/time parsing error: {0}")]
24        DateTimeError(#[from] chrono::ParseError),
25
26        /// Other errors
27        #[error("Other error: {0}")]
28        Other(String),
29    }
30}
31
32/// Result type for the crate
33pub type Result<T> = std::result::Result<T, error::NomyDataModelError>;
34
35/// Version of the crate
36pub const VERSION: &str = env!("CARGO_PKG_VERSION");