@@ -65,9 +65,7 @@ impl From<&EvidenceChain> for ProvenanceBadge {
6565 let critical_missing: Vec < _ > = missing
6666 . iter ( )
6767 . filter ( |m| {
68- * * m == "source_document"
69- || * * m == "classification"
70- || * * m == "extracted_rows"
68+ * * m == "source_document" || * * m == "classification" || * * m == "extracted_rows"
7169 } )
7270 . map ( |s| s. to_string ( ) )
7371 . collect ( ) ;
@@ -86,8 +84,8 @@ impl From<&EvidenceChain> for ProvenanceBadge {
8684
8785#[ cfg( test) ]
8886mod tests {
89- use crate :: node:: Confidence ;
9087 use super :: * ;
88+ use crate :: node:: Confidence ;
9189 use crate :: node:: { EvidenceNode , NodeId , NodeType , SourceDoc } ;
9290 use chrono:: TimeZone ;
9391 use chrono:: Utc ;
@@ -146,18 +144,16 @@ mod tests {
146144 source_document: NodeId :: new( NodeType :: SourceDoc , "abc" ) ,
147145 extraction_confidence: Confidence :: from( 0.95 ) ,
148146 } ) ] ,
149- classifications : vec ! [ EvidenceNode :: Classification (
150- crate :: node:: Classification {
151- tx_id: "tx_1" . to_string( ) ,
152- category: "Meals" . to_string( ) ,
153- sub_category: None ,
154- confidence: Confidence :: from( 0.92 ) ,
155- rule_used: None ,
156- actor: "operator" . to_string( ) ,
157- classified_at: Utc . with_ymd_and_hms( 2024 , 2 , 1 , 11 , 0 , 0 ) . unwrap( ) ,
158- note: None ,
159- } ,
160- ) ] ,
147+ classifications : vec ! [ EvidenceNode :: Classification ( crate :: node:: Classification {
148+ tx_id: "tx_1" . to_string( ) ,
149+ category: "Meals" . to_string( ) ,
150+ sub_category: None ,
151+ confidence: Confidence :: from( 0.92 ) ,
152+ rule_used: None ,
153+ actor: "operator" . to_string( ) ,
154+ classified_at: Utc . with_ymd_and_hms( 2024 , 2 , 1 , 11 , 0 , 0 ) . unwrap( ) ,
155+ note: None ,
156+ } ) ] ,
161157 proposals : vec ! [ ] ,
162158 approvals : vec ! [ EvidenceNode :: OperatorApproval (
163159 crate :: node:: OperatorApproval {
@@ -204,18 +200,16 @@ mod tests {
204200 tx_id : "tx_3" . to_string ( ) ,
205201 source_documents : vec ! [ ] ,
206202 extracted_rows : vec ! [ ] ,
207- classifications : vec ! [ EvidenceNode :: Classification (
208- crate :: node:: Classification {
209- tx_id: "tx_3" . to_string( ) ,
210- category: "Meals" . to_string( ) ,
211- sub_category: None ,
212- confidence: Confidence :: from( 0.92 ) ,
213- rule_used: None ,
214- actor: "operator" . to_string( ) ,
215- classified_at: Utc . with_ymd_and_hms( 2024 , 2 , 1 , 11 , 0 , 0 ) . unwrap( ) ,
216- note: None ,
217- } ,
218- ) ] ,
203+ classifications : vec ! [ EvidenceNode :: Classification ( crate :: node:: Classification {
204+ tx_id: "tx_3" . to_string( ) ,
205+ category: "Meals" . to_string( ) ,
206+ sub_category: None ,
207+ confidence: Confidence :: from( 0.92 ) ,
208+ rule_used: None ,
209+ actor: "operator" . to_string( ) ,
210+ classified_at: Utc . with_ymd_and_hms( 2024 , 2 , 1 , 11 , 0 , 0 ) . unwrap( ) ,
211+ note: None ,
212+ } ) ] ,
219213 proposals : vec ! [ ] ,
220214 approvals : vec ! [ EvidenceNode :: OperatorApproval (
221215 crate :: node:: OperatorApproval {
0 commit comments