buyer_needs.mojo (892B)
1 from std.collections import List 2 3 from hyf_core.domain.demand import DemandLine 4 from hyf_core.domain.execution import ExecutionMeta 5 from hyf_core.domain.review import ReviewState 6 7 8 @fieldwise_init 9 struct BuyerNeedOutput(Copyable, Movable): 10 var demand_lines: List[DemandLine] 11 var review: ReviewState 12 var execution: ExecutionMeta 13 14 15 def assemble_buyer_need( 16 lines: List[DemandLine], review: ReviewState, execution: ExecutionMeta 17 ) raises -> BuyerNeedOutput: 18 if len(lines) == 0: 19 raise Error("buyer need requires at least one demand line") 20 var copied = List[DemandLine]() 21 for line in lines: 22 copied.append(line.copy()) 23 return BuyerNeedOutput( 24 demand_lines=copied^, review=review.copy(), execution=execution.copy() 25 ) 26 27 28 def needs_reparse_rewritten_text() -> Bool: 29 return False 30 31 32 def buyer_need_creates_order() -> Bool: 33 return False