dpp_calc/repairability/mod.rs
1//! Simplified repairability heuristic — six-parameter, 0–2 each, A–E band.
2//!
3//! ⚠️ **Non-regulatory.** This is a transparent six-factor indicator
4//! (disassembly, spare parts, repair info, diagnostic tools, software updates,
5//! customer support), each scored 0–2. It is **not** the enacted EU 2023/1669
6//! (smartphones/tablets) Annex IV repairability index, which uses a different
7//! parameter set (incl. Fasteners & Tools), a 1–5 per-class scale, a
8//! priority-part dimension, and its own class boundaries. The A–E result is a
9//! heuristic band and must not be presented as a regulatory repairability class.
10//! A faithful EU 2023/1669 Annex IV implementation is tracked separately.
11//!
12//! **Usage:**
13//! ```rust
14//! use chrono::NaiveDate;
15//! use dpp_calc::clock::AssessmentClock;
16//! use dpp_calc::repairability::{
17//! calculate, parameters::RepairabilityInputs,
18//! thresholds::SimplifiedRepairabilityHeuristic,
19//! };
20//!
21//! let inputs = RepairabilityInputs {
22//! disassembly: 2,
23//! spare_parts: 2,
24//! repair_info: 2,
25//! diagnostic_tools: 1,
26//! software_updatability: 2,
27//! customer_support: 1,
28//! };
29//! // The date the governing law attached to the product — from the product's
30//! // own record, never from the wall clock.
31//! let clock = AssessmentClock::placed_on(NaiveDate::from_ymd_opt(2026, 1, 1).unwrap());
32//!
33//! let result = calculate(&inputs, &SimplifiedRepairabilityHeuristic, clock).unwrap();
34//! println!("{:?} ({:.2}/10)", result.class, result.numeric_score);
35//! ```
36//!
37//! ## Module layout
38//!
39//! - [`calculator`] — [`calculate`], [`RepairabilityResult`], [`RepairabilityClass`].
40//! - [`parameters`] — [`RepairabilityInputs`].
41//! - [`thresholds`] — the [`thresholds::RepairabilityRuleset`] trait + concrete rulesets.
42//! - `golden_vectors` — worked-example regression tests.
43
44pub mod calculator;
45pub mod parameters;
46pub mod thresholds;
47
48#[cfg(test)]
49mod golden_vectors;
50
51pub use calculator::{ParameterContributions, RepairabilityClass, RepairabilityResult, calculate};
52pub use parameters::RepairabilityInputs;
53pub use thresholds::{
54 DisplaysRuleset, LaptopRuleset, RepairabilityRuleset, SimplifiedRepairabilityHeuristic,
55 WashingMachineRuleset,
56};