use crate::ops::project_incoming;
use super::{CreateEntityOutcome, Engine, PreparedCreate};
impl Engine {
pub(super) fn create_dry_run_outcome(
&self,
prepared: PreparedCreate,
created_date: String,
) -> CreateEntityOutcome {
let PreparedCreate {
mount_idx: _,
id,
title,
mem,
file_path,
markdown,
anchors: _,
warnings,
type_guidance,
relations_declared,
relation_targets: _,
type_def: _,
} = prepared;
let prospective_hash = crate::entity::parser::compute_hash(&markdown);
let incoming = project_incoming(self.store.incoming(&id));
let incoming_count = (!incoming.is_empty()).then_some(incoming.len());
CreateEntityOutcome {
id,
title,
mem,
file_path,
content_hash: prospective_hash,
write_id: String::new(),
created_date,
warnings,
type_guidance,
incoming_count,
incoming,
relations_declared,
}
}
}