diff --git a/conf/exporter.py b/conf/exporter.py index c2baebadf..8fa601a57 100644 --- a/conf/exporter.py +++ b/conf/exporter.py @@ -18,6 +18,7 @@ "exporter.applications", "exporter.organisation", "exporter.goods", + "exporter.f680", ] if MOCK_SSO_ACTIVATE_ENDPOINTS: diff --git a/exporter/f680/services.py b/exporter/f680/services.py index fc0df8619..dab7f4fa0 100644 --- a/exporter/f680/services.py +++ b/exporter/f680/services.py @@ -1,6 +1,11 @@ from core import client +def get_680_application(request, application_id): + data = client.get(request, f"/exporter/f680/{application_id}/") + return data.json() + + def post_f680_application(request, json): data = client.post(request, "/exporter/f680/", json) return data.json(), data.status_code diff --git a/exporter/f680/templates/f680/summary.html b/exporter/f680/templates/f680/summary.html new file mode 100644 index 000000000..b816d9c9a --- /dev/null +++ b/exporter/f680/templates/f680/summary.html @@ -0,0 +1,30 @@ +{% extends "layouts/base.html" %} +{% block title %}Apply for an F680 Application{% endblock%} + +{% block body %} +
+
+

F680 Application

+
    +
  1. +

    + 1. Create Application +

    +
      +
    • +
      + Your reference +
      + Saved +
      +
      +
      + {{ application.name.value }} +
      +
    • +
    +
  2. +
+
+
+{% endblock %} diff --git a/exporter/f680/views.py b/exporter/f680/views.py index da3e2fbd9..69d11ba02 100644 --- a/exporter/f680/views.py +++ b/exporter/f680/views.py @@ -1,9 +1,8 @@ from http import HTTPStatus -from django.http import HttpResponse from django.shortcuts import redirect from django.urls import reverse -from django.views import View +from django.views.generic import TemplateView from core.auth.views import LoginRequiredMixin from core.decorators import expect_status @@ -12,7 +11,10 @@ from exporter.f680.constants import ApplicationFormSteps from exporter.f680.forms import ApplicationNameForm from exporter.f680.payloads import F680CreatePayloadBuilder -from exporter.f680.services import post_f680_application +from exporter.f680.services import ( + get_680_application, + post_f680_application, +) class F680ApplicationCreateView(LoginRequiredMixin, BaseSessionWizardView): @@ -45,6 +47,12 @@ def done(self, form_list, form_dict, **kwargs): return redirect(self.get_success_url(response_data["id"])) -class F680ApplicationSummaryView(View): - def get(self, request, *args, **kwargs): - return HttpResponse("OK") +class F680ApplicationSummaryView(LoginRequiredMixin, TemplateView): + template_name = "f680/summary.html" + + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + + ctx["application"] = get_680_application(self.request, self.kwargs["pk"])["application"] + + return ctx