ensurePricing

This commit is contained in:
mr
2026-03-20 13:28:35 +01:00
parent 1508cc3611
commit e6eb516f39
5 changed files with 74 additions and 9 deletions

View File

@@ -59,6 +59,8 @@ func (abs *PricedResource[T]) GetCreatorID() string {
return abs.CreatorID
}
// IsPurchasable and IsBooked fall back to false when SelectedPricing is a nil interface.
// Concrete types (PricedComputeResource, etc.) override these and guarantee non-nil pricing.
func (abs *PricedResource[T]) IsPurchasable() bool {
if any(abs.SelectedPricing) == nil {
return false