Skip to main content

dpp_domain/domain/transfer/
operator.rs

1//! [`ResponsibleOperator`] and its [`OperatorRole`].
2
3use serde::{Deserialize, Serialize};
4
5/// Identifies an economic operator responsible for a DPP.
6///
7/// Under ESPR, the "responsible economic operator" is whoever places or
8/// makes the product available on the EU market. This can be the original
9/// manufacturer, an importer, a distributor, or a remanufacturer.
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11#[serde(rename_all = "camelCase")]
12pub struct ResponsibleOperator {
13    /// The operator's DID (e.g. `did:web:acme.example.com`).
14    pub did: String,
15    /// Human-readable name of the economic operator.
16    pub name: String,
17    /// The operator's role in the supply chain.
18    pub role: OperatorRole,
19    /// EU-assigned economic operator identifier, if available.
20    pub eu_operator_id: Option<String>,
21    /// ISO 3166-1 alpha-2 country code of the operator's establishment.
22    pub country: String,
23}
24
25/// The role of an economic operator in the DPP supply chain.
26///
27/// Determines what DPP fields the operator may introduce or update,
28/// as specified by the applicable delegated act.
29#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
30#[serde(rename_all = "camelCase")]
31#[non_exhaustive]
32pub enum OperatorRole {
33    /// Original equipment manufacturer.
34    Manufacturer,
35    /// Imports the product into the EU market.
36    Importer,
37    /// Makes the product available on the market without altering it.
38    Distributor,
39    /// An EU-established entity authorised to act on behalf of a
40    /// non-EU manufacturer.
41    AuthorisedRepresentative,
42    /// Performs remanufacturing — restores the product to original
43    /// or improved specifications.
44    Remanufacturer,
45    /// Adapts the product for a different purpose than originally intended.
46    Repurposer,
47    /// Prepares a used product for resale (testing, cleaning, repair).
48    PreparerForReuse,
49    /// Professional repairer with authorised DPP update rights.
50    Repairer,
51    /// Processes end-of-life products for material recovery.
52    Recycler,
53}