|
|
|
|
@ -35,14 +35,14 @@ class BulkUpload::Sales::Year2026::RowParser
|
|
|
|
|
field_27: "Is the property built or adapted to wheelchair user standards?", |
|
|
|
|
|
|
|
|
|
field_28: "Age of buyer 1", |
|
|
|
|
field_29: "Gender identity of buyer 1", |
|
|
|
|
field_29: "Buyer 1's sex, as registered at birth", |
|
|
|
|
field_30: "What is buyer 1’s ethnic group?", |
|
|
|
|
field_31: "What is buyer 1’s nationality?", |
|
|
|
|
field_32: "Working situation of buyer 1", |
|
|
|
|
field_33: "Will buyer 1 live in the property?", |
|
|
|
|
field_34: "Is buyer 2 or person 2 the partner of buyer 1?", |
|
|
|
|
field_35: "Age of person 2", |
|
|
|
|
field_36: "Gender identity of person 2", |
|
|
|
|
field_36: "Buyer/Person 2's sex, as registered at birth", |
|
|
|
|
field_37: "Which of the following best describes buyer 2’s ethnic background?", |
|
|
|
|
field_38: "What is buyer 2’s nationality?", |
|
|
|
|
field_39: "What is buyer 2 or person 2’s working situation?", |
|
|
|
|
@ -51,19 +51,19 @@ class BulkUpload::Sales::Year2026::RowParser
|
|
|
|
|
|
|
|
|
|
field_42: "Is person 3 the partner of buyer 1?", |
|
|
|
|
field_43: "Age of person 3", |
|
|
|
|
field_44: "Gender identity of person 3", |
|
|
|
|
field_44: "Person 3's sex, as registered at birth", |
|
|
|
|
field_45: "Working situation of person 3", |
|
|
|
|
field_46: "Is person 4 the partner of buyer 1?", |
|
|
|
|
field_47: "Age of person 4", |
|
|
|
|
field_48: "Gender identity of person 4", |
|
|
|
|
field_48: "Person 4's sex, as registered at birth", |
|
|
|
|
field_49: "Working situation of person 4", |
|
|
|
|
field_50: "Is person 5 the partner of buyer 1?", |
|
|
|
|
field_51: "Age of person 5", |
|
|
|
|
field_52: "Gender identity of person 5", |
|
|
|
|
field_52: "Person 5's sex, as registered at birth", |
|
|
|
|
field_53: "Working situation of person 5", |
|
|
|
|
field_54: "Is person 6 the partner of buyer 1?", |
|
|
|
|
field_55: "Age of person 6", |
|
|
|
|
field_56: "Gender identity of person 6", |
|
|
|
|
field_56: "Person 6's sex, as registered at birth", |
|
|
|
|
field_57: "Working situation of person 6", |
|
|
|
|
|
|
|
|
|
field_58: "What was buyer 1’s previous tenure?", |
|
|
|
|
@ -136,13 +136,7 @@ class BulkUpload::Sales::Year2026::RowParser
|
|
|
|
|
field_120: "How much was the cash deposit paid on the property?", |
|
|
|
|
field_121: "What are the total monthly leasehold charges for the property?", |
|
|
|
|
|
|
|
|
|
field_122: "Buyer 1's sex, as registered at birth", |
|
|
|
|
field_123: "Buyer/Person 2's sex, as registered at birth", |
|
|
|
|
field_124: "Person 3's sex, as registered at birth", |
|
|
|
|
field_125: "Person 4's sex, as registered at birth", |
|
|
|
|
field_126: "Person 5's sex, as registered at birth", |
|
|
|
|
field_127: "Person 6's sex, as registered at birth", |
|
|
|
|
field_128: "What is the building height classification?", |
|
|
|
|
field_122: "What is the building height classification?", |
|
|
|
|
}.freeze |
|
|
|
|
|
|
|
|
|
ERROR_BASE_KEY = "validations.sales.2026.bulk_upload".freeze |
|
|
|
|
@ -304,14 +298,7 @@ class BulkUpload::Sales::Year2026::RowParser
|
|
|
|
|
attribute :field_119, :integer |
|
|
|
|
attribute :field_120, :decimal |
|
|
|
|
attribute :field_121, :decimal |
|
|
|
|
|
|
|
|
|
attribute :field_122, :string |
|
|
|
|
attribute :field_123, :string |
|
|
|
|
attribute :field_124, :string |
|
|
|
|
attribute :field_125, :string |
|
|
|
|
attribute :field_126, :string |
|
|
|
|
attribute :field_127, :string |
|
|
|
|
attribute :field_128, :integer |
|
|
|
|
attribute :field_122, :integer |
|
|
|
|
|
|
|
|
|
validates :field_1, |
|
|
|
|
presence: { |
|
|
|
|
@ -552,8 +539,7 @@ class BulkUpload::Sales::Year2026::RowParser
|
|
|
|
|
"field_21", # postcode |
|
|
|
|
"field_22", # postcode |
|
|
|
|
"field_28", # age1 |
|
|
|
|
"field_29", # sex1 |
|
|
|
|
"field_122", # sexrab1 |
|
|
|
|
"field_29", # sexrab1 |
|
|
|
|
"field_32", # ecstat1 |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
@ -709,13 +695,6 @@ private
|
|
|
|
|
age5: %i[field_51], |
|
|
|
|
age6_known: %i[field_55], |
|
|
|
|
age6: %i[field_55], |
|
|
|
|
sex1: %i[field_29], |
|
|
|
|
sex2: %i[field_36], |
|
|
|
|
sex3: %i[field_44], |
|
|
|
|
|
|
|
|
|
sex4: %i[field_48], |
|
|
|
|
sex5: %i[field_52], |
|
|
|
|
sex6: %i[field_56], |
|
|
|
|
relat2: %i[field_34], |
|
|
|
|
relat3: %i[field_42], |
|
|
|
|
relat4: %i[field_46], |
|
|
|
|
@ -828,13 +807,13 @@ private
|
|
|
|
|
lasttransaction: %i[field_104 field_105 field_106], |
|
|
|
|
initialpurchase: %i[field_100 field_101 field_102], |
|
|
|
|
|
|
|
|
|
sexrab1: %i[field_122], |
|
|
|
|
sexrab2: %i[field_123], |
|
|
|
|
sexrab3: %i[field_124], |
|
|
|
|
sexrab4: %i[field_125], |
|
|
|
|
sexrab5: %i[field_126], |
|
|
|
|
sexrab6: %i[field_127], |
|
|
|
|
buildheightclass: %i[field_128], |
|
|
|
|
sexrab1: %i[field_29], |
|
|
|
|
sexrab2: %i[field_36], |
|
|
|
|
sexrab3: %i[field_44], |
|
|
|
|
sexrab4: %i[field_48], |
|
|
|
|
sexrab5: %i[field_52], |
|
|
|
|
sexrab6: %i[field_56], |
|
|
|
|
buildheightclass: %i[field_122], |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@ -863,20 +842,13 @@ private
|
|
|
|
|
attributes["age6_known"] = age6_known? |
|
|
|
|
attributes["age6"] = field_55 if attributes["age6_known"]&.zero? && field_55&.match(/\A\d{1,3}\z|\AR\z/) |
|
|
|
|
|
|
|
|
|
attributes["sex1"] = field_29 |
|
|
|
|
attributes["sex2"] = field_36 |
|
|
|
|
attributes["sex3"] = field_44 |
|
|
|
|
attributes["sex4"] = field_48 |
|
|
|
|
attributes["sex5"] = field_52 |
|
|
|
|
attributes["sex6"] = field_56 |
|
|
|
|
|
|
|
|
|
attributes["sexrab1"] = field_122 |
|
|
|
|
attributes["sexrab2"] = field_123 |
|
|
|
|
attributes["sexrab3"] = field_124 |
|
|
|
|
attributes["sexrab4"] = field_125 |
|
|
|
|
attributes["sexrab5"] = field_126 |
|
|
|
|
attributes["sexrab6"] = field_127 |
|
|
|
|
attributes["buildheightclass"] = field_128 |
|
|
|
|
attributes["sexrab1"] = field_29 |
|
|
|
|
attributes["sexrab2"] = field_36 |
|
|
|
|
attributes["sexrab3"] = field_44 |
|
|
|
|
attributes["sexrab4"] = field_48 |
|
|
|
|
attributes["sexrab5"] = field_52 |
|
|
|
|
attributes["sexrab6"] = field_56 |
|
|
|
|
attributes["buildheightclass"] = field_122 |
|
|
|
|
|
|
|
|
|
attributes["relat2"] = relationship_from_is_partner(field_34) |
|
|
|
|
attributes["relat3"] = relationship_from_is_partner(field_42) |
|
|
|
|
@ -1077,23 +1049,23 @@ private
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def person_2_present? |
|
|
|
|
field_35.present? || field_36.present? || field_34.present? || field_123.present? |
|
|
|
|
field_35.present? || field_36.present? || field_34.present? |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def person_3_present? |
|
|
|
|
field_43.present? || field_44.present? || field_42.present? || field_124.present? |
|
|
|
|
field_43.present? || field_44.present? || field_42.present? |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def person_4_present? |
|
|
|
|
field_47.present? || field_48.present? || field_46.present? || field_125.present? |
|
|
|
|
field_47.present? || field_48.present? || field_46.present? |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def person_5_present? |
|
|
|
|
field_51.present? || field_52.present? || field_50.present? || field_126.present? |
|
|
|
|
field_51.present? || field_52.present? || field_50.present? |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def person_6_present? |
|
|
|
|
field_55.present? || field_56.present? || field_54.present? || field_127.present? |
|
|
|
|
field_55.present? || field_56.present? || field_54.present? |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def relationship_from_is_partner(is_partner) |
|
|
|
|
@ -1316,7 +1288,6 @@ private
|
|
|
|
|
saledate |
|
|
|
|
age1 |
|
|
|
|
sexrab1 |
|
|
|
|
sex1 |
|
|
|
|
ecstat1 |
|
|
|
|
owning_organisation |
|
|
|
|
postcode_full |
|
|
|
|
@ -1493,8 +1464,7 @@ private
|
|
|
|
|
errors.add(:field_21, error_message) # Postcode |
|
|
|
|
errors.add(:field_22, error_message) # Postcode |
|
|
|
|
errors.add(:field_28, error_message) # Buyer 1 age |
|
|
|
|
errors.add(:field_29, error_message) # Buyer 1 gender |
|
|
|
|
errors.add(:field_122, error_message) # Buyer 1 sex registered at birth |
|
|
|
|
errors.add(:field_29, error_message) # Buyer 1 sex registered at birth |
|
|
|
|
errors.add(:field_32, error_message) # Buyer 1 working situation |
|
|
|
|
errors.add(:field_7, error_message) # Purchaser code |
|
|
|
|
end |
|
|
|
|
|