add purchase resource in model catalog
This commit is contained in:
		@@ -148,9 +148,9 @@ func (r *PricedComputeResource) GetPrice() (float64, error) {
 | 
			
		||||
	}
 | 
			
		||||
	if r.SelectedPricing == nil {
 | 
			
		||||
		if len(r.PricingProfiles) == 0 {
 | 
			
		||||
			return 0, errors.New("pricing profile must be set")
 | 
			
		||||
			return 0, errors.New("pricing profile must be set on Priced Compute" + r.ResourceID)
 | 
			
		||||
		}
 | 
			
		||||
		*r.SelectedPricing = r.PricingProfiles[0]
 | 
			
		||||
		r.SelectedPricing = &r.PricingProfiles[0]
 | 
			
		||||
	}
 | 
			
		||||
	pricing := *r.SelectedPricing
 | 
			
		||||
	price := float64(0)
 | 
			
		||||
 
 | 
			
		||||
@@ -164,7 +164,7 @@ func (r *PricedDataResource) GetPrice() (float64, error) {
 | 
			
		||||
		if len(r.PricingProfiles) == 0 {
 | 
			
		||||
			return 0, errors.New("pricing profile must be set on Priced Data" + r.ResourceID)
 | 
			
		||||
		}
 | 
			
		||||
		*r.SelectedPricing = r.PricingProfiles[0]
 | 
			
		||||
		r.SelectedPricing = &r.PricingProfiles[0]
 | 
			
		||||
	}
 | 
			
		||||
	pricing := *r.SelectedPricing
 | 
			
		||||
	var err error
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ func (r *PricedResource) GetPrice() (float64, error) {
 | 
			
		||||
		if len(r.PricingProfiles) == 0 {
 | 
			
		||||
			return 0, errors.New("pricing profile must be set on Priced Resource " + r.ResourceID)
 | 
			
		||||
		}
 | 
			
		||||
		*r.SelectedPricing = r.PricingProfiles[0]
 | 
			
		||||
		r.SelectedPricing = &r.PricingProfiles[0]
 | 
			
		||||
	}
 | 
			
		||||
	pricing := *r.SelectedPricing
 | 
			
		||||
	return pricing.GetPrice(1, 0, *r.UsageStart, *r.UsageEnd)
 | 
			
		||||
 
 | 
			
		||||
@@ -182,7 +182,6 @@ func (ri *ResourcePartnerShip[T]) GetPricingsProfiles(peerID string, groups []st
 | 
			
		||||
		}
 | 
			
		||||
		for _, p := range ri.PeerGroups[peerID] {
 | 
			
		||||
			if slices.Contains(groups, p) {
 | 
			
		||||
 | 
			
		||||
				for _, ri := range ri.PricingProfiles {
 | 
			
		||||
					profiles = append(profiles, ri)
 | 
			
		||||
				}
 | 
			
		||||
 
 | 
			
		||||
@@ -175,7 +175,7 @@ func (r *PricedStorageResource) GetPrice() (float64, error) {
 | 
			
		||||
		if len(r.PricingProfiles) == 0 {
 | 
			
		||||
			return 0, errors.New("pricing profile must be set on Priced Storage" + r.ResourceID)
 | 
			
		||||
		}
 | 
			
		||||
		*r.SelectedPricing = r.PricingProfiles[0]
 | 
			
		||||
		r.SelectedPricing = &r.PricingProfiles[0]
 | 
			
		||||
	}
 | 
			
		||||
	pricing := *r.SelectedPricing
 | 
			
		||||
	var err error
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user