from rest_framework.decorators import api_view from rest_framework.response import Response from .choices import ( RELATION_TYPES, LIFE_SPHERES, NETWORK_CIRCLES, INTERACTION_INTENSITY, choices_payload, ) @api_view(['GET']) def meta_choices(request): """Unified meta endpoint for all domain enums.""" return Response(choices_payload()) @api_view(['GET']) def relation_types(request): return Response([{'value': v, 'label': l} for v, l in RELATION_TYPES]) @api_view(['GET']) def network_map_choices(request): return Response({ 'life_spheres': [{'value': v, 'label': l} for v, l in LIFE_SPHERES], 'network_circles': [{'value': v, 'label': l} for v, l in NETWORK_CIRCLES], 'interaction_intensities': [{'value': v, 'label': l} for v, l in INTERACTION_INTENSITY], })