313 changed files with 1379 additions and 1269 deletions
@ -0,0 +1,24 @@
|
||||
class Form::Lettings::Pages::TenancyotherValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "tenancyother_value_check" |
||||
@copy_key = "lettings.soft_validations.tenancyother_value_check" |
||||
@depends_on = [{ "tenancyother_might_be_introductory_or_starter_period?" => true }] |
||||
@title_text = { |
||||
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", |
||||
"arguments" => [{ "key" => "tenancyother", "i18n_template" => "tenancyother" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", |
||||
"arguments" => [], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::TenancyotherValueCheck.new(nil, nil, self)] |
||||
end |
||||
|
||||
def interruption_screen_question_ids |
||||
%w[startertenancy tenancy tenancyother] |
||||
end |
||||
end |
||||
@ -0,0 +1,13 @@
|
||||
class Form::Lettings::Questions::TenancyotherValueCheck < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "tenancyother_value_check" |
||||
@copy_key = "lettings.soft_validations.tenancyother_value_check" |
||||
@type = "interruption_screen" |
||||
@check_answers_card_number = 0 |
||||
@answer_options = ANSWER_OPTIONS |
||||
@hidden_in_check_answers = { "depends_on" => [{ "tenancyother_value_check" => 0 }, { "tenancyother_value_check" => 1 }] } |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class AddTenancyotherValueCheckToLettingsLogs < ActiveRecord::Migration[7.0] |
||||
def change |
||||
add_column :lettings_logs, :tenancyother_value_check, :integer |
||||
end |
||||
end |
||||
@ -1,6 +1,6 @@
|
||||
desc "Sets value for collection_year log validations depending on the from value" |
||||
task set_log_validation_collection_year: :environment do |
||||
LogValidation.all.each do |log_validation| |
||||
LogValidation.all.find_each do |log_validation| |
||||
log_validation.update(collection_year: "#{log_validation.from.year}/#{log_validation.from.year + 1}") |
||||
end |
||||
end |
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue