vr_core/lib.rs
1//! # vr-core — PRPaaS Core Domain Types
2//!
3//! Foundation crate for the Pharmaceutical Research Platform as a Service.
4//! Provides type-safe IDs, tenant isolation primitives, money types,
5//! and the permission model.
6//!
7//! ## Key Types
8//!
9//! - [`TenantContext`] — Extracted from every authenticated request.
10//! All repository methods require it. Cross-tenant access is a compile error.
11//! - [`TenantScoped<T>`] — Wraps any value with its owning tenant_id.
12//! - [`SubscriptionTier`] — Explorer/Accelerator/Enterprise/Academic/Custom.
13//! - [`Money`] — Integer cents for all financial calculations.
14//! - Type-safe IDs: [`TenantId`], [`UserId`], [`ProgramId`], etc.
15
16#![forbid(unsafe_code)]
17#![warn(missing_docs)]
18#![cfg_attr(
19 not(test),
20 deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
21)]
22
23pub mod error;
24pub mod ids;
25pub mod money;
26pub mod tenant;
27
28// Re-export key types at crate root for ergonomic imports.
29pub use error::{VrError, VrResult};
30pub use ids::*;
31pub use money::{Currency, Money};
32pub use tenant::{
33 Action, Permissions, Resource, SubscriptionTier, Tenant, TenantContext, TenantScoped,
34 TenantStatus, UserRole,
35};