Skip to content

Commit

Permalink
Use env variables for parliament vote app dates (#603)
Browse files Browse the repository at this point in the history
* use env variables for parliament vote app dates

* fix syntax

---------

Co-authored-by: Jano Suchal <[email protected]>
  • Loading branch information
celuchmarek and jsuchal authored Oct 6, 2023
1 parent 7c28a0d commit f08f326
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
10 changes: 5 additions & 5 deletions app/models/apps/parliament_vote_app/application_form.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit f08f326

Please sign in to comment.