dpp_calc/repairability/thresholds/
washing_machine.rs1use chrono::NaiveDate;
8
9use super::{RepairabilityRuleset, RepairabilityThresholds, RepairabilityWeights};
10use crate::ruleset::{EffectiveDateBound, RegulatoryBasis, Ruleset, RulesetId, RulesetVersion};
11
12pub struct WashingMachineRuleset;
13
14static WASHING_WEIGHTS: RepairabilityWeights = RepairabilityWeights {
15 disassembly: 0.25,
16 spare_parts: 0.20,
17 repair_info: 0.20,
18 diagnostic_tools: 0.15,
19 software_updatability: 0.10,
20 customer_support: 0.10,
21};
22
23static WASHING_THRESHOLDS: RepairabilityThresholds = RepairabilityThresholds {
24 a: 8.5,
25 b: 7.0,
26 c: 5.5,
27 d: 4.0,
28};
29
30static WASHING_BASIS: RegulatoryBasis = RegulatoryBasis {
31 regulation: "pending — ESPR washing machine repairability delegated act (expected ~2026)",
32 article: "TBD",
33 standard: Some("EN 45554:2021"),
34 technical_study: None,
35 source_url: None,
36 superseded_by: None,
37};
38
39static WASHING_RULESET_ID: std::sync::OnceLock<RulesetId> = std::sync::OnceLock::new();
40static WASHING_RULESET_VERSION: std::sync::OnceLock<RulesetVersion> = std::sync::OnceLock::new();
41static WASHING_EFFECTIVE_DATES: std::sync::OnceLock<EffectiveDateBound> =
42 std::sync::OnceLock::new();
43
44impl Ruleset for WashingMachineRuleset {
45 fn id(&self) -> &RulesetId {
46 WASHING_RULESET_ID.get_or_init(|| RulesetId("washing-machine-repairability".into()))
47 }
48
49 fn version(&self) -> &RulesetVersion {
50 WASHING_RULESET_VERSION.get_or_init(|| RulesetVersion("0.0.0-stub".into()))
51 }
52
53 fn effective_dates(&self) -> &EffectiveDateBound {
54 WASHING_EFFECTIVE_DATES.get_or_init(|| {
55 EffectiveDateBound::open(NaiveDate::from_ymd_opt(2100, 1, 1).expect("valid date"))
56 })
57 }
58
59 fn regulatory_basis(&self) -> &RegulatoryBasis {
60 &WASHING_BASIS
61 }
62}
63
64impl RepairabilityRuleset for WashingMachineRuleset {
65 fn weights(&self) -> &RepairabilityWeights {
66 &WASHING_WEIGHTS
67 }
68
69 fn thresholds(&self) -> &RepairabilityThresholds {
70 &WASHING_THRESHOLDS
71 }
72}