Browse Source
# Conflicts: # app/models/sales_log.rb # app/models/validations/sales/sale_information_validations.rb # app/models/validations/sales/soft_validations.rb # config/locales/en.yml # db/schema.rb # spec/models/form_handler_spec.rbpull/1225/head
368 changed files with 8597 additions and 327 deletions
@ -0,0 +1,25 @@
|
||||
<%= govuk_table do |table| %> |
||||
<% table.caption(size: "m", text: bulk_upload.filename) %> |
||||
|
||||
<% table.head do |head| %> |
||||
<% head.row do |row| %> |
||||
<% row.cell(text: "Column", header: true) %> |
||||
<% row.cell(text: "Number of rows", header: true) %> |
||||
<% row.cell(text: "Question", header: true) %> |
||||
<% row.cell(text: "Error", header: true) %> |
||||
<% row.cell(text: "Specification", header: true) %> |
||||
<% end %> |
||||
<% end %> |
||||
|
||||
<% table.body do |body| %> |
||||
<% sorted_errors.each do |error| %> |
||||
<% body.row do |row| %> |
||||
<% row.cell(text: error[0][0]) %> |
||||
<% row.cell(text: error[1]) %> |
||||
<% row.cell(text: BulkUpload::Lettings::Validator.question_for_field(error[0][1].to_sym)) %> |
||||
<% row.cell(text: error[0][2]) %> |
||||
<% row.cell(text: error[0][1]) %> |
||||
<% end %> |
||||
<% end %> |
||||
<% end %> |
||||
<% end %> |
||||
@ -0,0 +1,17 @@
|
||||
class BulkUploadErrorSummaryTableComponent < ViewComponent::Base |
||||
attr_reader :bulk_upload |
||||
|
||||
def initialize(bulk_upload:) |
||||
@bulk_upload = bulk_upload |
||||
|
||||
super |
||||
end |
||||
|
||||
def sorted_errors |
||||
@sorted_errors ||= bulk_upload |
||||
.bulk_upload_errors |
||||
.group(:col, :field, :error) |
||||
.count |
||||
.sort_by { |el| el[0][0].rjust(3, "0") } |
||||
end |
||||
end |
||||
@ -0,0 +1,93 @@
|
||||
class BulkUploadMailer < NotifyMailer |
||||
include ActionView::Helpers::TextHelper |
||||
|
||||
BULK_UPLOAD_COMPLETE_TEMPLATE_ID = "83279578-c890-4168-838b-33c9cf0dc9f0".freeze |
||||
BULK_UPLOAD_FAILED_CSV_ERRORS_TEMPLATE_ID = "e27abcd4-5295-48c2-b127-e9ee4b781b75".freeze |
||||
BULK_UPLOAD_FAILED_FILE_SETUP_ERROR_TEMPLATE_ID = "24c9f4c7-96ad-470a-ba31-eb51b7cbafd9".freeze |
||||
BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID = "c3f6288c-7a74-4e77-99ee-6c4a0f6e125a".freeze |
||||
BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID = "eb539005-6234-404e-812d-167728cf4274".freeze |
||||
|
||||
def send_bulk_upload_complete_mail(user:, bulk_upload:) |
||||
url = if bulk_upload.lettings? |
||||
lettings_logs_url |
||||
else |
||||
sales_logs_url |
||||
end |
||||
|
||||
n_logs = pluralize(bulk_upload.logs.count, "log") |
||||
|
||||
title = "You’ve successfully uploaded #{n_logs}" |
||||
|
||||
success_description = "The #{bulk_upload.log_type} #{bulk_upload.year_combo} data you uploaded has been checked. The #{n_logs} you uploaded are now complete." |
||||
|
||||
send_email( |
||||
user.email, |
||||
BULK_UPLOAD_COMPLETE_TEMPLATE_ID, |
||||
{ |
||||
title:, |
||||
filename: bulk_upload.filename, |
||||
upload_timestamp: bulk_upload.created_at, |
||||
success_description:, |
||||
logs_link: url, |
||||
}, |
||||
) |
||||
end |
||||
|
||||
def send_bulk_upload_failed_csv_errors_mail(user, bulk_upload) |
||||
send_email( |
||||
user.email, |
||||
BULK_UPLOAD_FAILED_CSV_ERRORS_TEMPLATE_ID, |
||||
{ |
||||
filename: "[#{bulk_upload} filename]", |
||||
upload_timestamp: "[#{bulk_upload} upload_timestamp]", |
||||
year_combo: "[#{bulk_upload} year_combo]", |
||||
lettings_or_sales: "[#{bulk_upload} lettings_or_sales]", |
||||
error_description: "[#{bulk_upload} error_description]", |
||||
summary_report_link: "[#{bulk_upload} summary_report_link]", |
||||
}, |
||||
) |
||||
end |
||||
|
||||
def send_bulk_upload_failed_file_setup_error_mail(user, bulk_upload) |
||||
send_email( |
||||
user.email, |
||||
BULK_UPLOAD_FAILED_FILE_SETUP_ERROR_TEMPLATE_ID, |
||||
{ |
||||
filename: "[#{bulk_upload} filename]", |
||||
upload_timestamp: "[#{bulk_upload} upload_timestamp]", |
||||
lettings_or_sales: "[#{bulk_upload} lettings_or_sales]", |
||||
year_combo: "[#{bulk_upload} year_combo]", |
||||
errors_list: "[#{bulk_upload} errors_list]", |
||||
bulk_upload_link: "[#{bulk_upload} bulk_upload_link]", |
||||
}, |
||||
) |
||||
end |
||||
|
||||
def send_bulk_upload_failed_service_error_mail(user, bulk_upload) |
||||
send_email( |
||||
user.email, |
||||
BULK_UPLOAD_FAILED_SERVICE_ERROR_TEMPLATE_ID, |
||||
{ |
||||
filename: "[#{bulk_upload} filename]", |
||||
upload_timestamp: "[#{bulk_upload} upload_timestamp]", |
||||
lettings_or_sales: "[#{bulk_upload} lettings_or_sales]", |
||||
year_combo: "[#{bulk_upload} year_combo]", |
||||
bulk_upload_link: "[#{bulk_upload} bulk_upload_link]", |
||||
}, |
||||
) |
||||
end |
||||
|
||||
def send_bulk_upload_with_errors_mail(user, bulk_upload) |
||||
send_email( |
||||
user.email, |
||||
BULK_UPLOAD_WITH_ERRORS_TEMPLATE_ID, |
||||
{ |
||||
title: "[#{bulk_upload} title]", |
||||
filename: "[#{bulk_upload} filename]", |
||||
upload_timestamp: "[#{bulk_upload} upload_timestamp]", |
||||
error_description: "[#{bulk_upload} error_description]", |
||||
summary_report_link: "[#{bulk_upload} summary_report_link]", |
||||
}, |
||||
) |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::AccessNeedsExist < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Housingneeds.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::AllocationSystem < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::LettingAllocation.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::ArmedForces < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Armedforces.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ArmedForcesInjured < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "armed_forces_injured" |
||||
@depends_on = [{ "armedforces" => 1 }, { "armedforces" => 4 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Reservist.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ArmedForcesServing < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "armed_forces_serving" |
||||
@depends_on = [{ "armedforces" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Leftreg.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::BenefitsProportion < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Benefits.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,17 @@
|
||||
class Form::Lettings::Pages::CareHome4Weekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "care_home_4_weekly" |
||||
@depends_on = [ |
||||
{ "period" => 3, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 3, "needstype" => 2, "household_charge" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::IsCarehome.new(nil, nil, self), |
||||
Form::Lettings::Questions::Chcharge4Weekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,17 @@
|
||||
class Form::Lettings::Pages::CareHomeBiWeekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "care_home_bi_weekly" |
||||
@depends_on = [ |
||||
{ "period" => 2, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 2, "needstype" => 2, "household_charge" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::IsCarehome.new(nil, nil, self), |
||||
Form::Lettings::Questions::ChchargeBiWeekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,17 @@
|
||||
class Form::Lettings::Pages::CareHomeMonthly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "care_home_monthly" |
||||
@depends_on = [ |
||||
{ "period" => 4, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 4, "needstype" => 2, "household_charge" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::IsCarehome.new(nil, nil, self), |
||||
Form::Lettings::Questions::ChchargeMonthly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,27 @@
|
||||
class Form::Lettings::Pages::CareHomeWeekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "care_home_weekly" |
||||
@depends_on = [ |
||||
{ "period" => 1, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 1, "needstype" => 2, "household_charge" => nil }, |
||||
{ "period" => 5, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 5, "needstype" => 2, "household_charge" => nil }, |
||||
{ "period" => 6, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 6, "needstype" => 2, "household_charge" => nil }, |
||||
{ "period" => 7, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 7, "needstype" => 2, "household_charge" => nil }, |
||||
{ "period" => 8, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 8, "needstype" => 2, "household_charge" => nil }, |
||||
{ "period" => 9, "needstype" => 2, "household_charge" => 0 }, |
||||
{ "period" => 9, "needstype" => 2, "household_charge" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::IsCarehome.new(nil, nil, self), |
||||
Form::Lettings::Questions::ChchargeWeekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::Declaration < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "declaration" |
||||
@header = "Department for Levelling Up, Housing & Communities privacy notice" |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Declaration.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" |
||||
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" |
||||
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" |
||||
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,36 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check" |
||||
@depends_on = [ |
||||
{ |
||||
"female_in_pregnant_household_in_soft_validation_range?" => true, |
||||
"age#{person_index}_known" => 0, |
||||
}, |
||||
] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "sex1", |
||||
"label" => true, |
||||
"i18n_template" => "sex1", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "sex1", |
||||
"label" => true, |
||||
"i18n_template" => "sex1", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,36 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check" |
||||
@depends_on = [ |
||||
{ |
||||
"female_in_pregnant_household_in_soft_validation_range?" => true, |
||||
"details_known_#{person_index}" => 0, |
||||
}, |
||||
] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "sex1", |
||||
"label" => true, |
||||
"i18n_template" => "sex1", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "sex1", |
||||
"label" => true, |
||||
"i18n_template" => "sex1", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "females_in_soft_age_range_in_pregnant_household_value_check" |
||||
@depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "first_time_property_let_as_social_housing" |
||||
@depends_on = [{ "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::FirstTimePropertyLetAsSocialHousing.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::HealthConditionEffects < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "health_condition_effects" |
||||
@depends_on = [{ "illness" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ConditionEffects.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::HealthConditions < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Illness.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::Homelessness < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Homeless.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::HouseholdMembers < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "household_members" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Hhmemb.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::HousingBenefit < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Hb.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,15 @@
|
||||
class Form::Lettings::Pages::IncomeAmount < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "income_amount" |
||||
@header = "Total household income" |
||||
@depends_on = [{ "net_income_known" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Earnings.new(nil, nil, self), |
||||
Form::Lettings::Questions::Incfreq.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::IncomeKnown < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "income_known" |
||||
@header = "Household’s combined income after tax" |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::NetIncomeKnown.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::Joint < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Joint.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,14 @@
|
||||
class Form::Lettings::Pages::LeadTenantAge < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_age" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Age1Known.new(nil, nil, self), |
||||
Form::Lettings::Questions::Age1.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_background_arab" |
||||
@depends_on = [{ "ethnic_group" => 4 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicArab.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_background_asian" |
||||
@depends_on = [{ "ethnic_group" => 2 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicAsian.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_background_black" |
||||
@depends_on = [{ "ethnic_group" => 3 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicBlack.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_background_mixed" |
||||
@depends_on = [{ "ethnic_group" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicMixed.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_background_white" |
||||
@depends_on = [{ "ethnic_group" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicWhite.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantEthnicGroup < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_ethnic_group" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::EthnicGroup.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantGenderIdentity < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_gender_identity" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::GenderIdentity1.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_nationality" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::National.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,32 @@
|
||||
class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_over_retirement_value_check" |
||||
@depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.retirement.max.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "retirement_age_for_person_1", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.retirement.max.hint_text", |
||||
"arguments" => [ |
||||
{ "key" => "plural_gender_for_person_1", "label" => false, "i18n_template" => "gender" }, |
||||
{ |
||||
"key" => "retirement_age_for_person_1", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RetirementValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,32 @@
|
||||
class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_under_retirement_value_check" |
||||
@depends_on = [{ "person_1_retired_under_soft_min_age?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.retirement.min.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "retirement_age_for_person_1", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.retirement.min.hint_text", |
||||
"arguments" => [ |
||||
{ "key" => "plural_gender_for_person_1", "label" => false, "i18n_template" => "gender" }, |
||||
{ |
||||
"key" => "retirement_age_for_person_1", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::NoRetirementValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::LeadTenantWorkingSituation < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "lead_tenant_working_situation" |
||||
@depends_on = [{ "declaration" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::WorkingSituation1.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,25 @@
|
||||
class Form::Lettings::Pages::MaxRentValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "max_rent_value_check" |
||||
@depends_on = [{ "rent_in_soft_max_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.rent.max.title_text", |
||||
"arguments" => [{ "key" => "brent", "label" => true, "i18n_template" => "brent" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.rent.max.hint_text", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "soft_max_for_period", |
||||
"label" => false, |
||||
"i18n_template" => "soft_max_for_period", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,25 @@
|
||||
class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "min_rent_value_check" |
||||
@depends_on = [{ "rent_in_soft_min_range?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.rent.min.title_text", |
||||
"arguments" => [{ "key" => "brent", "label" => true, "i18n_template" => "brent" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.rent.min.hint_text", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "soft_min_for_period", |
||||
"label" => false, |
||||
"i18n_template" => "soft_min_for_period", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RentValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "net_income_value_check" |
||||
@depends_on = [{ "net_income_soft_validation_triggered?" => true }] |
||||
@title_text = { "translation" => "soft_validations.net_income.title_text" } |
||||
@informative_text = { |
||||
"translation" => "soft_validations.net_income.hint_text", |
||||
"arguments" => [ |
||||
{ "key" => "ecstat1", "label" => true, "i18n_template" => "ecstat1" }, |
||||
{ "key" => "earnings", "label" => true, "i18n_template" => "earnings" }, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::NetIncomeValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,15 @@
|
||||
class Form::Lettings::Pages::NewBuildHandoverDate < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "new_build_handover_date" |
||||
@depends_on = [ |
||||
{ "renewal" => 0, "rsnvac" => 15 }, |
||||
{ "renewal" => 0, "rsnvac" => 16 }, |
||||
{ "renewal" => 0, "rsnvac" => 17 }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::VoiddateNewBuild.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "no_females_pregnant_household_lead_age_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "no_females_pregnant_household_lead_hhmemb_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "no_females_pregnant_household_lead_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "no_females_pregnant_household_person_#{person_index}_age_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "no_females_pregnant_household_person_#{person_index}_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,19 @@
|
||||
class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "no_females_pregnant_household_value_check" |
||||
@depends_on = [{ "no_females_in_a_pregnant_household?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.pregnancy.title", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.pregnancy.no_females", |
||||
"arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregnancyValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,16 @@
|
||||
class Form::Lettings::Pages::Outstanding < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "outstanding" |
||||
@depends_on = [ |
||||
{ "hb" => 1, "household_charge" => 0 }, |
||||
{ "hb" => 1, "household_charge" => nil }, |
||||
{ "hb" => 6, "household_charge" => 0 }, |
||||
{ "hb" => 6, "household_charge" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Hbrentshortfall.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,14 @@
|
||||
class Form::Lettings::Pages::OutstandingAmount < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "outstanding_amount" |
||||
@depends_on = [{ "hb" => 1, "hbrentshortfall" => 1 }, { "hb" => 6, "hbrentshortfall" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::TshortfallKnown.new(nil, nil, self), |
||||
Form::Lettings::Questions::Tshortfall.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,15 @@
|
||||
class Form::Lettings::Pages::PersonAge < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_age" |
||||
@depends_on = [{ "details_known_#{person_index}" => 0 }] |
||||
@person_index = person_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index), |
||||
Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,12 @@
|
||||
class Form::Lettings::Pages::PersonGenderIdentity < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_gender_identity" |
||||
@depends_on = [{ "details_known_#{person_index}" => 0 }] |
||||
@person_index = person_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PersonGenderIdentity.new(nil, nil, self, person_index: @person_index)] |
||||
end |
||||
end |
||||
@ -0,0 +1,13 @@
|
||||
class Form::Lettings::Pages::PersonKnown < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_known" |
||||
@header = "You’ve given us the details for #{person_index - 1} person in the household" |
||||
@depends_on = (person_index..8).map { |index| { "hhmemb" => index } } |
||||
@person_index = person_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::DetailsKnown.new(nil, nil, self, person_index: @person_index)] |
||||
end |
||||
end |
||||
@ -0,0 +1,36 @@
|
||||
class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_over_retirement_value_check" |
||||
@depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.retirement.max.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "retirement_age_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.retirement.max.hint_text", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "plural_gender_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "gender", |
||||
}, |
||||
{ |
||||
"key" => "retirement_age_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RetirementValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,12 @@
|
||||
class Form::Lettings::Pages::PersonRelationshipToLead < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_relationship_to_lead" |
||||
@depends_on = [{ "details_known_#{person_index}" => 0 }] |
||||
@person_index = person_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PersonRelationship.new(nil, nil, self, person_index: @person_index)] |
||||
end |
||||
end |
||||
@ -0,0 +1,36 @@
|
||||
class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_under_retirement_value_check" |
||||
@depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }] |
||||
@title_text = { |
||||
"translation" => "soft_validations.retirement.min.title", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "retirement_age_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
@informative_text = { |
||||
"translation" => "soft_validations.retirement.min.hint_text", |
||||
"arguments" => [ |
||||
{ |
||||
"key" => "plural_gender_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "gender", |
||||
}, |
||||
{ |
||||
"key" => "retirement_age_for_person_#{person_index}", |
||||
"label" => false, |
||||
"i18n_template" => "age", |
||||
}, |
||||
], |
||||
} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::NoRetirementValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,21 @@
|
||||
class Form::Lettings::Pages::PersonWorkingSituation < ::Form::Page |
||||
def initialize(id, hsh, subsection, person_index:) |
||||
super(id, hsh, subsection) |
||||
@id = "person_#{person_index}_working_situation" |
||||
@depends_on = [ |
||||
{ |
||||
"details_known_#{person_index}" => 0, |
||||
"age#{person_index}" => { |
||||
"operator" => ">", |
||||
"operand" => 15, |
||||
}, |
||||
}, |
||||
{ "details_known_#{person_index}" => 0, "age#{person_index}" => nil }, |
||||
] |
||||
@person_index = person_index |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PersonWorkingSituation.new(nil, nil, self, person_index: @person_index)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::Pregnant < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PregOcc.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PreviousHousingSituation < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "previous_housing_situation" |
||||
@depends_on = [{ "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Prevten.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PreviousHousingSituationRenewal < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "previous_housing_situation_renewal" |
||||
@depends_on = [{ "renewal" => 1, "needstype" => 2 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::PrevtenRenewal.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,14 @@
|
||||
class Form::Lettings::Pages::PreviousLocalAuthority < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "previous_local_authority" |
||||
@depends_on = [{ "is_previous_la_inferred" => false }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::PreviousLaKnown.new(nil, nil, self), |
||||
Form::Lettings::Questions::Prevloc.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,8 @@
|
||||
class Form::Lettings::Pages::PreviousPostcode < ::Form::Page |
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Ppcodenk.new(nil, nil, self), |
||||
Form::Lettings::Questions::PpostcodeFull.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyBuildingType < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_building_type" |
||||
@depends_on = [{ "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Builtype.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyLetType < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_let_type" |
||||
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0, "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Unitletas.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyLocalAuthority < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_local_authority" |
||||
@depends_on = [{ "is_la_inferred" => false, "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::La.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,25 @@
|
||||
class Form::Lettings::Pages::PropertyMajorRepairs < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_major_repairs" |
||||
@depends_on = [ |
||||
{ "renewal" => 0, "rsnvac" => 5 }, |
||||
{ "renewal" => 0, "rsnvac" => 6 }, |
||||
{ "renewal" => 0, "rsnvac" => 8 }, |
||||
{ "renewal" => 0, "rsnvac" => 9 }, |
||||
{ "renewal" => 0, "rsnvac" => 10 }, |
||||
{ "renewal" => 0, "rsnvac" => 11 }, |
||||
{ "renewal" => 0, "rsnvac" => 12 }, |
||||
{ "renewal" => 0, "rsnvac" => 13 }, |
||||
{ "renewal" => 0, "rsnvac" => 18 }, |
||||
{ "renewal" => 0, "rsnvac" => 19 }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Majorrepairs.new(nil, nil, self), |
||||
Form::Lettings::Questions::Mrcdate.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,13 @@
|
||||
class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_major_repairs_value_check" |
||||
@depends_on = [{ "major_repairs_date_in_soft_range?" => true }] |
||||
@title_text = { "translation" => "soft_validations.major_repairs_date.title_text" } |
||||
@informative_text = {} |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::MajorRepairsDateValueCheck.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyNumberOfBedrooms < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_number_of_bedrooms" |
||||
@depends_on = [{ "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Beds.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyNumberOfTimesReletNotSocialLet < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_number_of_times_relet_not_social_let" |
||||
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Offered.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyNumberOfTimesReletSocialLet < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_number_of_times_relet_social_let" |
||||
@depends_on = [{ "first_time_property_let_as_social_housing" => 1, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::OfferedSocialLet.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,14 @@
|
||||
class Form::Lettings::Pages::PropertyPostcode < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_postcode" |
||||
@depends_on = [{ "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::PostcodeKnown.new(nil, nil, self), |
||||
Form::Lettings::Questions::PostcodeFull.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyUnitType < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_unit_type" |
||||
@depends_on = [{ "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::UnittypeGn.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyVacancyReasonFirstLet < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_vacancy_reason_first_let" |
||||
@depends_on = [{ "first_time_property_let_as_social_housing" => 1, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::RsnvacFirstLet.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyVacancyReasonNotFirstLet < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_vacancy_reason_not_first_let" |
||||
@depends_on = [{ "first_time_property_let_as_social_housing" => 0, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Rsnvac.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::PropertyWheelchairAccessible < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "property_wheelchair_accessible" |
||||
@depends_on = [{ "needstype" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Wchair.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,14 @@
|
||||
class Form::Lettings::Pages::ReasonForLeavingLastSettledHome < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "reason_for_leaving_last_settled_home" |
||||
@depends_on = [{ "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Reason.new(nil, nil, self), |
||||
Form::Lettings::Questions::Reasonother.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "reason_for_leaving_last_settled_home_renewal" |
||||
@depends_on = [{ "renewal" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ReasonRenewal.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,5 @@
|
||||
class Form::Lettings::Pages::ReasonablePreference < ::Form::Page |
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Reasonpref.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ReasonablePreferenceReason < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "reasonable_preference_reason" |
||||
@depends_on = [{ "reasonpref" => 1 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ReasonablePreferenceReason.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::Referral < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "referral" |
||||
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 1, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Referral.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ReferralPrp < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "referral_prp" |
||||
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 1, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ReferralPrp.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ReferralSupportedHousing < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "referral_supported_housing" |
||||
@depends_on = [{ "managing_organisation_provider_type" => "LA", "needstype" => 2, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ReferralSupportedHousing.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::ReferralSupportedHousingPrp < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "referral_supported_housing_prp" |
||||
@depends_on = [{ "managing_organisation_provider_type" => "PRP", "needstype" => 2, "renewal" => 0 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::ReferralSupportedHousingPrp.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,23 @@
|
||||
class Form::Lettings::Pages::Rent4Weekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_4_weekly" |
||||
@header = "Household rent and charges" |
||||
@depends_on = [ |
||||
{ "household_charge" => 0, "period" => 3, "is_carehome" => 0 }, |
||||
{ "household_charge" => nil, "period" => 3, "is_carehome" => 0 }, |
||||
{ "household_charge" => 0, "period" => 3, "is_carehome" => nil }, |
||||
{ "household_charge" => nil, "period" => 3, "is_carehome" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::Brent4Weekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::Scharge4Weekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::Pscharge4Weekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::Supcharg4Weekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::Tcharge4Weekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,23 @@
|
||||
class Form::Lettings::Pages::RentBiWeekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_bi_weekly" |
||||
@header = "Household rent and charges" |
||||
@depends_on = [ |
||||
{ "household_charge" => 0, "period" => 2, "is_carehome" => 0 }, |
||||
{ "household_charge" => nil, "period" => 2, "is_carehome" => 0 }, |
||||
{ "household_charge" => 0, "period" => 2, "is_carehome" => nil }, |
||||
{ "household_charge" => nil, "period" => 2, "is_carehome" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::BrentBiWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SchargeBiWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::PschargeBiWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SupchargBiWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::TchargeBiWeekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,23 @@
|
||||
class Form::Lettings::Pages::RentMonthly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_monthly" |
||||
@header = "Household rent and charges" |
||||
@depends_on = [ |
||||
{ "household_charge" => 0, "period" => 4, "is_carehome" => 0 }, |
||||
{ "household_charge" => nil, "period" => 4, "is_carehome" => 0 }, |
||||
{ "household_charge" => 0, "period" => 4, "is_carehome" => nil }, |
||||
{ "household_charge" => nil, "period" => 4, "is_carehome" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::BrentMonthly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SchargeMonthly.new(nil, nil, self), |
||||
Form::Lettings::Questions::PschargeMonthly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SupchargMonthly.new(nil, nil, self), |
||||
Form::Lettings::Questions::TchargeMonthly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::RentOrOtherCharges < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_or_other_charges" |
||||
@depends_on = [{ "needstype" => 2 }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::HouseholdCharge.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,11 @@
|
||||
class Form::Lettings::Pages::RentPeriod < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_period" |
||||
@depends_on = [{ "household_charge" => 0 }, { "household_charge" => nil }] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [Form::Lettings::Questions::Period.new(nil, nil, self)] |
||||
end |
||||
end |
||||
@ -0,0 +1,43 @@
|
||||
class Form::Lettings::Pages::RentWeekly < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "rent_weekly" |
||||
@header = "Household rent and charges" |
||||
@depends_on = [ |
||||
{ "period" => 1, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 1, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 5, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 5, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 6, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 6, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 7, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 7, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 8, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 8, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 9, "household_charge" => 0, "is_carehome" => 0 }, |
||||
{ "period" => 9, "household_charge" => nil, "is_carehome" => 0 }, |
||||
{ "period" => 1, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 1, "household_charge" => nil, "is_carehome" => nil }, |
||||
{ "period" => 5, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 5, "household_charge" => nil, "is_carehome" => nil }, |
||||
{ "period" => 6, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 6, "household_charge" => nil, "is_carehome" => nil }, |
||||
{ "period" => 7, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 7, "household_charge" => nil, "is_carehome" => nil }, |
||||
{ "period" => 8, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 8, "household_charge" => nil, "is_carehome" => nil }, |
||||
{ "period" => 9, "household_charge" => 0, "is_carehome" => nil }, |
||||
{ "period" => 9, "household_charge" => nil, "is_carehome" => nil }, |
||||
] |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Lettings::Questions::BrentWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SchargeWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::PschargeWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::SupchargWeekly.new(nil, nil, self), |
||||
Form::Lettings::Questions::TchargeWeekly.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue