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
//! ODCS Native Data Structures
//!
//! This module provides native Rust types that model the ODCS (Open Data Contract Standard)
//! v3.1.0 specification accurately. These types preserve the three-level hierarchy:
//!
//! 1. **Contract Level** ([`ODCSContract`]) - Root document with metadata
//! 2. **Schema Level** ([`SchemaObject`]) - Tables/views/topics within a contract
//! 3. **Property Level** ([`Property`]) - Columns/fields within a schema
//!
//! ## Design Goals
//!
//! - **Zero data loss**: Full round-trip import/export without losing metadata
//! - **Multi-table support**: Native support for contracts with multiple schema objects
//! - **Nested properties**: Proper hierarchical representation for OBJECT and ARRAY types
//! - **Format mapping**: Clean mapping from Avro, Protobuf, JSON Schema, OpenAPI via custom properties
//! - **Backwards compatibility**: Converters to/from existing `Table`/`Column` types
//!
//! ## Example
//!
//! ```rust
//! use data_modelling_core::models::odcs::{ODCSContract, SchemaObject, Property};
//!
//! // Create a contract with two tables
//! let contract = ODCSContract::new("ecommerce", "1.0.0")
//! .with_domain("retail")
//! .with_status("active")
//! .with_schema(
//! SchemaObject::new("orders")
//! .with_physical_type("table")
//! .with_properties(vec![
//! Property::new("id", "integer").with_primary_key(true),
//! Property::new("customer_id", "integer").with_required(true),
//! Property::new("total", "number"),
//! ])
//! )
//! .with_schema(
//! SchemaObject::new("order_items")
//! .with_physical_type("table")
//! .with_properties(vec![
//! Property::new("id", "integer").with_primary_key(true),
//! Property::new("order_id", "integer").with_required(true),
//! Property::new("product_name", "string"),
//! ])
//! );
//!
//! assert_eq!(contract.schema_count(), 2);
//! ```
// Re-export main types for convenience
pub use ODCSContract;
pub use Property;
pub use SchemaObject;
// Re-export supporting types
pub use ;