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
87
88
89
90
91
92
93
94
//! Event Service — a registry of time-bounded events.
//!
//! This crate is the **Event** member of the Main X Index family. It
//! maintains a federated identity index of time-bounded occurrences —
//! conferences, performances, appointments, encounters, shifts,
//! sessions, screenings, sales, deliveries, incidents — with a domain
//! model aligned with [schema.org/Event](https://schema.org/Event).
//!
//! The crate's external name (for `use` statements in doctests and
//! downstream crates) is `event_service`; the package name in
//! `Cargo.toml` is `event-service`.
//!
//! # What this library provides
//!
//! - **Domain models** ([`models`]) — the [`Event`](models::Event)
//! aggregate plus its supporting value objects (locations, parties,
//! offers, identifiers, consent, merge / review-queue records).
//! - **Matching** ([`matching`]) — probabilistic (weighted fuzzy) and
//! deterministic (rule-based) strategies, with a bridge
//! ([`matching::adapter`]) to the canonical `event-matcher` crate.
//! - **Full-text search** ([`search`]) via Tantivy.
//! - **Validation** ([`validation`]) — data-quality rules,
//! normalization, and standardization at the API boundary.
//! - **Privacy** ([`privacy`]) — field masking, GDPR export, consent.
//! - **Persistence** ([`db`]) — PostgreSQL via SeaORM, plus a
//! HIPAA-style audit log.
//! - **APIs** ([`api`]) — REST (Axum), FHIR stubs, gRPC stub.
//! - **Event streaming** ([`streaming`]) and **observability**
//! ([`observability`], [`metrics`]).
//!
//! # Example
//!
//! Constructing the core [`Event`](models::Event) value object needs
//! no I/O, so it can run as a doctest:
//!
//! ```
//! use event_service::models::Event;
//!
//! let start = jiff::civil::datetime(2026, 6, 1, 9, 0, 0, 0).in_tz("UTC").unwrap().timestamp();
//! let event = Event::new("Annual Conference", start);
//! assert_eq!(event.name, "Annual Conference");
//! assert!(event.active);
//! ```
// Always start with high quality coding conventions.
// When we build for MUSL static, use faster memory allocator.
static GLOBAL: MiMalloc = MiMalloc;
// Module declarations.
/// HTTP / RPC surface: REST (Axum), FHIR stubs, gRPC stub.
/// Runtime configuration (server, database, search, matching).
/// PostgreSQL persistence (SeaORM entities, repositories, audit log).
/// Crate-wide error type and [`Result`] alias.
/// Matching strategies, scoring, and the canonical-matcher bridge.
/// Prometheus metric registry and text exposition.
/// Domain models (the [`Event`](models::Event) aggregate and friends).
/// OpenTelemetry tracing and metrics setup.
/// Privacy controls: masking, GDPR export, consent checks.
/// Tantivy full-text search index and query layer.
/// Event-stream publishing and consumption.
/// Data-quality validation, normalization, and standardization.
// Re-exports: surface the crate-wide error types at the root so callers
// can write `event_service::Error` / `event_service::Result`.
pub use ;