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