Adjust Mongo

This commit is contained in:
mr
2026-01-26 10:36:15 +01:00
parent 6b12aa1713
commit bc94f2b188
7 changed files with 133 additions and 96 deletions

View File

@@ -1,6 +1,7 @@
package resources
import (
"cloud.o-forge.io/core/oc-lib/dbs"
"cloud.o-forge.io/core/oc-lib/models/booking"
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
"cloud.o-forge.io/core/oc-lib/models/utils"
@@ -10,6 +11,7 @@ import (
type ResourceInterface interface {
utils.DBObject
Trim()
FilterPeer(peerID string) *dbs.Filters
GetBookingModes() map[booking.BookingMode]*pricing.PricingVariation
ConvertToPricedResource(t tools.DataType, a *int, selectedPartnership *int, selectedBuyingStrategy *int, selectedStrategy *int, b *int, request *tools.APIRequest) (pricing.PricedItemITF, error)
GetType() string
@@ -17,6 +19,7 @@ type ResourceInterface interface {
ClearEnv() utils.DBObject
SetAllowedInstances(request *tools.APIRequest)
AddInstances(instance ResourceInstanceITF)
RefineResourceByPartnership(peerID string) ResourceInterface
}
type ResourceInstanceITF interface {
@@ -29,9 +32,11 @@ type ResourceInstanceITF interface {
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
ClearPeerGroups()
RefineResourceByPartnership(peerID string) (ResourceInstanceITF, bool)
}
type ResourcePartnerITF interface {
RefineResourceByPartnership(peerID string) (ResourcePartnerITF, bool)
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() map[string][]string
ClearPeerGroups()