-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
158 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict' | ||
|
||
/** | ||
* Orchestrates fetching and presenting the data needed for the how to edit an abstraction return page | ||
* @module EditReturnLogService | ||
*/ | ||
|
||
/** | ||
* Orchestrates fetching and presenting the data needed for the how to edit an abstraction return page | ||
* | ||
* @param {string} returnLogId - The ID of the return log to edit | ||
* | ||
* @returns {Promise<object>} page data needed by the view template | ||
*/ | ||
async function go(returnLogId) { | ||
return { | ||
returnLogId, | ||
pageTitle: 'Abstraction return', | ||
licenceRef: '12/345', | ||
returnReference: '123456789', | ||
siteDescription: 'River Swale - Helperby SP1,2,3,4,5 (GW)', | ||
purposes: 'Potable Water Supply Direct', | ||
returnsPeriod: 'From 1 July 2024 to 30 September 2024', | ||
abstractionPeriod: 'From 1 April to 31 March', | ||
tariffType: 'Standard tariff', | ||
queryText: 'Record under query', | ||
licenceId: 'd4ba7029-8716-4538-8092-0f39a196f132' | ||
} | ||
} | ||
|
||
module.exports = { | ||
go | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{% extends 'layout.njk' %} | ||
{% from "govuk/components/back-link/macro.njk" import govukBackLink %} | ||
{% from "govuk/components/button/macro.njk" import govukButton %} | ||
{% from "govuk/components/radios/macro.njk" import govukRadios %} | ||
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %} | ||
|
||
{% block breadcrumbs %} | ||
{# Back link #} | ||
{{ govukBackLink({ | ||
text: 'Back', | ||
href: '/return-logs/'+ returnLogId +'/view' | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{# Main heading #} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-full"> | ||
<span class="govuk-caption-l">Licence {{ licenceRef }}</span> | ||
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">{{ pageTitle }}</h1> | ||
|
||
{# Bill run meta-data #} | ||
{{ govukSummaryList({ | ||
classes: 'govuk-summary-list--no-border', | ||
rows: [ | ||
{ | ||
key: { | ||
text: 'Return reference', | ||
classes: "meta-data__label" | ||
}, | ||
value: { | ||
html: '<span data-test="return-reference">'+ returnReference +'</span>', | ||
classes: "meta-data__value" | ||
} | ||
}, | ||
{ | ||
key: { | ||
text: 'Site description', | ||
classes: "meta-data__label" | ||
}, | ||
value: { | ||
html: '<span data-test="site-description">'+ siteDescription +'</span>', | ||
classes: "meta-data__value" | ||
} | ||
}, | ||
{ | ||
key: { | ||
text: 'Purposes', | ||
classes: "meta-data__label" | ||
}, | ||
value: { | ||
html: '<span data-test="purposes">'+ purposes +'</span>', | ||
classes: "meta-data__value" | ||
} | ||
}, | ||
{ | ||
key: { | ||
text: 'Returns period', | ||
classes: "meta-data__label" | ||
}, | ||
value: { | ||
html: '<span data-test="returns-period">'+ returnsPeriod +'</span>', | ||
classes: "meta-data__value" | ||
} | ||
}, | ||
{ | ||
key: { | ||
text: 'Abstraction period', | ||
classes: "meta-data__label" | ||
}, | ||
value: { | ||
html: '<span data-test="abstraction-period">'+ abstractionPeriod +'</span>', | ||
classes: "meta-data__value" | ||
} | ||
}, | ||
{ | ||
key: { | ||
text: tariffType, | ||
classes: "meta-data__label" | ||
} | ||
} | ||
] | ||
}) }} | ||
</div> | ||
</div> | ||
|
||
{# Link to take you to the View Licence page #} | ||
<p class="govuk-body"><a href='/licences/'+ licenceId +'/summary' class="govuk-link">View licence</a></p> | ||
|
||
{# Select how you would like to edit the return #} | ||
<form method="post"> | ||
<input type="hidden" name="wrlsCrumb" value="{{wrlsCrumb}}"/> | ||
{{ govukRadios({ | ||
name: "howToEdit", | ||
fieldset: { | ||
legend: { | ||
text: "How would you like to edit this return?", | ||
isPageHeading: true, | ||
classes: "govuk-fieldset__legend--l" | ||
} | ||
}, | ||
items: [ | ||
{ | ||
value: '/return-logs/'+ returnLogId +'/edit/single-volume', | ||
text: "Enter individual volumes" | ||
}, | ||
{ | ||
value: '/return-logs/'+ returnLogId +'/edit/new-volumes', | ||
text: "Enter new volumes or readings" | ||
}, | ||
{ | ||
value: '/return-logs/'+ returnLogId +'/edit/nil-return', | ||
text: "Enter a nil return" | ||
}, | ||
{ | ||
value: '/return-logs/'+ returnLogId +'/edit/query', | ||
text: queryText | ||
} | ||
] | ||
}) }} | ||
|
||
{{ govukButton({ text: "Continue", preventDoubleClick: true }) }} | ||
</form> | ||
{% endblock %} |