farm_review_output.mojo (1350B)
1 from std.collections import List 2 3 from hyf_application.farm_status import ProductStatus 4 from hyf_core.domain.execution import ExecutionMeta 5 from hyf_core.domain.review import ReviewState 6 from hyf_core.domain.supply_change import ProposedSupplyChange 7 8 9 @fieldwise_init 10 struct FarmInterpretationOutput(Copyable, Movable): 11 var claims: List[ProductStatus] 12 var changes: List[ProposedSupplyChange] 13 var review: ReviewState 14 var execution: ExecutionMeta 15 var original_source_preserved: Bool 16 var hyf_business_writes: Int 17 18 19 def assemble_farm_output( 20 claims: List[ProductStatus], 21 changes: List[ProposedSupplyChange], 22 review: ReviewState, 23 execution: ExecutionMeta, 24 ) raises -> FarmInterpretationOutput: 25 var copied_claims = List[ProductStatus]() 26 for claim in claims: 27 copied_claims.append(claim.copy()) 28 var copied_changes = List[ProposedSupplyChange]() 29 for change in changes: 30 copied_changes.append(change.copy()) 31 return FarmInterpretationOutput( 32 claims=copied_claims^, 33 changes=copied_changes^, 34 review=review.copy(), 35 execution=execution.copy(), 36 original_source_preserved=True, 37 hyf_business_writes=0, 38 ) 39 40 41 def missing_optional_price_blocks_draft() -> Bool: 42 return False 43 44 45 def ambiguous_withdrawal_blocks_apply() -> Bool: 46 return True