use ihe_atna::balp::{Described, Detail, Entity, OTHER};
use crate::record::Insertion;
pub const ENTITY: &str = "ehds-subject-inserted";
pub const DESCRIPTION: &str = "Inserted by the data subject: the information \
this access wrote was inserted by the natural person under a grant of \
their own, and the written data marks it as inserted by them \
(Regulation (EU) 2025/327 Art 5).";
pub const REPRESENTATIVE_ENTITY: &str = "ehds-representative-inserted";
pub const REPRESENTATIVE_DESCRIPTION: &str = "Inserted by a representative \
of the data subject: the information this access wrote was inserted, \
under the natural person's grant, by a natural person who acts for them \
as a proxy or a legal representative, and the written data names that \
representative as its provider, never the natural person (Regulation \
(EU) 2025/327 Art 4(2), Art 5).";
pub(super) fn entity(inserted: Insertion) -> Entity {
let (name, description) = match inserted {
Insertion::Subject => (ENTITY, DESCRIPTION),
Insertion::Representative => (REPRESENTATIVE_ENTITY, REPRESENTATIVE_DESCRIPTION),
};
Entity::Described(Described {
what: None,
kind: OTHER,
role: None,
name: Some(name.to_owned()),
description: Some(description.to_owned()),
details: vec![Detail::new(name, "true")],
security_labels: Vec::new(),
})
}