[package]
name        = "dpp-domain"
description = "EU Digital Product Passport domain types, port traits, and open-core boundary"
keywords    = ["dpp", "espr", "eu-regulation", "ecodesign", "sustainability"]
categories  = ["data-structures"]
version.workspace     = true
edition.workspace     = true
authors.workspace     = true
license.workspace     = true
repository.workspace  = true
rust-version.workspace = true

[dependencies]
dpp-rules   = { path = "../dpp-rules", version = "0.2.0" }
serde       = { workspace = true }
serde_json  = { workspace = true }
serde_with  = { workspace = true }
# v7+serde+js: v7 generates time-sortable UUIDs (B-tree friendly); js enables
# getrandom's JS backend so crypto.getRandomValues is used on wasm32-unknown-unknown.
uuid        = { version = "1", features = ["v7", "serde", "js"] }
chrono      = { workspace = true }
thiserror   = { workspace = true }
async-trait = { workspace = true }

semver      = "1"

# jsonschema not compatible with wasm32-unknown-unknown (uses reqwest blocking)
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
jsonschema  = { workspace = true }

[features]
test-utils = ["sha2", "hex"]

[dependencies.sha2]
workspace = true
optional  = true

[dependencies.hex]
workspace = true
optional  = true

[dev-dependencies]
serde_json = { workspace = true }
tokio      = { version = "1", features = ["macros", "rt"] }
sha2       = { workspace = true }
hex        = { workspace = true }
