add purchase resource in model catalog
This commit is contained in:
parent
c9690fc1ba
commit
4aebb48e73
@ -169,10 +169,20 @@ type ResourcePartnerShip[T pricing.PricingProfileITF] struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ri *ResourcePartnerShip[T]) GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF {
|
func (ri *ResourcePartnerShip[T]) GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF {
|
||||||
|
profiles := []pricing.PricingProfileITF{}
|
||||||
if ri.PeerGroups[peerID] != nil {
|
if ri.PeerGroups[peerID] != nil {
|
||||||
|
for _, ri := range ri.PricingProfiles {
|
||||||
|
profiles = append(profiles, ri)
|
||||||
|
}
|
||||||
|
if slices.Contains(groups, "*") {
|
||||||
|
for _, ri := range ri.PricingProfiles {
|
||||||
|
profiles = append(profiles, ri)
|
||||||
|
}
|
||||||
|
return profiles
|
||||||
|
}
|
||||||
for _, p := range ri.PeerGroups[peerID] {
|
for _, p := range ri.PeerGroups[peerID] {
|
||||||
if slices.Contains(groups, p) {
|
if slices.Contains(groups, p) {
|
||||||
profiles := []pricing.PricingProfileITF{}
|
|
||||||
for _, ri := range ri.PricingProfiles {
|
for _, ri := range ri.PricingProfiles {
|
||||||
profiles = append(profiles, ri)
|
profiles = append(profiles, ri)
|
||||||
}
|
}
|
||||||
@ -180,7 +190,7 @@ func (ri *ResourcePartnerShip[T]) GetPricingsProfiles(peerID string, groups []st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return []pricing.PricingProfileITF{}
|
return profiles
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rp *ResourcePartnerShip[T]) GetPeerGroups() map[string][]string {
|
func (rp *ResourcePartnerShip[T]) GetPeerGroups() map[string][]string {
|
||||||
|
Loading…
Reference in New Issue
Block a user