use std::sync::Arc;
use ifc_model::EntityId;
use crate::error::PropertyAnomaly;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum MeasureRole {
Primary,
Secondary,
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum UndecidedReason {
UnknownTemplateType {
value: Arc<str>,
},
UndocumentedTemplateType {
value: Arc<str>,
},
UnknownMeasureType {
measure: MeasureRole,
value: Arc<str>,
},
UntypedValue {
attribute: &'static str,
},
UnnamedTemplate,
UnknownApplicableEntity {
entry: Arc<str>,
},
PredefinedTypeUnstated {
entry: Arc<str>,
},
PerformanceHistory {
entry: Arc<str>,
},
PredefinedSet {
found: Arc<str>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum TemplateFinding {
MissingProperty {
set: EntityId,
template: EntityId,
container: EntityId,
property_template: EntityId,
name: Arc<str>,
},
UnexpectedProperty {
set: EntityId,
template: EntityId,
container: EntityId,
property: EntityId,
name: Arc<str>,
},
WrongForm {
set: EntityId,
template: EntityId,
property: EntityId,
property_template: EntityId,
template_type: Option<Arc<str>>,
expected: &'static [&'static str],
found: Arc<str>,
},
WrongMeasureType {
set: EntityId,
template: EntityId,
property: EntityId,
property_template: EntityId,
measure: MeasureRole,
attribute: &'static str,
expected: Arc<str>,
found: Arc<str>,
},
WrongSetKind {
set: EntityId,
template: EntityId,
template_type: Arc<str>,
expected: &'static str,
found: Arc<str>,
},
WrongAttachment {
set: EntityId,
template: EntityId,
object: EntityId,
template_type: Arc<str>,
found: Arc<str>,
},
OutsideApplicableEntity {
set: EntityId,
template: EntityId,
object: EntityId,
found: Arc<str>,
applicable_entity: Arc<str>,
},
Undecided {
set: EntityId,
template: EntityId,
subject: EntityId,
reason: UndecidedReason,
},
}
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TemplateReport {
pub findings: Vec<TemplateFinding>,
pub anomalies: Vec<PropertyAnomaly>,
}