message:I18n.t("validations.not_answered",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
if:->{field_116.present?},
},
on::after_log
validates:field_117,
presence:{
message:I18n.t("validations.not_answered",question:"was the letting made under the Common Allocation Policy (CAP)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Common Allocation Policy (CAP)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"),
if:->{field_117.present?},
},
on::after_log
validates:field_118,
presence:{
message:I18n.t("validations.not_answered",question:"was the letting made under the Common Housing Register (CHR)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Common Housing Register (CHR)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"),
if:->{field_118.present?},
},
on::after_log
validates:field_46,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 1 must be a number or the letter R"},on::after_log
validates:field_52,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 2 must be a number or the letter R"},on::after_log,if:proc{details_known?(2).zero?}
validates:field_56,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 3 must be a number or the letter R"},on::after_log,if:proc{details_known?(3).zero?}
validates:field_60,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 4 must be a number or the letter R"},on::after_log,if:proc{details_known?(4).zero?}
validates:field_64,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 5 must be a number or the letter R"},on::after_log,if:proc{details_known?(5).zero?}
validates:field_68,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 6 must be a number or the letter R"},on::after_log,if:proc{details_known?(6).zero?}
validates:field_72,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 7 must be a number or the letter R"},on::after_log,if:proc{details_known?(7).zero?}
validates:field_76,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 8 must be a number or the letter R"},on::after_log,if:proc{details_known?(8).zero?}
errors.add(location_field,"#{location_or_scheme.capitalize} code must relate to a #{location_or_scheme} that is owned by the owning organisation or managing organisation.",category::setup)
errors.add(scheme_field,"This #{scheme_or_management_group} code does not belong to the owning organisation or managing organisation.",category::setup)
message:I18n.t("validations.not_answered",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"),
if:->{field_112.present?},
},
on::after_log
validates:field_113,
presence:{
message:I18n.t("validations.not_answered",question:"was the letting made under the Common Allocation Policy (CAP)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Common Allocation Policy (CAP)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"),
if:->{field_113.present?},
},
on::after_log
validates:field_114,
presence:{
message:I18n.t("validations.not_answered",question:"was the letting made under the Common Housing Register (CHR)?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Common Housing Register (CHR)?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"),
if:->{field_114.present?},
},
on::after_log
validates:field_115,
presence:{
message:I18n.t("validations.not_answered",question:"was the letting made under the Accessible Register?"),
message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"was the letting made under the Accessible Register?"),
category::not_answered,
},
inclusion:{
in:[1,2],
message:I18n.t("validations.invalid_option",question:"was the letting made under the Accessible Register?"),
message:I18n.t("#{ERROR_BASE_KEY}.invalid_option",question:"was the letting made under the Accessible Register?"),
if:->{field_115.present?},
},
on::after_log
validates:field_42,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 1 must be a number or the letter R"},on::after_log
validates:field_48,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 2 must be a number or the letter R"},on::after_log,if:proc{details_known?(2).zero?}
validates:field_52,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 3 must be a number or the letter R"},on::after_log,if:proc{details_known?(3).zero?}
validates:field_56,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 4 must be a number or the letter R"},on::after_log,if:proc{details_known?(4).zero?}
validates:field_60,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 5 must be a number or the letter R"},on::after_log,if:proc{details_known?(5).zero?}
validates:field_64,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 6 must be a number or the letter R"},on::after_log,if:proc{details_known?(6).zero?}
validates:field_68,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 7 must be a number or the letter R"},on::after_log,if:proc{details_known?(7).zero?}
validates:field_72,format:{with:/\A\d{1,3}\z|\AR\z/,message:"Age of person 8 must be a number or the letter R"},on::after_log,if:proc{details_known?(8).zero?}
errors.add(:field_3,category::setup,message:I18n.t("validations.not_answered",question:"what is the CORE username of the account this letting log should be assigned to?"))
errors.add(:field_3,category::setup,message:I18n.t("#{ERROR_BASE_KEY}.not_answered",question:"what is the CORE username of the account this letting log should be assigned to?"))
blank_file:"Template is blank - The template must be filled in for us to create the logs and check if data is correct."
wrong_field_numbers_count:"Incorrect number of fields, please ensure you have used the correct template."
over_max_column_count:"Too many columns, please ensure you have used the correct template."
wrong_template:"Incorrect start dates, please ensure you have used the correct template."
no_headers:"Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})."
bulk_upload/sales/validator:
attributes:
base:
@ -290,7 +282,6 @@ en:
startdate:
before_scheme_end_date:"The tenancy start date must be before the end date for this supported housing scheme."
year_not_two_or_four_digits:"Tenancy start year must be 2 or 4 digits."
location:
deactivated:
startdate:"The location %{postcode} is inactive on this date. Enter another date or choose another location."
@ -313,15 +304,6 @@ en:
scheme_id:"The scheme %{name} has no locations that are active on this date. Enter another date or choose another scheme."
owning_organisation:
data_sharing_agreement_not_signed:"The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."
lettype:
general_needs_mismatch:"Lettings type must be a general needs type because you selected general needs when uploading the file."
supported_housing_mismatch:"Lettings type must be a supported housing type because you selected supported housing when uploading the file."
needstype_general_needs:"This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type."
needstype_supported_housing:"This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type."
needstype:
lettype_not_general_needs:"This letting type is supported housing, but the needs type is general needs. Change either the needs type or the letting type."
lettype_not_supported_housing:"This letting type is general needs, but the needs type is supported housing. Change either the needs type or the letting type."
property:
uprn:
invalid:"UPRN must be 12 digits or less."
@ -486,13 +468,8 @@ en:
child_over_19:"Answer cannot be child as you told us person %{person_num} is over 19."
housingneeds_a:
one_or_two_choices:"You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’."
housingneeds_type:
only_one_option_permitted:"Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected."
housingneeds:
invalid:"If somebody in the household has disabled access needs, they must have the access needs listed, or other access needs."
no_disabled_needs_conjunction:"No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
dont_know_disabled_needs_conjunction:"Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
no_and_dont_know_disabled_needs_conjunction:"No disabled access needs and don’t know disabled access needs cannot be selected together."
prevten:
non_temp_accommodation:"Answer cannot be non-temporary accommodation as this is a re-let to a tenant who occupied the same property as temporary accommodation."
over_25_foster_care:"Answer cannot be a children’s home or foster care as the lead tenant is 26 or older."
@ -507,10 +484,8 @@ en:
other_homeless:"Answer cannot be internal transfer as the tenant was considered homeless by their landlord."
prevten_invalid:"Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}."
reason_permanently_decanted:"Answer must be internal transfer as the tenant was permanently decanted from another property owned by this landlord."
nominated_by_local_ha_but_la:"The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority."
la_general_needs:
internal_transfer:"Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting."
prp_referred_by_la:"The source of the referral cannot be referred by local authority housing department for a general needs log."
homeless:
assessed:
internal_transfer:"Answer cannot be 'assessed as homeless' as this tenancy is an internal transfer."
@ -531,8 +506,6 @@ en:
retired_female:"Answer cannot be ‘female’ as tenant is under 60 and retired."
reason:
not_internal_transfer:"Answer cannot be ‘permanently decanted from another property owned by this landlord’ as you told us the source of referral for this tenancy was not an internal transfer."
renewal_reason_needed:'The reason for leaving must be "End of assured shorthold tenancy - no fault" or "End of fixed term tenancy - no fault" if the letting is a renewal.'
renewal_reason_needed_2024:'The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason".'
other_not_settled:"Please give the reason for the tenant leaving their last settled home. This is where they were living before they became homeless, were living in temporary accommodation or sleeping rough."
condition_effects:
no_choices:"You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more."
invalid_option:"Enter a valid value for %{question}"
invalid_number:"Enter a number for %{question}"
spreadsheet_dupe:"This is a duplicate of a log in your file."
duplicate:"This is a duplicate log."
blank_file:"Template is blank - The template must be filled in for us to create the logs and check if data is correct."
wrong_template:
wrong_template:"Incorrect start dates, please ensure you have used the correct template."
no_headers:"Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})."
wrong_field_numbers_count:"Incorrect number of fields, please ensure you have used the correct template."
over_max_column_count:"Too many columns, please ensure you have used the correct template."
owning_organisation:
not_found:"The owning organisation code is incorrect."
not_stock_owner:"The owning organisation code provided is for an organisation that does not own stock."
not_permitted:"You do not have permission to add logs for this owning organisation."
managing_organisation:
no_relationship:"This managing organisation does not have a relationship with the owning organisation."
not_found:"The managing organisation code is incorrect."
not_answered:"The managing organisation code is incorrect."
assigned_to:
not_found:"User with the specified email could not be found."
organisation_not_related:"User must be related to owning organisation or managing organisation."
startdate:
outside_collection_window:"Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}."
year_not_two_or_four_digits:"Tenancy start year must be 2 or 4 digits."
housingneeds:
no_and_dont_know_disabled_needs_conjunction:"No disabled access needs and don’t know disabled access needs cannot be selected together."
dont_know_disabled_needs_conjunction:"Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
no_disabled_needs_conjunction:"No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
housingneeds_type:
only_one_option_permitted:"Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected."
condition_effects:
no_choices:"You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more."
lettype:
needstype_general_needs:"This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type."
needstype_supported_housing:"This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type."
needstype:
lettype_not_general_needs:"This letting type is supported housing, but the needs type is general needs. Change either the needs type or the letting type."
lettype_not_supported_housing:"This letting type is general needs, but the needs type is supported housing. Change either the needs type or the letting type."
reason:
renewal_reason_needed:"The reason for leaving must be \"End of assured shorthold tenancy - no fault\" or \"End of fixed term tenancy - no fault\" if the letting is a renewal."
referral:
general_needs_prp_referred_by_la:"The source of the referral cannot be referred by local authority housing department for a general needs log."
nominated_by_local_ha_but_la:"The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority."
scheme:
must_relate_to_org:"%{capitalised_location_or_scheme} code must relate to a %{location_or_scheme} that is owned by the owning organisation or managing organisation."
does_not_belong_to_org:"This %{scheme_or_management_group} code does not belong to the owning organisation or managing organisation."
declaration:
missing:"You must show the MHCLG privacy notice to the tenant before you can submit this log."
age:
invalid:"Age of person %{person_num} must be a number or the letter R"
invalid_option:"Enter a valid value for %{question}"
invalid_number:"Enter a number for %{question}"
spreadsheet_dupe:"This is a duplicate of a log in your file."
duplicate:"This is a duplicate log."
blank_file:"Template is blank - The template must be filled in for us to create the logs and check if data is correct."
wrong_template:
wrong_template:"Incorrect start dates, please ensure you have used the correct template."
no_headers:"Your file does not contain the required header rows. Add or check the header rows and upload your file again. [Read more about using the template headers](%{guidance_link})."
wrong_field_numbers_count:"Incorrect number of fields, please ensure you have used the correct template."
over_max_column_count:"Too many columns, please ensure you have used the correct template."
owning_organisation:
not_found:"The owning organisation code is incorrect."
not_stock_owner:"The owning organisation code provided is for an organisation that does not own stock."
not_permitted:
not_support:"You do not have permission to add logs for this owning organisation."
support:"This owning organisation is not affiliated with %{org_name}."
managing_organisation:
no_relationship:"This managing organisation does not have a relationship with the owning organisation."
not_found:"The managing organisation code is incorrect."
assigned_to:
not_found:"User with the specified email could not be found."
organisation_not_related:"User must be related to owning organisation or managing organisation."
startdate:
outside_collection_window:"Enter a date within the %{year_combo} collection year, which is between 1st April %{start_year} and 31st March %{end_year}."
year_not_two_or_four_digits:"Tenancy start year must be 2 or 4 digits."
housingneeds:
no_and_dont_know_disabled_needs_conjunction:"No disabled access needs and don’t know disabled access needs cannot be selected together."
dont_know_disabled_needs_conjunction:"Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
no_disabled_needs_conjunction:"No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs."
housingneeds_type:
only_one_option_permitted:"Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected."
condition_effects:
no_choices:"You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more."
reason:
renewal_reason_needed:"The reason for leaving must be \"End of social or private sector tenancy - no fault\", \"End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)\", \"End of social or private sector tenancy - evicted due to rent arrears\" or \"End of social or private sector tenancy - evicted for any other reason\"."
referral:
general_needs_prp_referred_by_la:"The source of the referral cannot be referred by local authority housing department for a general needs log."
nominated_by_local_ha_but_la:"The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority."
scheme:
must_relate_to_org:"This scheme code does not belong to the owning organisation or managing organisation."
location:
must_relate_to_org:"Location code must relate to a location that is owned by the owning organisation or managing organisation."
age:
invalid:"Age of person %{person_num} must be a number or the letter R"
address:
not_found:"We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."
nationality:
invalid:"Select a valid nationality."
charges:
missing_charges:"Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'."
@ -868,7 +868,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting."])
expect(parser.errors[:field_10]).toeq([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"is this a London Affordable Rent letting.")])
end
end
@ -879,7 +879,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting."])
expect(parser.errors[:field_10]).toeq([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"is this a London Affordable Rent letting.")])
end
end
@ -888,7 +888,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds error on field_12"do
parser.valid?
expect(parser.errors[:field_12]).toeq(["You must answer product name."])
@ -910,8 +910,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"is not permitted"do
parser.valid?
expect(parser.errors[:field_4]).toinclude("This letting type is supported housing, but the needs type is general needs. Change either the needs type or the letting type.")
expect(parser.errors[:field_5]).toinclude("This needs type is general needs, but the letting type is supported housing. Change either the needs type or the letting type.")
@ -925,8 +925,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"is not permitted"do
parser.valid?
expect(parser.errors[:field_4]).toinclude("This letting type is general needs, but the needs type is supported housing. Change either the needs type or the letting type.")
expect(parser.errors[:field_5]).toinclude("This needs type is supported housing, but the letting type is general needs. Change either the needs type or the letting type.")
@ -979,7 +979,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
@ -1005,7 +1005,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["You must answer management group code."])
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"management group code.")])
expect(parser.errors[:field_15].count).toeq(1)
end
end
@ -1018,7 +1018,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
@ -1054,7 +1054,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
@ -1067,7 +1067,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
@ -1122,7 +1122,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
parser.valid?
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation."])
@ -1147,7 +1147,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."])
@ -1173,7 +1173,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."])
@ -1186,7 +1186,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
parser.valid?
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation."])
@ -1255,7 +1255,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_102]).toinclude("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?")
expect(parser.errors[:field_102]).toinclude(I18n.t("validations.lettings.2023.bulk_upload.invalid_option",question:"what is the tenant’s main reason for the household leaving their last settled home?"))
end
end
end
@ -1490,7 +1490,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_9]).toinclude("Tenancy start year must be 2 or 4 digits.")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation.")
@ -1722,7 +1722,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds a setup error"do
parser.valid?
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toinclude("Enter a valid value for is this letting a renewal?")
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toinclude(I18n.t("validations.lettings.2023.bulk_upload.invalid_option",question:"is this letting a renewal?"))
end
end
end
@ -1743,9 +1743,9 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds appropriate errors"do
parser.valid?
expect(parser.errors[:field_18]).toeql(["You must answer UPRN."])
expect(parser.errors[:field_19]).toeql(["You must answer address line 1."])
expect(parser.errors[:field_21]).toeql(["You must answer town or city."])
expect(parser.errors[:field_19]).toeql([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"address line 1.")])
expect(parser.errors[:field_21]).toeql([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"town or city.")])
end
end
@ -1821,7 +1821,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"populates with correct error message"do
parser.valid?
expect(parser.errors[:field_30]).toeql(["You must answer type of building."])
expect(parser.errors[:field_30]).toeql([I18n.t("validations.lettings.2023.bulk_upload.not_answered",question:"type of building.")])
end
end
end
@ -2170,7 +2170,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_116]).toinclude("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)?")
expect(parser.errors[:field_116]).toinclude(I18n.t("validations.lettings.2023.bulk_upload.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"))
end
end
end
@ -2197,7 +2197,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_118]).toinclude("Enter a valid value for was the letting made under the Common Housing Register (CHR)?")
expect(parser.errors[:field_118]).toinclude(I18n.t("validations.lettings.2023.bulk_upload.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"))
end
end
end
@ -2224,7 +2224,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_117]).toinclude("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)?")
expect(parser.errors[:field_117]).toinclude(I18n.t("validations.lettings.2023.bulk_upload.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"))
end
end
end
@ -2736,8 +2736,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and b"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2747,8 +2747,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and c"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2758,8 +2758,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds b and c"do
parser.valid?
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2769,8 +2769,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and g"do
parser.valid?
expect(parser.errors[:field_87]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
@ -2793,8 +2793,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and h"do
parser.valid?
expect(parser.errors[:field_88]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_83]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
@ -779,7 +779,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"only has one error added to the field"do
parser.valid?
expect(parser.errors[:field_112]).toeql(["You must answer was the letting made under the Choice-Based Lettings (CBL)?"])
expect(parser.errors[:field_112]).toeql([I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"was the letting made under the Choice-Based Lettings (CBL)?")])
end
end
@ -789,7 +789,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"does not add an additional error"do
parser.valid?
expect(parser.errors[:field_116].length).toeq(1)
expect(parser.errors[:field_116]).toinclude(match"Enter a valid value for")
@ -833,7 +833,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"is not permitted"do
parser.valid?
expect(parser.errors[:field_3]).tobe_present
expect(parser.errors[:field_3]).toinclude("You must answer what is the CORE username of the account this letting log should be assigned to?")
expect(parser.errors[:field_3]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"what is the CORE username of the account this letting log should be assigned to?"))
end
it"blocks log creation"do
@ -915,8 +915,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"cannot be nulled"do
parser.valid?
expect(parser.errors[:field_5]).toeq(["You must answer scheme code."])
expect(parser.errors[:field_6]).toeq(["You must answer location code."])
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
@ -962,7 +962,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
@ -991,7 +991,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
@ -1081,7 +1081,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"is not permitted"do
parser.valid?
expect(parser.errors[:field_98]).toinclude('The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason".')
@ -1091,7 +1091,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_98]).toinclude("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?")
expect(parser.errors[:field_98]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"what is the tenant’s main reason for the household leaving their last settled home?"))
end
end
end
@ -1317,7 +1317,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_10]).toinclude("Tenancy start year must be 2 or 4 digits.")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation.")
@ -1596,7 +1596,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds a setup error"do
parser.valid?
expect(parser.errors.where(:field_7,category::setup).map(&:message)).toinclude("Enter a valid value for is this letting a renewal?")
expect(parser.errors.where(:field_7,category::setup).map(&:message)).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"is this letting a renewal?"))
end
end
end
@ -1627,10 +1627,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds errors to missing key address fields"do
parser.valid?
expect(parser.errors[:field_17]).toeql(["You must answer address line 1."])
expect(parser.errors[:field_19]).toeql(["You must answer town or city."])
expect(parser.errors[:field_21]).toeql(["You must answer part 1 of postcode."])
expect(parser.errors[:field_22]).toeql(["You must answer part 2 of postcode."])
expect(parser.errors[:field_17]).toeql([I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"address line 1.")])
expect(parser.errors[:field_19]).toeql([I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"town or city.")])
expect(parser.errors[:field_21]).toeql([I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"part 1 of postcode.")])
expect(parser.errors[:field_22]).toeql([I18n.t("validations.lettings.2024.bulk_upload.not_answered",question:"part 2 of postcode.")])
end
end
@ -1658,11 +1658,11 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds appropriate errors to UPRN and key address fields"do
parser.valid?
expect(parser.errors[:field_16]).toeql(["You must answer UPRN."])
expect(parser.errors[:field_17]).toeql(["You must answer address line 1."])
expect(parser.errors[:field_19]).toeql(["You must answer town or city."])
expect(parser.errors[:field_21]).toeql(["You must answer part 1 of postcode."])
expect(parser.errors[:field_22]).toeql(["You must answer part 2 of postcode."])
expect(parser.errors[field]).toeql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."])
expect(parser.errors[field]).toeql(["We could not find this address. Check the address data in your CSV file is correct and complete, or select the correct address using the CORE site."])
@ -2185,7 +2185,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_112]).toinclude("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)?")
expect(parser.errors[:field_112]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"was the letting made under the Choice-Based Lettings (CBL)?"))
end
end
end
@ -2212,7 +2212,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_114]).toinclude("Enter a valid value for was the letting made under the Common Housing Register (CHR)?")
expect(parser.errors[:field_114]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"was the letting made under the Common Housing Register (CHR)?"))
end
end
end
@ -2239,7 +2239,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_113]).toinclude("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)?")
expect(parser.errors[:field_113]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"was the letting made under the Common Allocation Policy (CAP)?"))
end
end
end
@ -2266,7 +2266,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_115]).toinclude("Enter a valid value for was the letting made under the Accessible Register?")
expect(parser.errors[:field_115]).toinclude(I18n.t("validations.lettings.2024.bulk_upload.invalid_option",question:"was the letting made under the Accessible Register?"))
end
end
end
@ -2603,10 +2603,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error to all missing charges"do
parser.valid?
expect(parser.errors[:field_125]).toeql(["Please enter the basic rent. If there is no basic rent, please enter '0'."])
expect(parser.errors[:field_126]).toeql(["Please enter the service charge. If there is no service charge, please enter '0'."])
expect(parser.errors[:field_127]).toeql(["Please enter the personal service charge. If there is no personal service charge, please enter '0'."])
expect(parser.errors[:field_128]).toeql(["Please enter the basic rent. If there is no basic rent, please enter '0'.","Please enter the service charge. If there is no service charge, please enter '0'.","Please enter the personal service charge. If there is no personal service charge, please enter '0'."])
expect(parser.errors[:field_127]).toeql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges",sentence_fragment:"personal service charge")])
expect(parser.errors[:field_128]).toeql([I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges",sentence_fragment:"basic rent"),I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges",sentence_fragment:"service charge"),I18n.t("validations.lettings.2024.bulk_upload.charges.missing_charges",sentence_fragment:"personal service charge")])
end
end
end
@ -2627,10 +2627,10 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error to all charges"do
parser.valid?
expect(parser.errors[:field_125]).toeql(["Please enter the support charge. If there is no support charge, please enter '0'."])
expect(parser.errors[:field_126]).toeql(["Please enter the support charge. If there is no support charge, please enter '0'."])
expect(parser.errors[:field_127]).toeql(["Please enter the support charge. If there is no support charge, please enter '0'."])
expect(parser.errors[:field_128]).toeql(["Please enter the support charge. If there is no support charge, please enter '0'."])
@ -2857,8 +2857,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and b"do
parser.valid?
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2868,8 +2868,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and c"do
parser.valid?
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2879,8 +2879,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds b and c"do
parser.valid?
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
@ -2890,8 +2890,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and g"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_79]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
@ -2914,8 +2914,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and h"do
parser.valid?
expect(parser.errors[:field_84]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_79]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")