diff --git a/.env.development b/.env.development index 267807510..a361d7b33 100644 --- a/.env.development +++ b/.env.development @@ -13,6 +13,7 @@ BETA_SEARCH_SWITCHING_ENABLED=true DUTY_CALCULATOR=true DUTY_CALCULATOR_BASE_URL=http://localhost:3002/duty-calculator FRONTEND_HOST=http://localhost +GREEN_LANES_ENABLED=true HTTPARTY_READ_TIMEOUT=661 PERMUTATIONS=true PORT=3001 @@ -28,4 +29,3 @@ TARIFF_SUPPORT_EMAIL=support@example.com UPDATED_NAVIGATION=true WEBCHAT_URL='test-online-services-helpdesk' WELSH=true -ALLOW_GREEN_LANE=true diff --git a/.tool-versions b/.tool-versions index dc17f7f6a..fafefefc3 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ cf 7.1.0 yarn 1.22.10 -nodejs 16.13.1 +nodejs 20.8.0 diff --git a/app/controllers/green_lanes/category_assessments_controller.rb b/app/controllers/green_lanes/category_assessments_controller.rb index a71d0366a..9dddea14a 100644 --- a/app/controllers/green_lanes/category_assessments_controller.rb +++ b/app/controllers/green_lanes/category_assessments_controller.rb @@ -31,7 +31,7 @@ def ca_search_params end def check_allowed - raise TradeTariffFrontend::FeatureUnavailable unless TradeTariffFrontend.green_lane_allowed? + raise TradeTariffFrontend::FeatureUnavailable unless TradeTariffFrontend.green_lanes_enabled? end end end diff --git a/app/controllers/green_lanes/check_moving_requirements_controller.rb b/app/controllers/green_lanes/check_moving_requirements_controller.rb new file mode 100644 index 000000000..95f2d00eb --- /dev/null +++ b/app/controllers/green_lanes/check_moving_requirements_controller.rb @@ -0,0 +1,45 @@ +module GreenLanes + class CheckMovingRequirementsController < ApplicationController + before_action :check_moving_requirements, + :disable_switch_service_banner, + :disable_search_form + + def start + @commodity_code = params[:code] + render 'start' + end + + def edit + @commodity_code = params[:code] + @check_moving_requirements_form = CheckMovingRequirementsForm.new(commodity_code: @commodity_code) + + render 'edit' + end + + def update + @check_moving_requirements_form = CheckMovingRequirementsForm.new(check_moving_requirements_params) + + if @check_moving_requirements_form.valid? + redirect_to result_green_lanes_check_moving_requirements_path + else + render 'edit', status: :unprocessable_entity + end + end + + private + + def check_moving_requirements_params + params.require(:green_lanes_check_moving_requirements_form).permit( + :commodity_code, + :country_of_origin, + :moving_date, + ) + end + + def check_moving_requirements + unless TradeTariffFrontend.green_lanes_enabled? + raise TradeTariffFrontend::FeatureUnavailable + end + end + end +end diff --git a/app/forms/green_lanes/check_moving_requirements_form.rb b/app/forms/green_lanes/check_moving_requirements_form.rb new file mode 100644 index 000000000..c4c921ae9 --- /dev/null +++ b/app/forms/green_lanes/check_moving_requirements_form.rb @@ -0,0 +1,17 @@ +module GreenLanes + class CheckMovingRequirementsForm + include ActiveModel::Model + include ActiveModel::Attributes + include ActiveRecord::AttributeAssignment + + attribute :commodity_code, :string + attribute :country_of_origin, :string + attribute :moving_date, :date + + validates :commodity_code, length: { is: 10 }, + format: { with: /\A\d+\z/, message: :only_numbers } + + validates :country_of_origin, presence: true + validates :moving_date, presence: true + end +end diff --git a/app/views/green_lanes/check_moving_requirements/edit.html.erb b/app/views/green_lanes/check_moving_requirements/edit.html.erb new file mode 100644 index 000000000..c3e7d76b9 --- /dev/null +++ b/app/views/green_lanes/check_moving_requirements/edit.html.erb @@ -0,0 +1,68 @@ +<%= back_link start_green_lanes_check_moving_requirements_path %> + +
+
+ +
+ + Check arrangements for internal market movements + + +

+ Tell us about your movement of goods +

+
+ + <%= form_for @check_moving_requirements_form, builder: GOVUKDesignSystemFormBuilder::FormBuilder, + method: :put, + url: green_lanes_check_moving_requirements_path do |f| %> + + <%= f.govuk_error_summary %> + +

Details provided will help us display specific requirements for your goods.

+ + <%= f.govuk_text_field :commodity_code, maxlength: 10, + label: { text: "What is your commodity code?", size: 's'}, + hint: { text: "Commodity codes are internationally recognised reference numbers that describe specific goods." \ + "Search the Online Trade Tariff if you're unsure of your commodity code.", + }, + style: "width:330px" + %> + + <%= f.govuk_collection_select :country_of_origin, + GreenLanes::CategoryAssessmentSearch.country_options, + :id, + :long_description, + options: { include_blank: '' }, + label: { text: "What is the origin of your goods?", size: 's' }, + hint: { text: "Origin allows for various policy measures to be implemented and for duties" \ + "to be calculated. Find out more about origin if you're unsure which country to select.", + }, + style: "width:330px" + %> + + <%= f.label :commodity_code, "When is the movement of goods taking place?", class: 'govuk-heading-s', + for: 'green_lanes_check_moving_requirements_form_moving_date_3i' %> + + <%= f.govuk_date_field :moving_date, + maxlength_enabled: true, + hint: { text: "Arrangements can change over time. If you are unsure of the date of " \ + "movement and want to check arrangements currently in place, enter today's date.", + class: 'govuk-body-l' + }, + legend: nil %> + + <%= f.submit "Continue", class: "govuk-button" %> + <% end %> + +

If you need help using this tool

+

+ Contact xxxxxxx ... +

+ +
+
diff --git a/app/views/green_lanes/check_moving_requirements/result.html.erb b/app/views/green_lanes/check_moving_requirements/result.html.erb new file mode 100644 index 000000000..3e4b6b5c9 --- /dev/null +++ b/app/views/green_lanes/check_moving_requirements/result.html.erb @@ -0,0 +1,15 @@ +<% content_for :top_breadcrumbs do %> + <%= generate_breadcrumbs( + "Check measures for movements from GB to NI", + [ + [t('breadcrumb.home'), home_path], + ["Section", browse_sections_path], + ] + ) %> +<% end %> + +<%= page_header do %> +

+ Requirements for your movement of goods +

+<% end %> diff --git a/app/views/green_lanes/check_moving_requirements/start.html.erb b/app/views/green_lanes/check_moving_requirements/start.html.erb new file mode 100644 index 000000000..994e090ae --- /dev/null +++ b/app/views/green_lanes/check_moving_requirements/start.html.erb @@ -0,0 +1,80 @@ +<%= back_link home_path %> + +
+
+
+

+ Check arrangements for internal market movements +

+
+ +

+ Use this tool if you are a trader moving goods from Great Britain to Northern Ireland and believe that your goods are 'not of risk' of onward movement to the EU. +

+ +

+ For eligible goods moving from Great Britain to Northern Ireland, traders can benefit from a simplified process for internal market movements. +

+ +

+ If you're based anywhere in the UK, you can join the UK Internal Market Scheme (UKIMS) to access the simplified process and benefit from reduced customs duties and checks. +

+ +

+ Use this tool to: +

+ +

Before you start

+

+ You'll need to know: +

+

+ + <%= button_to edit_green_lanes_check_moving_requirements_path, + method: :get, + params: { code: @commodity_code }, + class: "govuk-button govuk-button--start" do %> + + Start now + <%= render 'shared/start_arrow' %> + <% end %> + +

If you need help using this tool

+

+ Contact xxxxxxx ... +

+ +
+ +
+ +
+
diff --git a/app/views/meursing_lookup/steps/_start.html.erb b/app/views/meursing_lookup/steps/_start.html.erb index 5b8977a78..6e1578170 100644 --- a/app/views/meursing_lookup/steps/_start.html.erb +++ b/app/views/meursing_lookup/steps/_start.html.erb @@ -36,9 +36,7 @@ role="button" draggable="false" class="govuk-button govuk-!-margin-top-2 govuk-!-margin-bottom-8 govuk-button--start" data-module="govuk-button"> Start now - + <%= render 'shared/start_arrow' %>

Documents to download

diff --git a/app/views/shared/_feedback_useful_banner.html.erb b/app/views/shared/_feedback_useful_banner.html.erb index 7d5a4a498..4e95da354 100644 --- a/app/views/shared/_feedback_useful_banner.html.erb +++ b/app/views/shared/_feedback_useful_banner.html.erb @@ -2,7 +2,7 @@