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"
"strings"
"time"
@@ -138,6 +139,7 @@ func (r *PricedComputeResource) GetType() tools.DataType {
}
func (r *PricedComputeResource) 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")
}