//! The two facts the pipeline needs about a candidate: the row, and whether a //! human approved it. use crate::db::{self, approvals, model::CandidateRow, Db}; use crate::error::Result; pub fn candidate(db: &Db, id: i64) -> Result> { db::candidates::by_id(db, id) } /// The approval behind a candidate, as `(approval id, decision)`. `None` means /// no human has decided, which is what publish refuses on. pub fn approval(db: &Db, candidate_id: i64) -> Result> { approvals::for_candidate(db, candidate_id) }