From aa9279e86104590dde59aca3df089e0c88fd4ae7 Mon Sep 17 00:00:00 2001 From: TemitopeAyokuHO Date: Mon, 23 Dec 2024 12:02:48 +0000 Subject: [PATCH] EPP 34 skeleton for Replace Flow - Added route flow according to the figma design - Added field name --- apps/epp-amend/translations/src/en/pages.json | 5 +- .../views/application-submitted.html | 3 +- apps/epp-common/index.js | 2 +- apps/epp-replace/index.js | 184 +++++++++++++++++- .../sections/summary-data-sections.js | 1 + .../translations/src/en/pages.json | 4 +- .../views/application-submitted.html | 13 ++ 7 files changed, 200 insertions(+), 12 deletions(-) create mode 100644 apps/epp-replace/sections/summary-data-sections.js create mode 100644 apps/epp-replace/views/application-submitted.html diff --git a/apps/epp-amend/translations/src/en/pages.json b/apps/epp-amend/translations/src/en/pages.json index 6cf1eb7..197d164 100644 --- a/apps/epp-amend/translations/src/en/pages.json +++ b/apps/epp-amend/translations/src/en/pages.json @@ -1,5 +1,8 @@ { "application-submitted": { - "confirmed": "Amendment submitted" + "confirmed": "Replace application submitted" + }, + "confirm": { + "header": "Check your answers" } } diff --git a/apps/epp-amend/views/application-submitted.html b/apps/epp-amend/views/application-submitted.html index b6ea2bb..a020236 100644 --- a/apps/epp-amend/views/application-submitted.html +++ b/apps/epp-amend/views/application-submitted.html @@ -7,8 +7,7 @@

{{#t}}pages.application-submitted.confirmed{{/t}}

-

Confirmation sent to

-

+

Payment successful

{{/page-content}} {{/partials-page}} diff --git a/apps/epp-common/index.js b/apps/epp-common/index.js index d98b3fb..780d922 100644 --- a/apps/epp-common/index.js +++ b/apps/epp-common/index.js @@ -34,7 +34,7 @@ module.exports = { } } ], - next: '/replace-license/start' + next: '/replace-license/section-one' } } }; diff --git a/apps/epp-replace/index.js b/apps/epp-replace/index.js index 0a7a259..07b2097 100644 --- a/apps/epp-replace/index.js +++ b/apps/epp-replace/index.js @@ -1,4 +1,5 @@ const validateAndRedirect = require('./behaviours/home-redirection'); +const SummaryPageBehaviour = require('hof').components.summary; module.exports = { name: 'EPP form', @@ -7,17 +8,186 @@ module.exports = { translations: 'apps/epp-replace/translations', baseUrl: '/replace-license', steps: { - '/start': { + '/section-one': { behaviours: [validateAndRedirect], backLink: '/application-type', - next: '/second-route' + fields: ['replace-licence'], + next: '/section-two' }, - '/second-route': { - backLink: 'start', - next: '/third-route' + '/section-two': { + fields: ['replace-is-crime-reported'], + next: '/report-details' }, - '/third-route': { - backLink: 'second-route' + '/report-to-police': { + backLink: '/section-two' + }, + '/report-details': { + fields: ['replace-report-details'], + next: '/section-three' + }, + '/section-three': { + fields: ['replace-licence-number'], + next: '/section-four' + }, + '/section-four': { + fields: [ + 'replace-name-title', + 'replace-firstname', + 'replace-middlename', + 'replace-lastname' + ], + next: '/section-five' + }, + '/section-five': { + fields: ['replace-date-of-birth'], + next: '/section-six' + }, + '/section-six': { + fields: [ + 'replace-post-address-1', + 'replace-post-address-2', + 'replace-post-town-or-city', + 'replace-post-county', + 'replace-post-postcode', + 'replace-post-country' + ], + next: '/section-seven' + }, + '/section-seven': { + fields: [ + 'replace-phone-number', + 'replace-email' + ], + next: '/section-eight' + }, + '/section-eight': { + fields: ['replace-is-details-changed'], + next: '/section-nine' + }, + '/section-nine': { + fields: [ + 'replace-replace-type' + ], + next: '/section-ten' + }, + '/section-ten': { + fields: [ + 'replace-new-name-title', + 'replace-new-firstname', + 'replace-new-middlename', + 'replace-new-lastname', + 'replace-date-new-name-changed' + ], + next: '/section-eleven' + }, + '/section-eleven': { + fields: ['replace-which-document-type'], + next: '/section-twelve' + }, + '/section-twelve': { + next: '/section-thirteen' + }, + '/section-thirteen': { + fields: [ + 'replace-new-post-address-1', + 'replace-new-post-address-2', + 'replace-new-post-town-or-city', + 'replace-new-post-county', + 'replace-new-post-postcode', + 'replace-new-post-country', + 'replace-new-date-moved-to-address' + ], + next: '/section-fourteen' + }, + '/section-fourteen': { + next: '/section-fifteen' + }, + '/section-fifteen': { + fields: [ + 'replace-reason-for-licence' + ], + next: '/section-sixteen' + }, + '/section-sixteen': { + fields: [ + 'replace-explosive-precusor-type' + ], + // fields: [ + // 'replace-countersignatory-address-1', + // 'replace-countersignatory-address-2', + // 'replace-countersignatory-town-or-city', + // 'replace-countersignatory-postcode' + // ], + next: '/section-sixteen-type' + }, + '/section-sixteen-type': { + fields: [ + 'replace-explosive-precusor-details' + ], + next: '/section-sixteen-summary' + }, + '/section-sixteen-summary': { + next: '/section-seventeen' + }, + '/section-seventeen': { + fields: [ + 'replace-poison-type' + ], + next: '/section-eighteen' + }, + '/section-seventeen-poison': { + fields: [ + 'replace-poison-details' + ], + next: '/section-seventeen-summary' + }, + '/section-seventeen-summary': { + next: '/section-eighteen' + }, + '/section-eighteen': { + fields: [ + 'replace-countersignatory-name-title', + 'replace-countersignatory-firstname', + 'replace-countersignatory-middlename', + 'replace-countersignatory-lastname', + 'replace-years-known-countersignatory', + 'replace-how-you-know-countersignatory', + 'replace-countersignatory-occupation' + ], + next: '/section-nineteen' + }, + '/section-nineteen': { + fields: [ + 'replace-countersignatory-address-1', + 'replace-countersignatory-address-2', + 'replace-countersignatory-town-or-city', + 'replace-countersignatory-postcode' + ], + next: '/section-twenty' + }, + '/section-twenty': { + fields: [ + 'replace-countersignatory-phone', + 'replace-countersignatory-email' + ], + next: '/section-twenty-one' + }, + '/section-twenty-one': { + fields: [ + 'replace-countersignatory-document-type' + ], + next: '/confirm' + }, + '/confirm': { + sections: require('./sections/summary-data-sections'), + behaviours: [SummaryPageBehaviour], + next: '/declaration' + }, + '/declaration': { + next: '/application-submitted' + }, + '/application-submitted': { + clearSession: true } } }; diff --git a/apps/epp-replace/sections/summary-data-sections.js b/apps/epp-replace/sections/summary-data-sections.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apps/epp-replace/sections/summary-data-sections.js @@ -0,0 +1 @@ + diff --git a/apps/epp-replace/translations/src/en/pages.json b/apps/epp-replace/translations/src/en/pages.json index 0db3279..f6c80c1 100644 --- a/apps/epp-replace/translations/src/en/pages.json +++ b/apps/epp-replace/translations/src/en/pages.json @@ -1,3 +1,5 @@ { - + "application-submitted": { + "confirmed": "Replaced application submitted" + } } diff --git a/apps/epp-replace/views/application-submitted.html b/apps/epp-replace/views/application-submitted.html new file mode 100644 index 0000000..a020236 --- /dev/null +++ b/apps/epp-replace/views/application-submitted.html @@ -0,0 +1,13 @@ +{{ +

+ {{#t}}pages.application-submitted.confirmed{{/t}} +

+

Payment successful

+ + {{/page-content}} + {{/partials-page}}