dpp_domain/personal_data/held_outside.rs
1//! [`HeldOutside`] — where personal data related to a marked field is kept, and
2//! on what basis.
3
4use serde::{Deserialize, Serialize};
5
6use super::lawful_basis::LawfulBasis;
7use super::record_id::PersonalDataRecordId;
8
9/// Personal data related to a marked field, held in an erasable record outside
10/// the passport.
11///
12/// Carries the basis and the record's identifier, and nothing about the person.
13/// The controller's own evidence of the basis, such as its record of a consent,
14/// is deliberately not referenced here: the controller keeps that evidence after
15/// the data is erased, so a pointer to it in a signed passport would keep
16/// relating the passport to the person.
17#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
18#[serde(rename_all = "camelCase")]
19#[non_exhaustive]
20pub struct HeldOutside {
21 /// The GDPR Art. 6(1) ground the record is held on.
22 pub lawful_basis: LawfulBasis,
23 /// The record holding the data.
24 pub record: PersonalDataRecordId,
25}
26
27impl HeldOutside {
28 /// A record held on `lawful_basis`.
29 #[must_use]
30 pub fn new(lawful_basis: LawfulBasis, record: PersonalDataRecordId) -> Self {
31 Self {
32 lawful_basis,
33 record,
34 }
35 }
36}