Files
oc-lib/models/resources/interfaces.go

40 lines
1.3 KiB
Go
Raw Normal View History

package resources
import (
2026-01-13 16:04:31 +01:00
"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"
"cloud.o-forge.io/core/oc-lib/tools"
)
type ResourceInterface interface {
utils.DBObject
Trim()
2026-01-13 16:04:31 +01:00
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)
2025-01-20 13:49:39 +01:00
GetType() string
2026-01-13 16:04:31 +01:00
GetSelectedInstance(selected *int) ResourceInstanceITF
ClearEnv() utils.DBObject
SetAllowedInstances(request *tools.APIRequest)
2026-01-12 11:59:05 +01:00
AddInstances(instance ResourceInstanceITF)
}
2025-01-13 11:24:07 +01:00
type ResourceInstanceITF interface {
utils.DBObject
GetID() string
2025-01-13 11:24:07 +01:00
GetName() string
StoreDraftDefault()
ClearEnv()
2026-01-13 16:04:31 +01:00
GetProfile(peerID string, partnershipIndex *int, buying *int, strategy *int) pricing.PricingProfileITF
2025-06-20 12:10:36 +02:00
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
ClearPeerGroups()
}
type ResourcePartnerITF interface {
2025-06-20 12:10:36 +02:00
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
GetPeerGroups() map[string][]string
ClearPeerGroups()
2026-01-13 16:04:31 +01:00
GetProfile(buying *int, strategy *int) pricing.PricingProfileITF
}