# views.py
from django.shortcuts import render, get_object_or_404
from ec_user.models import EcUser
from django.http import JsonResponse
from django.conf import settings

def health_check(request):
    return JsonResponse({"status": "ok", "version": "0.0.1"})

def error_code_map(request):
    return JsonResponse(settings.ERROR_CODE_MAP)

def user_profile(request, user_id):
    user = get_object_or_404(EcUser, id=user_id)
    return render(request, 'user_profile.html', {'user': user})
