Skip to main content

Crate vr_core

Crate vr_core 

Source
Expand description

§vr-core — PRPaaS Core Domain Types

Foundation crate for the Pharmaceutical Research Platform as a Service. Provides type-safe IDs, tenant isolation primitives, money types, and the permission model.

§Key Types

  • TenantContext — Extracted from every authenticated request. All repository methods require it. Cross-tenant access is a compile error.
  • TenantScoped<T> — Wraps any value with its owning tenant_id.
  • SubscriptionTier — Explorer/Accelerator/Enterprise/Academic/Custom.
  • Money — Integer cents for all financial calculations.
  • Type-safe IDs: TenantId, UserId, ProgramId, etc.

Re-exports§

pub use error::VrError;
pub use error::VrResult;
pub use money::Currency;
pub use money::Money;
pub use tenant::Action;
pub use tenant::Permissions;
pub use tenant::Resource;
pub use tenant::SubscriptionTier;
pub use tenant::Tenant;
pub use tenant::TenantContext;
pub use tenant::TenantScoped;
pub use tenant::TenantStatus;
pub use tenant::UserRole;
pub use ids::*;

Modules§

error
Error types for the VR platform.
ids
Type-safe ID newtypes for the PRPaaS domain.
money
Money types — all financial amounts in cents to avoid floating point.
tenant
TenantContext — the foundation of compile-time tenant isolation.