This commit is contained in:
mr
2026-03-20 15:41:33 +01:00
parent e4506f3b42
commit 9f861e5b8d

View File

@@ -215,9 +215,12 @@ func (d *WorkflowExecution) bookEach(executionsID string, wfID string, dt tools.
if s := priced.GetLocationStart(); s != nil && s.After(time.Now()) {
start = *s
}
durationS := priced.GetExplicitDurationInS()
// Prefer LocationEnd set by Planify; fall back to ExplicitDurationInS only
// when Planify did not compute an end (open-ended / service resources).
var endDate *time.Time
if durationS > 0 {
if locEnd := priced.GetLocationEnd(); locEnd != nil {
endDate = locEnd
} else if durationS := priced.GetExplicitDurationInS(); durationS > 0 {
e := start.Add(time.Duration(durationS) * time.Second)
endDate = &e
}