feat: share village needs with helpers

This commit is contained in:
Rijad Zuzo
2026-07-16 12:13:54 +02:00
parent 0332c57a89
commit d6e6a63048
17 changed files with 716 additions and 41 deletions
@@ -99,6 +99,15 @@ func get_open_opportunity() -> OpportunityStateRecord:
return open_records[0] if not open_records.is_empty() else null
func get_open_trigger_event_id() -> int:
var opportunity := get_open_opportunity()
return (
opportunity.get_trigger_event_id()
if opportunity != null
else OpportunityStateRecord.NO_EVENT_ID
)
func get_latest() -> OpportunityStateRecord:
var sorted := get_all_sorted()
return sorted[-1] if not sorted.is_empty() else null