add purchase resource in model catalog

This commit is contained in:
mr
2025-02-10 10:42:37 +01:00
parent 4a178d01e3
commit e55727d9e2
3 changed files with 9 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package resources
import (
"errors"
"fmt"
"time"
"cloud.o-forge.io/core/oc-lib/models/common/enum"
@@ -161,6 +162,7 @@ func (r *PricedStorageResource) GetType() tools.DataType {
}
func (r *PricedStorageResource) GetPrice() (float64, error) {
fmt.Println("GetPrice", r.UsageStart, r.UsageEnd)
if r.UsageStart == nil || r.UsageEnd == nil {
return 0, errors.New("usage start and end must be set")
}