Skip to content

Commit

Permalink
Display summary page for F680
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincarrogan committed Jan 22, 2025
1 parent d41fc62 commit cef6d1e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
1 change: 1 addition & 0 deletions conf/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"exporter.applications",
"exporter.organisation",
"exporter.goods",
"exporter.f680",
]

if MOCK_SSO_ACTIVATE_ENDPOINTS:
Expand Down
5 changes: 5 additions & 0 deletions exporter/f680/services.py
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions exporter/f680/templates/f680/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "layouts/base.html" %}
{% block title %}Apply for an F680 Application{% endblock%}

{% block body %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l govuk-!-margin-bottom-2">F680 Application</h1>
<ol class="lite-task-list">
<li>
<h2 class="lite-task-list__section">
<span class="lite-task-list__section-number">1. </span>Create Application
</h2>
<ul class="lite-task-list__items">
<li class="lite-task-list__item">
<div class="lite-task-list__item-header">
Your reference
<div class="lite-tag lite-tag--blue">
Saved
</div>
</div>
<div class="lite-task-list__item-details govuk-caption-m">
{{ application.name.value }}
</div>
</li>
</ul>
</li>
</ol>
</div>
</div>
{% endblock %}
20 changes: 14 additions & 6 deletions exporter/f680/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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

0 comments on commit cef6d1e

Please sign in to comment.