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
//! # StateSet Primitives
//!
//! Strongly-typed primitive types for the StateSet iCommerce platform.
//!
//! This crate provides newtype wrappers that prevent accidental misuse of raw types
//! like `Uuid` and `String` across domain boundaries. Inspired by the type-safety
//! patterns in [alloy](https://github.com/alloy-rs/alloy) and
//! [reth](https://github.com/paradigmxyz/reth).
//!
//! ## Why Newtypes?
//!
//! Without newtypes, it's easy to accidentally pass a `CustomerId` where an `OrderId`
//! is expected — both are `Uuid` under the hood. Newtypes catch these bugs at compile
//! time.
//!
//! ```rust
//! use stateset_primitives::{OrderId, CustomerId};
//!
//! fn process_order(order_id: OrderId, customer_id: CustomerId) {
//! // Can't accidentally swap these — the compiler will catch it!
//! }
//! ```
//!
//! ## Types
//!
//! ### Entity IDs
//!
//! All entity identifiers are `Copy` + `Eq` + `Hash` newtypes around `Uuid`:
//!
//! - [`OrderId`], [`CustomerId`], [`ProductId`], [`InvoiceId`]
//! - [`ShipmentId`], [`ReturnId`], [`WarehouseId`], [`PaymentId`]
//! - [`InventoryItemId`], [`SubscriptionId`], [`CartId`], [`FulfillmentId`]
//!
//! ### Value Types
//!
//! - [`Sku`] — validated product SKU string
//! - [`Money`] — amount + currency, preventing currency mismatches
//! - [`CurrencyCode`] — ISO 4217 3-letter currency code
//!
//! ## Feature Flags
//!
//! - `std` (default) — standard library support
pub use *;
pub use *;
pub use *;