add purchase resource in model catalog
This commit is contained in:
@@ -71,9 +71,13 @@ func (abs *PricedResource) SetLocationEnd(end time.Time) {
|
||||
|
||||
func (abs *PricedResource) GetExplicitDurationInS() float64 {
|
||||
if abs.ExplicitBookingDurationS == 0 {
|
||||
if abs.UsageEnd == nil || abs.UsageStart == nil {
|
||||
if abs.UsageEnd == nil && abs.UsageStart == nil {
|
||||
return time.Duration(1 * time.Hour).Seconds()
|
||||
}
|
||||
if abs.UsageEnd == nil {
|
||||
add := abs.UsageStart.Add(time.Duration(1 * time.Hour))
|
||||
abs.UsageEnd = &add
|
||||
}
|
||||
return abs.UsageEnd.Sub(*abs.UsageStart).Seconds()
|
||||
}
|
||||
return abs.ExplicitBookingDurationS
|
||||
|
||||
Reference in New Issue
Block a user