From f08f32696d8b6355f093cb5fb97d013437035105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ce=C4=BEuch?= Date: Fri, 6 Oct 2023 17:52:06 +0200 Subject: [PATCH] Use env variables for parliament vote app dates (#603) * use env variables for parliament vote app dates * fix syntax --------- Co-authored-by: Jano Suchal --- .env.sample | 6 ++++++ .../apps/parliament_vote_app/application_form.rb | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.env.sample b/.env.sample index 6594e2d4..85e7c2c9 100644 --- a/.env.sample +++ b/.env.sample @@ -9,6 +9,12 @@ AUTH_EID_BASE_URL= AUTH_EID_PUBLIC_KEY= AUTH_EID_PRIVATE_KEY= +APP_PARLIAMENT_VOTE_DATE= +APP_PARLIAMENT_DELIVERY_BY_POST_DEADLINE_DATE= +APP_PARLIAMENT_PICKUP_DEADLINE_DATE= +APP_PARLIAMENT_VOTE_BY_POST_DEADLINE_DATE= +APP_PARLIAMENT_REQUEST_SENDING_DEADLINE_DATE= + DEFAULT_EMAIL_FROM=navody@digital AUTOFORM_URL= diff --git a/app/models/apps/parliament_vote_app/application_form.rb b/app/models/apps/parliament_vote_app/application_form.rb index b72370ca..0dcc9b65 100644 --- a/app/models/apps/parliament_vote_app/application_form.rb +++ b/app/models/apps/parliament_vote_app/application_form.rb @@ -1,11 +1,11 @@ module Apps module ParliamentVoteApp class ApplicationForm - VOTE_DATE = Date.new(2023, 9, 30) - DELIVERY_BY_POST_DEADLINE_DATE = Date.new(2023, 9, 8) - PICKUP_DEADLINE_DATE = Date.new(2023, 9, 29) - VOTE_BY_POST_DEADLINE_DATE = Date.new(2023, 8, 9) - REQUEST_SENDING_DEADLINE_DATE = Date.new(2023, 9, 8) + VOTE_DATE = Date.parse(ENV.fetch('APP_PARLIAMENT_VOTE_DATE', '2023-09-30')) + DELIVERY_BY_POST_DEADLINE_DATE = Date.parse(ENV.fetch('APP_PARLIAMENT_DELIVERY_BY_POST_DEADLINE_DATE', '2023-09-08')) + PICKUP_DEADLINE_DATE = Date.parse(ENV.fetch('APP_PARLIAMENT_PICKUP_DEADLINE_DATE', '2023-09-29')) + VOTE_BY_POST_DEADLINE_DATE = Date.parse(ENV.fetch('APP_PARLIAMENT_VOTE_BY_POST_DEADLINE_DATE', '2023-08-09')) + REQUEST_SENDING_DEADLINE_DATE = Date.parse(ENV.fetch('APP_PARLIAMENT_REQUEST_SENDING_DEADLINE_DATE', '2023-09-08')) include ActiveModel::Model