remove service level and country

This commit is contained in:
Tobias Brunner 2025-01-28 10:06:56 +01:00
parent 9993844057
commit f69f7fb755
No known key found for this signature in database
12 changed files with 32 additions and 123 deletions

View file

@ -1,5 +1,5 @@
from rest_framework import serializers
from services.models import Service, ServiceLevel, CloudProvider
from services.models import Service, CloudProvider
class ServicePlanSerializer(serializers.Serializer):

View file

@ -10,7 +10,7 @@ from .serializers import (
BindingRequestSerializer,
BindingResponseSerializer,
)
from services.models import Service, ServiceLevel
from services.models import Service
class ServiceBrokerView(APIView):
@ -24,25 +24,11 @@ class CatalogView(ServiceBrokerView):
def get(self, request):
services = []
marketplace_services = Service.objects.all().prefetch_related(
"cloud_provider", "service_level", "categories"
"cloud_provider", "categories"
)
for service in marketplace_services:
plans = []
service_levels = ServiceLevel.objects.all()
for level in service_levels:
plan = {
"id": f"plan-{service.id}-{level.id}",
"name": level.name,
"description": level.description,
"metadata": {
"costs": [{"amount": float(service.price), "unit": "MONTHLY"}],
"bullets": [level.description],
},
"free": False,
}
plans.append(plan)
service_data = {
"id": f"service-{service.id}",