Browse Source

Revert "Cldc 3114 enable support control of rent periods per organisation (#2…" (#2439)

This reverts commit eda367afb0.
pull/2443/head
Arthur Campbell 8 months ago committed by GitHub
parent
commit
1ebf71129e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 31
      app/controllers/organisations_controller.rb
  2. 11
      app/helpers/organisations_helper.rb
  3. 12
      app/models/derived_variables/lettings_log_variables.rb
  4. 9
      app/models/organisation.rb
  5. 2
      app/models/organisation_rent_period.rb
  6. 5
      app/models/validations/financial_validations.rb
  7. 25
      app/views/organisations/edit.html.erb
  8. 14
      app/views/organisations/new.html.erb
  9. 33
      app/views/organisations/show.html.erb
  10. 1
      config/locales/en.yml
  11. 11
      lib/tasks/create_organisation_rent_periods.rake
  12. 12
      spec/factories/organisation.rb
  13. 2
      spec/features/form/page_routing_spec.rb
  14. 2
      spec/fixtures/files/sales_logs_csv_export_codes_23.csv
  15. 2
      spec/fixtures/files/sales_logs_csv_export_codes_24.csv
  16. 2
      spec/fixtures/files/sales_logs_csv_export_labels_23.csv
  17. 2
      spec/fixtures/files/sales_logs_csv_export_labels_24.csv
  18. 2
      spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv
  19. 44
      spec/helpers/organisations_helper_spec.rb
  20. 1144
      spec/models/lettings_log_derived_fields_spec.rb
  21. 1914
      spec/models/lettings_log_spec.rb
  22. 2
      spec/models/location_spec.rb
  23. 67
      spec/models/organisation_spec.rb
  24. 4
      spec/models/sales_log_spec.rb
  25. 29
      spec/models/validations/financial_validations_spec.rb
  26. 4
      spec/request_helper.rb
  27. 119
      spec/requests/OrganisationsController/organisations_controller_rent_periods_spec.rb
  28. 2
      spec/requests/lettings_logs_controller_spec.rb
  29. 36
      spec/requests/organisations_controller_spec.rb
  30. 2
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb
  31. 2
      spec/services/bulk_upload/sales/year2023/row_parser_spec.rb
  32. 8
      spec/services/csv/sales_log_csv_service_spec.rb
  33. 6
      spec/services/merge/merge_organisations_service_spec.rb
  34. 5
      spec/views/organisations/show.html.erb_spec.rb

31
app/controllers/organisations_controller.rb

@ -73,31 +73,21 @@ class OrganisationsController < ApplicationController
end end
def new def new
@organisation = Organisation.new @resource = Organisation.new
@rent_periods = helpers.rent_periods_with_checked_attr
render "new", layout: "application" render "new", layout: "application"
end end
def create def create
selected_rent_periods = rent_period_params[:rent_periods].compact_blank @resource = Organisation.new(org_params)
@organisation = Organisation.new(org_params) if @resource.save
if @organisation.save redirect_to organisations_path
OrganisationRentPeriod.transaction do
selected_rent_periods.each { |period| OrganisationRentPeriod.create!(organisation: @organisation, rent_period: period) }
end
flash[:notice] = I18n.t("organisation.created", organisation: @organisation.name)
redirect_to organisation_path @organisation
else else
@rent_periods = helpers.rent_periods_with_checked_attr(checked_periods: selected_rent_periods)
render :new, status: :unprocessable_entity render :new, status: :unprocessable_entity
end end
end end
def edit def edit
if current_user.data_coordinator? || current_user.support? if current_user.data_coordinator? || current_user.support?
current_allowed_rent_periods = @organisation.organisation_rent_periods.pluck(:rent_period).map(&:to_s)
@used_rent_periods = @organisation.lettings_logs.pluck(:period).uniq.compact.map(&:to_s)
@rent_periods = helpers.rent_periods_with_checked_attr(checked_periods: current_allowed_rent_periods)
render "edit", layout: "application" render "edit", layout: "application"
else else
head :unauthorized head :unauthorized
@ -117,7 +107,6 @@ class OrganisationsController < ApplicationController
end end
def update def update
selected_rent_periods = rent_period_params[:rent_periods].compact_blank
if (current_user.data_coordinator? && org_params[:active].nil?) || current_user.support? if (current_user.data_coordinator? && org_params[:active].nil?) || current_user.support?
if @organisation.update(org_params) if @organisation.update(org_params)
case org_params[:active] case org_params[:active]
@ -136,15 +125,7 @@ class OrganisationsController < ApplicationController
else else
flash[:notice] = I18n.t("organisation.updated") flash[:notice] = I18n.t("organisation.updated")
end end
rent_periods_to_delete = rent_period_params[:all_rent_periods] - selected_rent_periods
OrganisationRentPeriod.transaction do
selected_rent_periods.each { |period| OrganisationRentPeriod.create(organisation: @organisation, rent_period: period) }
OrganisationRentPeriod.where(organisation: @organisation, rent_period: rent_periods_to_delete).destroy_all
end
redirect_to details_organisation_path(@organisation) redirect_to details_organisation_path(@organisation)
else
@rent_periods = helpers.rent_periods_with_checked_attr(checked_periods: selected_rent_periods)
render :edit, status: :unprocessable_entity
end end
else else
head :unauthorized head :unauthorized
@ -292,10 +273,6 @@ private
params.require(:organisation).permit(:name, :address_line1, :address_line2, :postcode, :phone, :holds_own_stock, :provider_type, :housing_registration_no, :active) params.require(:organisation).permit(:name, :address_line1, :address_line2, :postcode, :phone, :holds_own_stock, :provider_type, :housing_registration_no, :active)
end end
def rent_period_params
params.require(:organisation).permit(rent_periods: [], all_rent_periods: [])
end
def codes_only_export? def codes_only_export?
params.require(:codes_only) == "true" params.require(:codes_only) == "true"
end end

11
app/helpers/organisations_helper.rb

@ -14,11 +14,10 @@ module OrganisationsHelper
{ name: "Organisation ID", value: "ORG#{organisation.id}", editable: false }, { name: "Organisation ID", value: "ORG#{organisation.id}", editable: false },
{ name: "Address", value: organisation.address_string, editable: true }, { name: "Address", value: organisation.address_string, editable: true },
{ name: "Telephone number", value: organisation.phone, editable: true }, { name: "Telephone number", value: organisation.phone, editable: true },
{ name: "Registration number", value: organisation.housing_registration_no || "", editable: false },
{ name: "Type of provider", value: organisation.display_provider_type, editable: false }, { name: "Type of provider", value: organisation.display_provider_type, editable: false },
{ name: "Registration number", value: organisation.housing_registration_no || "", editable: false },
{ name: "Rent periods", value: organisation.rent_period_labels, editable: false, format: :bullet },
{ name: "Owns housing stock", value: organisation.holds_own_stock ? "Yes" : "No", editable: false }, { name: "Owns housing stock", value: organisation.holds_own_stock ? "Yes" : "No", editable: false },
{ name: "Rent periods", value: organisation.rent_period_labels, editable: true, format: :bullet },
{ name: "Data Sharing Agreement" },
{ name: "Status", value: status_tag(organisation.status), editable: false }, { name: "Status", value: status_tag(organisation.status), editable: false },
] ]
end end
@ -38,10 +37,4 @@ module OrganisationsHelper
end end
end end
end end
def rent_periods_with_checked_attr(checked_periods: nil)
RentPeriod.rent_period_mappings.each_with_object({}) do |(period_code, period_value), result|
result[period_code] = period_value.merge(checked: checked_periods.nil? || checked_periods.include?(period_code))
end
end
end end

12
app/models/derived_variables/lettings_log_variables.rb

@ -1,6 +1,7 @@
module DerivedVariables::LettingsLogVariables module DerivedVariables::LettingsLogVariables
include DerivedVariables::SharedLogic include DerivedVariables::SharedLogic
# renttype and unitletas values are different for intermediate rent (3 for renttype and 4 for unitletas)
RENT_TYPE_MAPPING = { RENT_TYPE_MAPPING = {
0 => 1, # "Social Rent" => "Social Rent" 0 => 1, # "Social Rent" => "Social Rent"
1 => 2, # "Affordable Rent" => "Affordable Rent" 1 => 2, # "Affordable Rent" => "Affordable Rent"
@ -11,6 +12,15 @@ module DerivedVariables::LettingsLogVariables
}.freeze }.freeze
UNITLETAS_MAPPING = { UNITLETAS_MAPPING = {
0 => 1, # "Social Rent" => "Social Rent basis"
1 => 2, # "Affordable Rent" => "Affordable Rent basis"
2 => 2, # "London Affordable Rent" => "Affordable Rent basis"
3 => 4, # "Rent to Buy" => "Intermediate Rent basis"
4 => 4, # "London Living Rent" => "Intermediate Rent basis"
5 => 4, # "Other intermediate rent product" => "Intermediate Rent basis"
}.freeze
UNITLETAS_MAPPING_23_24 = {
0 => 1, # "Social Rent" => "Social Rent basis" 0 => 1, # "Social Rent" => "Social Rent basis"
1 => 2, # "Affordable Rent" => "Affordable Rent basis" 1 => 2, # "Affordable Rent" => "Affordable Rent basis"
2 => 5, # "London Affordable Rent" => "London Affordable Rent basis" 2 => 5, # "London Affordable Rent" => "London Affordable Rent basis"
@ -110,7 +120,7 @@ module DerivedVariables::LettingsLogVariables
if is_renewal? if is_renewal?
self.underoccupation_benefitcap = 2 if collection_start_year == 2021 self.underoccupation_benefitcap = 2 if collection_start_year == 2021
self.voiddate = startdate self.voiddate = startdate
self.unitletas = UNITLETAS_MAPPING[rent_type] self.unitletas = form.start_date.year >= 2023 ? UNITLETAS_MAPPING_23_24[rent_type] : UNITLETAS_MAPPING[rent_type]
if is_general_needs? if is_general_needs?
self.prevten = 32 if owning_organisation&.provider_type == "PRP" self.prevten = 32 if owning_organisation&.provider_type == "PRP"
self.prevten = 30 if owning_organisation&.provider_type == "LA" self.prevten = 30 if owning_organisation&.provider_type == "LA"

9
app/models/organisation.rb

@ -2,7 +2,7 @@ class Organisation < ApplicationRecord
has_many :users, dependent: :delete_all has_many :users, dependent: :delete_all
has_many :data_protection_officers, -> { where(is_dpo: true) }, class_name: "User" has_many :data_protection_officers, -> { where(is_dpo: true) }, class_name: "User"
has_one :data_protection_confirmation has_one :data_protection_confirmation
has_many :organisation_rent_periods, dependent: :destroy has_many :organisation_rent_periods
has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id", dependent: :delete_all has_many :owned_schemes, class_name: "Scheme", foreign_key: "owning_organisation_id", dependent: :delete_all
has_many :parent_organisation_relationships, foreign_key: :child_organisation_id, class_name: "OrganisationRelationship" has_many :parent_organisation_relationships, foreign_key: :child_organisation_id, class_name: "OrganisationRelationship"
has_many :parent_organisations, through: :parent_organisation_relationships has_many :parent_organisations, through: :parent_organisation_relationships
@ -108,11 +108,8 @@ class Organisation < ApplicationRecord
end end
def rent_period_labels def rent_period_labels
rent_period_ids = rent_periods labels = rent_periods.map { |period| RentPeriod.rent_period_mappings.dig(period.to_s, "value") }
mappings = RentPeriod.rent_period_mappings labels.compact.presence || %w[All]
return %w[All] if (mappings.keys.map(&:to_i) - rent_period_ids).empty?
rent_period_ids.map { |id| mappings.dig(id.to_s, "value") }.compact
end end
def data_protection_confirmed? def data_protection_confirmed?

2
app/models/organisation_rent_period.rb

@ -1,5 +1,3 @@
class OrganisationRentPeriod < ApplicationRecord class OrganisationRentPeriod < ApplicationRecord
belongs_to :organisation belongs_to :organisation
validates :organisation_id, uniqueness: { scope: :rent_period } # rubocop:disable Rails/UniqueValidationWithoutIndex
end end

5
app/models/validations/financial_validations.rb

@ -145,9 +145,8 @@ module Validations::FinancialValidations
end end
def validate_rent_period(record) def validate_rent_period(record)
return unless record.managing_organisation && record.period if record.managing_organisation.present? && record.managing_organisation.rent_periods.present? &&
record.period && !record.managing_organisation.rent_periods.include?(record.period)
unless record.managing_organisation.rent_periods.include? record.period
record.errors.add :period, :wrong_rent_period, message: I18n.t( record.errors.add :period, :wrong_rent_period, message: I18n.t(
"validations.financial.rent_period.invalid_for_org", "validations.financial.rent_period.invalid_for_org",
org_name: record.managing_organisation.name, org_name: record.managing_organisation.name,

25
app/views/organisations/edit.html.erb

@ -12,43 +12,26 @@
</h1> </h1>
<% if current_user.support? %> <% if current_user.support? %>
<%= f.govuk_text_field :name, autocomplete: "name", label: { size: "m" } %> <%= f.govuk_text_field :name, autocomplete: "name" %>
<% end %> <% end %>
<%= f.govuk_text_field :address_line1, <%= f.govuk_text_field :address_line1,
label: { text: "Address line 1", size: "m" }, label: { text: "Address line 1" },
autocomplete: "address-line1" %> autocomplete: "address-line1" %>
<%= f.govuk_text_field :address_line2, <%= f.govuk_text_field :address_line2,
label: { text: "Address line 2", size: "m" }, label: { text: "Address line 2" },
autocomplete: "address-line2" %> autocomplete: "address-line2" %>
<%= f.govuk_text_field :postcode, <%= f.govuk_text_field :postcode,
label: { size: "m" },
autocomplete: "postal-code", autocomplete: "postal-code",
width: 10 %> width: 10 %>
<%= f.govuk_phone_field :phone, <%= f.govuk_phone_field :phone,
label: { text: "Telephone number", size: "m" }, label: { text: "Telephone number" },
autocomplete: "tel", autocomplete: "tel",
width: 20 %> width: 20 %>
<%= f.govuk_check_boxes_fieldset :rent_periods,
legend: { text: "What are the rent periods for the organisation?" },
hint: { text: "It is not possible to deselect rent periods that are used in logs" } do %>
<% @rent_periods.map do |key, period| %>
<%= f.govuk_check_box :rent_periods,
key,
label: { text: period["value"] },
checked: period[:checked],
disabled: @used_rent_periods.include?(key) %>
<% end %>
<% end %>
<% @rent_periods.keys.each do |period_key| %>
<%= f.hidden_field :all_rent_periods, value: period_key, multiple: true %>
<% end %>
<%= f.govuk_submit "Save changes" %> <%= f.govuk_submit "Save changes" %>
</div> </div>
</div> </div>

14
app/views/organisations/new.html.erb

@ -4,7 +4,7 @@
<%= govuk_back_link(href: :back) %> <%= govuk_back_link(href: :back) %>
<% end %> <% end %>
<%= form_for(@organisation, as: :organisation, html: { method: :post }) do |f| %> <%= form_for(@resource, as: :organisation, html: { method: :post }) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
@ -48,7 +48,7 @@
:id, :id,
:name, :name,
label: { text: "Organisation type", size: "m" }, label: { text: "Organisation type", size: "m" },
options: { disabled: [""], selected: @organisation.provider_type || "" } %> options: { disabled: [""], selected: @resource.provider_type || "" } %>
<%= f.govuk_collection_radio_buttons :holds_own_stock, <%= f.govuk_collection_radio_buttons :holds_own_stock,
[OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")],
@ -56,16 +56,6 @@
:name, :name,
legend: { text: "Does the organisation hold its own stock?", size: "m" } %> legend: { text: "Does the organisation hold its own stock?", size: "m" } %>
<%= f.govuk_check_boxes_fieldset :rent_periods,
legend: { text: "What are the rent periods for the organisation?" } do %>
<% @rent_periods.map do |key, period| %>
<%= f.govuk_check_box :rent_periods,
key,
label: { text: period["value"] },
checked: period[:checked] %>
<% end %>
<% end %>
<%= f.govuk_submit "Create organisation" %> <%= f.govuk_submit "Create organisation" %>
</div> </div>
</div> </div>

33
app/views/organisations/show.html.erb

@ -16,28 +16,25 @@
<%= govuk_summary_list do |summary_list| %> <%= govuk_summary_list do |summary_list| %>
<%= organisation_name_row(user: current_user, organisation: @organisation, summary_list:) %> <%= organisation_name_row(user: current_user, organisation: @organisation, summary_list:) %>
<% display_organisation_attributes(@organisation).each do |attr| %> <% display_organisation_attributes(@organisation).each do |attr| %>
<% if attr[:name] == "Data Sharing Agreement" %> <% if can_edit_org?(current_user) && attr[:editable] %>
<%= data_sharing_agreement_row(organisation: @organisation, user: current_user, summary_list:) %> <%= summary_list.with_row do |row| %>
<% row.with_key { attr[:name] } %>
<% row.with_value { details_html(attr) } %>
<% row.with_action(
visually_hidden_text: attr[:name].to_s.humanize.downcase,
href: edit_organisation_path(@organisation),
html_attributes: { "data-qa": "change-#{attr[:name].downcase}" },
) %>
<% end %>
<% else %> <% else %>
<% if can_edit_org?(current_user) && attr[:editable] %> <%= summary_list.with_row do |row| %>
<%= summary_list.with_row do |row| %> <% row.with_key { attr[:name] } %>
<% row.with_key { attr[:name] } %> <% row.with_value { details_html(attr) } %>
<% row.with_value { details_html(attr) } %> <% row.with_action %>
<% row.with_action(
visually_hidden_text: attr[:name].to_s.humanize.downcase,
href: edit_organisation_path(@organisation),
html_attributes: { "data-qa": "change-#{attr[:name].downcase}" },
) %>
<% end %>
<% else %>
<%= summary_list.with_row do |row| %>
<% row.with_key { attr[:name] } %>
<% row.with_value { details_html(attr) } %>
<% row.with_action %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<%= data_sharing_agreement_row(organisation: @organisation, user: current_user, summary_list:) %>
<% end %> <% end %>
<p>To report a merge or update your organisation details, <%= govuk_link_to "contact the helpdesk", GlobalConstants::HELPDESK_URL %>.</p> <p>To report a merge or update your organisation details, <%= govuk_link_to "contact the helpdesk", GlobalConstants::HELPDESK_URL %>.</p>
<%= render partial: "organisations/merged_organisation_details" %> <%= render partial: "organisations/merged_organisation_details" %>

1
config/locales/en.yml

@ -33,7 +33,6 @@ en:
service_name: "Submit social housing lettings and sales data (CORE)" service_name: "Submit social housing lettings and sales data (CORE)"
feedback_form: "https://forms.office.com/Pages/ResponsePage.aspx?id=EGg0v32c3kOociSi7zmVqC4YDsCJ3llAvEZelBFBLUBURFVUTzFDTUJPQlM4M0laTE5DTlNFSjJBQi4u" feedback_form: "https://forms.office.com/Pages/ResponsePage.aspx?id=EGg0v32c3kOociSi7zmVqC4YDsCJ3llAvEZelBFBLUBURFVUTzFDTUJPQlM4M0laTE5DTlNFSjJBQi4u"
organisation: organisation:
created: "%{organisation} was created"
updated: "Organisation details updated" updated: "Organisation details updated"
reactivated: "%{organisation} has been reactivated." reactivated: "%{organisation} has been reactivated."
deactivated: "%{organisation} has been deactivated." deactivated: "%{organisation} has been deactivated."

11
lib/tasks/create_organisation_rent_periods.rake

@ -1,11 +0,0 @@
desc "Create OrganisationRentPeriods for organisations that have none as they were previously assumed to have all"
task create_organisation_rent_periods: :environment do
org_ids_with_no_associated_rent_periods = Organisation.includes(:organisation_rent_periods).group(:id).count(:organisation_rent_periods).select { |_org_id, period_count| period_count.zero? }.keys
org_ids_with_no_associated_rent_periods.each do |organisation_id|
OrganisationRentPeriod.transaction do
(1..11).each do |rent_period|
OrganisationRentPeriod.create(organisation_id:, rent_period:)
end
end
end
end

12
spec/factories/organisation.rb

@ -14,18 +14,6 @@ FactoryBot.define do
with_dsa { true } with_dsa { true }
end end
transient do
skip_rent_period_creation { false }
end
after(:build) do |organisation, evaluator|
unless evaluator.skip_rent_period_creation
(1..11).each do |rent_period|
organisation.organisation_rent_periods << build(:organisation_rent_period, organisation:, rent_period:)
end
end
end
after(:create) do |org, evaluator| after(:create) do |org, evaluator|
if evaluator.with_dsa if evaluator.with_dsa
create( create(

2
spec/features/form/page_routing_spec.rb

@ -72,7 +72,7 @@ RSpec.describe "Form Page Routing" do
end end
it "does not show question if the answer could be inferred" do it "does not show question if the answer could be inferred" do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
visit("/lettings-logs/#{id}/property-postcode") visit("/lettings-logs/#{id}/property-postcode")

2
spec/fixtures/files/sales_logs_csv_export_codes_23.csv vendored

@ -1,2 +1,2 @@
ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT
,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,1,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,2,8,,,,1,1,2,1,1,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,1,2,1,30,X,17,17,18,1,1,P,35,X,17,,13,1,1,3,C,14,X,,X,-9,X,3,R,-9,R,10,,,,,1,1,,,0,,,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 ,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,1,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,2,8,,,,1,1,2,1,1,,,Address line 1,,Town or city,,SW1A,1AA,E09000003,Barnet,1,2,1,30,X,17,17,18,1,1,P,35,X,17,,13,1,1,3,C,14,X,,X,-9,X,3,R,-9,R,10,,,,,1,1,,,0,,,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0

1 ID STATUS DUPLICATESET CREATEDDATE UPLOADDATE FORM COLLECTIONYEAR CREATIONMETHOD DATAPROTECT OWNINGORGNAME MANINGORGNAME CREATEDBY USERNAME DAY MONTH YEAR PURCHID OWNERSHIP TYPE OTHTYPE COMPANY LIVEINBUYER JOINT JOINTMORE BEDS PROPTYPE BUILTYPE UPRN UPRNCONFIRMED ADDRESS1 ADDRESS2 TOWNCITY COUNTY PCODE1 PCODE2 LA LANAME WCHAIR NOINT PRIVACYNOTICE AGE1 SEX1 ETHNICGROUP1 ETHNIC NATIONAL ECSTAT1 LIVEINBUYER1 RELAT2 AGE2 SEX2 ETHNICGROUP2 ETHNIC2 NATIONAL2 ECSTAT2 LIVEINBUYER2 HHTYPE RELAT3 AGE3 SEX3 ECSTAT3 RELAT4 AGE4 SEX4 ECSTAT4 RELAT5 AGE5 SEX5 ECSTAT5 RELAT6 AGE6 SEX6 ECSTAT6 PREVTEN PPCODENK PPOSTC1 PPOSTC2 PREVIOUSLAKNOWN PREVLOC PREVLOCNAME PREGYRHA PREGOTHER PREGLA PREGGHB PREGBLANK BUY2LIVING PREVTEN2 HHREGRES HHREGRESSTILL ARMEDFORCESSPOUSE DISABLED WHEEL INC1NK INCOME1 INC1MORT INC2NK INCOME2 INC2MORT HB SAVINGSNK SAVINGS PREVOWN PREVSHARED PROPLEN STAIRCASE STAIRBOUGHT STAIROWNED STAIRCASETOSALE RESALE EXDAY EXMONTH EXYEAR HODAY HOMONTH HOYEAR LANOMAGR SOCTEN FROMBEDS FROMPROP SOCPREVTEN VALUE VALUE_VALUE_CHECK EQUITY MORTGAGEUSED MORTGAGE MORTGAGELENDER MORTGAGELENDEROTHER MORTLEN1 EXTRABOR DEPOSIT CASHDIS MRENT HASMSCHARGE MSCHARGE MSCHARGE_VALUE_CHECK DISCOUNT GRANT
2 completed 2023-12-08T00:00:00+00:00 2024-01-01T00:00:00+00:00 2023 1 false DLUHC DLUHC billyboy@eyeklaud.com billyboy@eyeklaud.com 8 12 2023 2 8 1 1 2 1 1 Address line 1 Town or city SW1A 1AA E09000033 E09000003 Westminster Barnet 1 2 1 30 X 17 17 18 1 1 P 35 X 17 13 1 1 3 C 14 X X -9 X 3 R -9 R 10 1 1 0 1 1 1 1 3 1 4 5 1 1 0 10000 1 0 10000 1 4 1 1 2 10 110000.0 1 20000.0 5 10 1 80000.0 1 100.0 10000.0

2
spec/fixtures/files/sales_logs_csv_export_codes_24.csv vendored

@ -1,2 +1,2 @@
ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT
,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,1,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,2,8,,,,1,1,2,1,,Address line 1,,Town or city,,SW1A 1AA,true,Westminster,E09000033,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,1,1,1,30,X,17,17,,1,1,P,35,X,17,,,1,1,3,C,14,X,9,X,-9,X,3,R,-9,R,10,,,,,1,0,SW1A,1AA,1,E09000033,Westminster,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0 ,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,1,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,2,8,,,,1,1,2,1,,Address line 1,,Town or city,,SW1A 1AA,false,Barnet,E09000003,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,1,1,1,30,X,17,17,,1,1,P,35,X,17,,,1,1,3,C,14,X,9,X,-9,X,3,R,-9,R,10,,,,,1,0,SW1A,1AA,1,E09000003,Barnet,1,1,1,1,,3,,1,4,5,1,1,0,10000,1,0,10000,1,4,1,,1,2,10,,,,,,,,,,,,,,,,,110000.0,,,1,20000.0,5,,10,1,80000.0,,,1,100.0,,,10000.0

1 ID STATUS DUPLICATESET CREATEDDATE UPLOADDATE COLLECTIONYEAR CREATIONMETHOD BULKUPLOADID DATAPROTECT OWNINGORGNAME MANINGORGNAME CREATEDBY USERNAME DAY MONTH YEAR PURCHID OWNERSHIP TYPE OTHTYPE COMPANY LIVEINBUYER JOINT JOINTMORE NOINT PRIVACYNOTICE UPRN ADDRESS1 ADDRESS2 TOWNCITY COUNTY POSTCODE ISLAINFERRED LANAME LA UPRNSELECTED ADDRESS_SEARCH_VALUE_CHECK ADDRESS1INPUT POSTCODEINPUT BULKADDRESS1 BULKADDRESS2 BULKTOWNCITY BULKCOUNTY BULKPOSTCODE BULKLA BEDS PROPTYPE BUILTYPE WCHAIR AGE1 SEX1 ETHNICGROUP1 ETHNIC NATIONALITYALL1 ECSTAT1 LIVEINBUYER1 RELAT2 AGE2 SEX2 ETHNICGROUP2 ETHNIC2 NATIONALITYALL2 ECSTAT2 LIVEINBUYER2 HHTYPE RELAT3 AGE3 SEX3 ECSTAT3 RELAT4 AGE4 SEX4 ECSTAT4 RELAT5 AGE5 SEX5 ECSTAT5 RELAT6 AGE6 SEX6 ECSTAT6 PREVTEN PPCODENK PPOSTC1 PPOSTC2 PREVIOUSLAKNOWN PREVLOC PREVLOCNAME PREGYRHA PREGOTHER PREGLA PREGGHB PREGBLANK BUY2LIVING PREVTEN2 HHREGRES HHREGRESSTILL ARMEDFORCESSPOUSE DISABLED WHEEL INC1NK INCOME1 INC1MORT INC2NK INCOME2 INC2MORT HB SAVINGSNK SAVINGS PREVOWN PREVSHARED PROPLEN STAIRCASE STAIRBOUGHT STAIROWNED STAIRCASETOSALE RESALE EXDAY EXMONTH EXYEAR HODAY HOMONTH HOYEAR LANOMAGR SOCTEN FROMBEDS FROMPROP SOCPREVTEN VALUE VALUE_VALUE_CHECK EQUITY MORTGAGEUSED MORTGAGE MORTGAGELENDER MORTGAGELENDEROTHER MORTLEN1 EXTRABOR DEPOSIT CASHDIS MRENT HASMSCHARGE MSCHARGE MSCHARGE_VALUE_CHECK DISCOUNT GRANT
2 in_progress 2024-05-01T00:00:00+01:00 2024-05-01T00:00:00+01:00 2024 1 false DLUHC DLUHC billyboy@eyeklaud.com billyboy@eyeklaud.com 1 5 2024 2 8 1 1 2 1 Address line 1 Town or city SW1A 1AA true false Westminster Barnet E09000033 E09000003 address line 1 as entered address line 2 as entered town or city as entered county as entered AB1 2CD la as entered 2 1 1 1 30 X 17 17 1 1 P 35 X 17 1 1 3 C 14 X 9 X -9 X 3 R -9 R 10 1 0 SW1A 1AA 1 E09000033 E09000003 Westminster Barnet 1 1 1 1 3 1 4 5 1 1 0 10000 1 0 10000 1 4 1 1 2 10 110000.0 1 20000.0 5 10 1 80000.0 1 100.0 10000.0

2
spec/fixtures/files/sales_logs_csv_export_labels_23.csv vendored

@ -1,2 +1,2 @@
ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,FORM,COLLECTIONYEAR,CREATIONMETHOD,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,BEDS,PROPTYPE,BUILTYPE,UPRN,UPRNCONFIRMED,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,PCODE1,PCODE2,LA,LANAME,WCHAIR,NOINT,PRIVACYNOTICE,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONAL,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONAL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT
,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,single log,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,2,Flat or maisonette,Purpose built,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,Yes,Yes,1,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,Buyer prefers not to say,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,No,,,No,,,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 ,completed,,2023-12-08T00:00:00+00:00,2024-01-01T00:00:00+00:00,,2023,single log,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,8,12,2023,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,2,Flat or maisonette,Purpose built,,,Address line 1,,Town or city,,SW1A,1AA,E09000003,Barnet,Yes,Yes,1,30,Non-binary,Buyer prefers not to say,17,United Kingdom,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,Buyer prefers not to say,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,No,,,No,,,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0

1 ID STATUS DUPLICATESET CREATEDDATE UPLOADDATE FORM COLLECTIONYEAR CREATIONMETHOD DATAPROTECT OWNINGORGNAME MANINGORGNAME CREATEDBY USERNAME DAY MONTH YEAR PURCHID OWNERSHIP TYPE OTHTYPE COMPANY LIVEINBUYER JOINT JOINTMORE BEDS PROPTYPE BUILTYPE UPRN UPRNCONFIRMED ADDRESS1 ADDRESS2 TOWNCITY COUNTY PCODE1 PCODE2 LA LANAME WCHAIR NOINT PRIVACYNOTICE AGE1 SEX1 ETHNICGROUP1 ETHNIC NATIONAL ECSTAT1 LIVEINBUYER1 RELAT2 AGE2 SEX2 ETHNICGROUP2 ETHNIC2 NATIONAL2 ECSTAT2 LIVEINBUYER2 HHTYPE RELAT3 AGE3 SEX3 ECSTAT3 RELAT4 AGE4 SEX4 ECSTAT4 RELAT5 AGE5 SEX5 ECSTAT5 RELAT6 AGE6 SEX6 ECSTAT6 PREVTEN PPCODENK PPOSTC1 PPOSTC2 PREVIOUSLAKNOWN PREVLOC PREVLOCNAME PREGYRHA PREGOTHER PREGLA PREGGHB PREGBLANK BUY2LIVING PREVTEN2 HHREGRES HHREGRESSTILL ARMEDFORCESSPOUSE DISABLED WHEEL INC1NK INCOME1 INC1MORT INC2NK INCOME2 INC2MORT HB SAVINGSNK SAVINGS PREVOWN PREVSHARED PROPLEN STAIRCASE STAIRBOUGHT STAIROWNED STAIRCASETOSALE RESALE EXDAY EXMONTH EXYEAR HODAY HOMONTH HOYEAR LANOMAGR SOCTEN FROMBEDS FROMPROP SOCPREVTEN VALUE VALUE_VALUE_CHECK EQUITY MORTGAGEUSED MORTGAGE MORTGAGELENDER MORTGAGELENDEROTHER MORTLEN1 EXTRABOR DEPOSIT CASHDIS MRENT HASMSCHARGE MSCHARGE MSCHARGE_VALUE_CHECK DISCOUNT GRANT
2 completed 2023-12-08T00:00:00+00:00 2024-01-01T00:00:00+00:00 2023 single log false DLUHC DLUHC billyboy@eyeklaud.com billyboy@eyeklaud.com 8 12 2023 Yes - a discounted ownership scheme Right to Acquire (RTA) Yes Yes 2 Flat or maisonette Purpose built Address line 1 Town or city SW1A 1AA E09000033 E09000003 Westminster Barnet Yes Yes 1 30 Non-binary Buyer prefers not to say 17 United Kingdom Full-time - 30 hours or more Yes Partner 35 Non-binary Buyer prefers not to say Buyer prefers not to say Full-time - 30 hours or more Yes 3 Child 14 Non-binary Other Not known Non-binary In government training into work Prefers not to say Not known Prefers not to say Prefers not to say Local authority tenant No No 1 1 1 1 Don't know Yes Yes No Yes Yes Yes 10000 Yes Yes 10000 Yes Don’t know No Yes No 10 110000.0 Yes 20000.0 Cambridge Building Society 10 Yes 80000.0 Yes 100.0 10000.0

2
spec/fixtures/files/sales_logs_csv_export_labels_24.csv vendored

@ -1,2 +1,2 @@
ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT ID,STATUS,DUPLICATESET,CREATEDDATE,UPLOADDATE,COLLECTIONYEAR,CREATIONMETHOD,BULKUPLOADID,DATAPROTECT,OWNINGORGNAME,MANINGORGNAME,CREATEDBY,USERNAME,DAY,MONTH,YEAR,PURCHID,OWNERSHIP,TYPE,OTHTYPE,COMPANY,LIVEINBUYER,JOINT,JOINTMORE,NOINT,PRIVACYNOTICE,UPRN,ADDRESS1,ADDRESS2,TOWNCITY,COUNTY,POSTCODE,ISLAINFERRED,LANAME,LA,UPRNSELECTED,ADDRESS_SEARCH_VALUE_CHECK,ADDRESS1INPUT,POSTCODEINPUT,BULKADDRESS1,BULKADDRESS2,BULKTOWNCITY,BULKCOUNTY,BULKPOSTCODE,BULKLA,BEDS,PROPTYPE,BUILTYPE,WCHAIR,AGE1,SEX1,ETHNICGROUP1,ETHNIC,NATIONALITYALL1,ECSTAT1,LIVEINBUYER1,RELAT2,AGE2,SEX2,ETHNICGROUP2,ETHNIC2,NATIONALITYALL2,ECSTAT2,LIVEINBUYER2,HHTYPE,RELAT3,AGE3,SEX3,ECSTAT3,RELAT4,AGE4,SEX4,ECSTAT4,RELAT5,AGE5,SEX5,ECSTAT5,RELAT6,AGE6,SEX6,ECSTAT6,PREVTEN,PPCODENK,PPOSTC1,PPOSTC2,PREVIOUSLAKNOWN,PREVLOC,PREVLOCNAME,PREGYRHA,PREGOTHER,PREGLA,PREGGHB,PREGBLANK,BUY2LIVING,PREVTEN2,HHREGRES,HHREGRESSTILL,ARMEDFORCESSPOUSE,DISABLED,WHEEL,INC1NK,INCOME1,INC1MORT,INC2NK,INCOME2,INC2MORT,HB,SAVINGSNK,SAVINGS,PREVOWN,PREVSHARED,PROPLEN,STAIRCASE,STAIRBOUGHT,STAIROWNED,STAIRCASETOSALE,RESALE,EXDAY,EXMONTH,EXYEAR,HODAY,HOMONTH,HOYEAR,LANOMAGR,SOCTEN,FROMBEDS,FROMPROP,SOCPREVTEN,VALUE,VALUE_VALUE_CHECK,EQUITY,MORTGAGEUSED,MORTGAGE,MORTGAGELENDER,MORTGAGELENDEROTHER,MORTLEN1,EXTRABOR,DEPOSIT,CASHDIS,MRENT,HASMSCHARGE,MSCHARGE,MSCHARGE_VALUE_CHECK,DISCOUNT,GRANT
,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,,Address line 1,,Town or city,,SW1A 1AA,Yes,Westminster,E09000033,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,Australia,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0 ,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,,Address line 1,,Town or city,,SW1A 1AA,No,Barnet,E09000003,,,,,address line 1 as entered,address line 2 as entered,town or city as entered,county as entered,AB1 2CD,la as entered,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,Australia,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,SW1A,1AA,Yes,E09000003,Barnet,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,,10000.0

1 ID STATUS DUPLICATESET CREATEDDATE UPLOADDATE COLLECTIONYEAR CREATIONMETHOD BULKUPLOADID DATAPROTECT OWNINGORGNAME MANINGORGNAME CREATEDBY USERNAME DAY MONTH YEAR PURCHID OWNERSHIP TYPE OTHTYPE COMPANY LIVEINBUYER JOINT JOINTMORE NOINT PRIVACYNOTICE UPRN ADDRESS1 ADDRESS2 TOWNCITY COUNTY POSTCODE ISLAINFERRED LANAME LA UPRNSELECTED ADDRESS_SEARCH_VALUE_CHECK ADDRESS1INPUT POSTCODEINPUT BULKADDRESS1 BULKADDRESS2 BULKTOWNCITY BULKCOUNTY BULKPOSTCODE BULKLA BEDS PROPTYPE BUILTYPE WCHAIR AGE1 SEX1 ETHNICGROUP1 ETHNIC NATIONALITYALL1 ECSTAT1 LIVEINBUYER1 RELAT2 AGE2 SEX2 ETHNICGROUP2 ETHNIC2 NATIONALITYALL2 ECSTAT2 LIVEINBUYER2 HHTYPE RELAT3 AGE3 SEX3 ECSTAT3 RELAT4 AGE4 SEX4 ECSTAT4 RELAT5 AGE5 SEX5 ECSTAT5 RELAT6 AGE6 SEX6 ECSTAT6 PREVTEN PPCODENK PPOSTC1 PPOSTC2 PREVIOUSLAKNOWN PREVLOC PREVLOCNAME PREGYRHA PREGOTHER PREGLA PREGGHB PREGBLANK BUY2LIVING PREVTEN2 HHREGRES HHREGRESSTILL ARMEDFORCESSPOUSE DISABLED WHEEL INC1NK INCOME1 INC1MORT INC2NK INCOME2 INC2MORT HB SAVINGSNK SAVINGS PREVOWN PREVSHARED PROPLEN STAIRCASE STAIRBOUGHT STAIROWNED STAIRCASETOSALE RESALE EXDAY EXMONTH EXYEAR HODAY HOMONTH HOYEAR LANOMAGR SOCTEN FROMBEDS FROMPROP SOCPREVTEN VALUE VALUE_VALUE_CHECK EQUITY MORTGAGEUSED MORTGAGE MORTGAGELENDER MORTGAGELENDEROTHER MORTLEN1 EXTRABOR DEPOSIT CASHDIS MRENT HASMSCHARGE MSCHARGE MSCHARGE_VALUE_CHECK DISCOUNT GRANT
2 in_progress 2024-05-01T00:00:00+01:00 2024-05-01T00:00:00+01:00 2024 single log false DLUHC DLUHC billyboy@eyeklaud.com billyboy@eyeklaud.com 1 5 2024 Yes - a discounted ownership scheme Right to Acquire (RTA) Yes Yes Yes 1 Address line 1 Town or city SW1A 1AA Yes No Westminster Barnet E09000033 E09000003 address line 1 as entered address line 2 as entered town or city as entered county as entered AB1 2CD la as entered 2 Flat or maisonette Purpose built Yes 30 Non-binary Buyer prefers not to say 17 Australia Full-time - 30 hours or more Yes Partner 35 Non-binary Buyer prefers not to say Full-time - 30 hours or more Yes 3 Child 14 Non-binary Child under 16 Other Not known Non-binary In government training into work Prefers not to say Not known Prefers not to say Prefers not to say Local authority tenant Yes SW1A 1AA Yes E09000033 E09000003 Westminster Barnet 1 1 1 1 Don't know Yes Yes No Yes Yes Yes 10000 Yes Yes 10000 Yes Don’t know No Yes No 10 110000.0 Yes 20000.0 Cambridge Building Society 10 Yes 80000.0 Yes 100.0 10000.0

2
spec/fixtures/files/sales_logs_csv_export_non_support_labels_24.csv vendored

@ -1,2 +1,2 @@
id,status,duplicate_set_id,created_at,updated_at,collection_start_year,creation_method,bulk_upload_id,is_dpo,owning_organisation_name,managing_organisation_name,assigned_to,day,month,year,purchid,ownershipsch,type,othtype,companybuy,buylivein,jointpur,jointmore,noint,privacynotice,uprn,uprn_confirmed,address_line1_input,postcode_full_input,uprn_selection,address_line1,address_line2,town_or_city,county,pcode1,pcode2,la,la_label,beds,proptype,builtype,wchair,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sex2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,pregyrha,pregother,pregla,pregghb,pregblank,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,proplen,staircase,stairbought,stairowned,staircasesale,resale,exday,exmonth,exyear,hoday,homonth,hoyear,lanomagr,soctenant,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortgagelender,mortgagelenderother,mortlen,extrabor,deposit,cashdis,mrent,has_mscharge,mscharge,discount,grant id,status,duplicate_set_id,created_at,updated_at,collection_start_year,creation_method,bulk_upload_id,is_dpo,owning_organisation_name,managing_organisation_name,assigned_to,day,month,year,purchid,ownershipsch,type,othtype,companybuy,buylivein,jointpur,jointmore,noint,privacynotice,uprn,uprn_confirmed,address_line1_input,postcode_full_input,uprn_selection,address_line1,address_line2,town_or_city,county,pcode1,pcode2,la,la_label,beds,proptype,builtype,wchair,age1,sex1,ethnic_group,ethnic,nationality_all,ecstat1,buy1livein,relat2,age2,sex2,ethnic_group2,ethnicbuy2,nationality_all_buyer2,ecstat2,buy2livein,hholdcount,relat3,age3,sex3,ecstat3,relat4,age4,sex4,ecstat4,relat5,age5,sex5,ecstat5,relat6,age6,sex6,ecstat6,prevten,ppcodenk,ppostc1,ppostc2,previous_la_known,prevloc,prevloc_label,pregyrha,pregother,pregla,pregghb,pregblank,buy2living,prevtenbuy2,hhregres,hhregresstill,armedforcesspouse,disabled,wheel,income1nk,income1,inc1mort,income2nk,income2,inc2mort,hb,savingsnk,savings,prevown,prevshared,proplen,staircase,stairbought,stairowned,staircasesale,resale,exday,exmonth,exyear,hoday,homonth,hoyear,lanomagr,soctenant,frombeds,fromprop,socprevten,value,equity,mortgageused,mortgage,mortgagelender,mortgagelenderother,mortlen,extrabor,deposit,cashdis,mrent,has_mscharge,mscharge,discount,grant
,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,,,,,,Address line 1,,Town or city,,SW1A,1AA,E09000033,Westminster,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,Australia,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,SW1A,1AA,Yes,E09000033,Westminster,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,10000.0 ,in_progress,,2024-05-01T00:00:00+01:00,2024-05-01T00:00:00+01:00,2024,single log,,false,DLUHC,DLUHC,billyboy@eyeklaud.com,1,5,2024,,Yes - a discounted ownership scheme,Right to Acquire (RTA),,,,Yes,Yes,Yes,1,,,,,,Address line 1,,Town or city,,SW1A,1AA,E09000003,Barnet,2,Flat or maisonette,Purpose built,Yes,30,Non-binary,Buyer prefers not to say,17,Australia,Full-time - 30 hours or more,Yes,Partner,35,Non-binary,Buyer prefers not to say,,,Full-time - 30 hours or more,Yes,3,Child,14,Non-binary,Child under 16,Other,Not known,Non-binary,In government training into work,Prefers not to say,Not known,Prefers not to say,Prefers not to say,,,,,Local authority tenant,Yes,SW1A,1AA,Yes,E09000003,Barnet,1,1,1,1,,Don't know,,Yes,Yes,No,Yes,Yes,Yes,10000,Yes,Yes,10000,Yes,Don’t know ,No,,Yes,No,10,,,,,,,,,,,,,,,,,110000.0,,Yes,20000.0,Cambridge Building Society,,10,Yes,80000.0,,,Yes,100.0,,10000.0

1 id status duplicate_set_id created_at updated_at collection_start_year creation_method bulk_upload_id is_dpo owning_organisation_name managing_organisation_name assigned_to day month year purchid ownershipsch type othtype companybuy buylivein jointpur jointmore noint privacynotice uprn uprn_confirmed address_line1_input postcode_full_input uprn_selection address_line1 address_line2 town_or_city county pcode1 pcode2 la la_label beds proptype builtype wchair age1 sex1 ethnic_group ethnic nationality_all ecstat1 buy1livein relat2 age2 sex2 ethnic_group2 ethnicbuy2 nationality_all_buyer2 ecstat2 buy2livein hholdcount relat3 age3 sex3 ecstat3 relat4 age4 sex4 ecstat4 relat5 age5 sex5 ecstat5 relat6 age6 sex6 ecstat6 prevten ppcodenk ppostc1 ppostc2 previous_la_known prevloc prevloc_label pregyrha pregother pregla pregghb pregblank buy2living prevtenbuy2 hhregres hhregresstill armedforcesspouse disabled wheel income1nk income1 inc1mort income2nk income2 inc2mort hb savingsnk savings prevown prevshared proplen staircase stairbought stairowned staircasesale resale exday exmonth exyear hoday homonth hoyear lanomagr soctenant frombeds fromprop socprevten value equity mortgageused mortgage mortgagelender mortgagelenderother mortlen extrabor deposit cashdis mrent has_mscharge mscharge discount grant
2 in_progress 2024-05-01T00:00:00+01:00 2024-05-01T00:00:00+01:00 2024 single log false DLUHC DLUHC billyboy@eyeklaud.com 1 5 2024 Yes - a discounted ownership scheme Right to Acquire (RTA) Yes Yes Yes 1 Address line 1 Town or city SW1A 1AA E09000033 E09000003 Westminster Barnet 2 Flat or maisonette Purpose built Yes 30 Non-binary Buyer prefers not to say 17 Australia Full-time - 30 hours or more Yes Partner 35 Non-binary Buyer prefers not to say Full-time - 30 hours or more Yes 3 Child 14 Non-binary Child under 16 Other Not known Non-binary In government training into work Prefers not to say Not known Prefers not to say Prefers not to say Local authority tenant Yes SW1A 1AA Yes E09000033 E09000003 Westminster Barnet 1 1 1 1 Don't know Yes Yes No Yes Yes Yes 10000 Yes Yes 10000 Yes Don’t know No Yes No 10 110000.0 Yes 20000.0 Cambridge Building Society 10 Yes 80000.0 Yes 100.0 10000.0

44
spec/helpers/organisations_helper_spec.rb

@ -3,57 +3,21 @@ require "rails_helper"
RSpec.describe OrganisationsHelper do RSpec.describe OrganisationsHelper do
include TagHelper include TagHelper
describe "display_organisation_attributes" do describe "display_organisation_attributes" do
let(:organisation) { create(:organisation, skip_rent_period_creation: true) } let(:organisation) { create(:organisation) }
it "has the correct values" do it "does not include data protection agreement" do
expect(display_organisation_attributes(organisation)).to eq( expect(display_organisation_attributes(organisation)).to eq(
[{ editable: false, name: "Organisation ID", value: "ORG#{organisation.id}" }, [{ editable: false, name: "Organisation ID", value: "ORG#{organisation.id}" },
{ editable: true, { editable: true,
name: "Address", name: "Address",
value: "2 Marsham Street\nLondon\nSW1P 4DF" }, value: "2 Marsham Street\nLondon\nSW1P 4DF" },
{ editable: true, name: "Telephone number", value: nil }, { editable: true, name: "Telephone number", value: nil },
{ editable: false, name: "Registration number", value: "1234" },
{ editable: false, name: "Type of provider", value: "Local authority" }, { editable: false, name: "Type of provider", value: "Local authority" },
{ editable: false, name: "Registration number", value: "1234" },
{ editable: false, format: :bullet, name: "Rent periods", value: %w[All] },
{ editable: false, name: "Owns housing stock", value: "Yes" }, { editable: false, name: "Owns housing stock", value: "Yes" },
{ editable: true, format: :bullet, name: "Rent periods", value: [] },
{ name: "Data Sharing Agreement" },
{ editable: false, name: "Status", value: status_tag(organisation.status) }], { editable: false, name: "Status", value: status_tag(organisation.status) }],
) )
end end
end end
describe "rent_periods_with_checked_attr" do
let(:fake_rent_periods) do
{
"1" => { "value" => "Every minute" },
"2" => { "value" => "Every decade" },
}
end
before do
allow(RentPeriod).to receive(:rent_period_mappings).and_return fake_rent_periods
end
it "returns rent_period_mappings" do
actual = rent_periods_with_checked_attr
expect(actual.keys).to eq RentPeriod.rent_period_mappings.keys
end
context "when checked_periods is nil" do
it "returns all rent periods with checked true" do
actual = rent_periods_with_checked_attr
checked_attrs = actual.values.map { |p| p[:checked] }
expect(checked_attrs).to all be true
end
end
context "when checked_periods is not nil" do
it "returns the rent_periods with the correct values checked" do
checked_rent_period = "1"
actual = rent_periods_with_checked_attr(checked_periods: [checked_rent_period])
expect(actual[checked_rent_period][:checked]).to be true
expect(actual["2"][:checked]).to be_falsey
end
end
end
end end

1144
spec/models/lettings_log_derived_fields_spec.rb

File diff suppressed because it is too large Load Diff

1914
spec/models/lettings_log_spec.rb

File diff suppressed because it is too large Load Diff

2
spec/models/location_spec.rb

@ -9,7 +9,7 @@ RSpec.describe Location, type: :model do
let(:location) { FactoryBot.build(:location) } let(:location) { FactoryBot.build(:location) }
before do before do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\",\"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\",\"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
stub_request(:get, /api.postcodes.io\/postcodes\/CA101AA/) stub_request(:get, /api.postcodes.io\/postcodes\/CA101AA/)

67
spec/models/organisation_spec.rb

@ -108,63 +108,32 @@ RSpec.describe Organisation, type: :model do
end end
end end
context "with associated rent periods" do context "when the organisation only uses specific rent periods" do
let(:organisation) { create(:organisation, skip_rent_period_creation: true) } let(:rent_period_mappings) do
let(:period_1_label) { "Every minute" } { "2" => { "value" => "Weekly for 52 weeks" }, "3" => { "value" => "Every 2 weeks" } }
let(:fake_rent_periods) do
{
"1" => { "value" => period_1_label },
"2" => { "value" => "Every decade" },
}
end end
before do before do
create(:organisation_rent_period, organisation:, rent_period: 1) create(:organisation_rent_period, organisation:, rent_period: 2)
allow(RentPeriod).to receive(:rent_period_mappings).and_return(fake_rent_periods) create(:organisation_rent_period, organisation:, rent_period: 3)
end
context "when the org does not use all rent periods" do
it "#rent_periods returns the correct ids" do
expect(organisation.rent_periods).to eq [1]
end
it "#rent_period_labels returns the correct labels" do
expect(organisation.rent_period_labels).to eq [period_1_label]
end
context "and has organisation rent periods associated for rent periods that no longer appear in the form" do
before do
create(:organisation_rent_period, organisation:, rent_period: 3)
end
it "#rent_period_labels returns the correct labels" do # Unmapped and ignored by `rent_period_labels`
expect(organisation.rent_period_labels).to eq [period_1_label] create(:organisation_rent_period, organisation:, rent_period: 10)
end allow(RentPeriod).to receive(:rent_period_mappings).and_return(rent_period_mappings)
end
end end
context "when the org uses all rent periods" do it "has rent periods associated" do
before do expect(organisation.rent_periods).to eq([2, 3, 10])
create(:organisation_rent_period, organisation:, rent_period: 2) end
end
it "#rent_periods returns the correct ids" do
expect(organisation.rent_periods).to eq [1, 2]
end
it "#rent_period_labels returns All" do
expect(organisation.rent_period_labels).to eq %w[All]
end
context "and has organisation rent periods associated for rent periods that no longer appear in the form" do it "maps the rent periods to display values" do
before do expect(organisation.rent_period_labels).to eq(["Weekly for 52 weeks", "Every 2 weeks"])
create(:organisation_rent_period, organisation:, rent_period: 3) end
end end
it "#rent_period_labels returns All" do context "when the organisation has not specified which rent periods it uses" do
expect(organisation.rent_period_labels).to eq %w[All] it "displays `all`" do
end expect(organisation.rent_period_labels).to eq(%w[All])
end
end end
end end

4
spec/models/sales_log_spec.rb

@ -535,7 +535,7 @@ RSpec.describe SalesLog, type: :model do
context "when saving addresses" do context "when saving addresses" do
before do before do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\",\"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\",\"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
end end
@ -820,7 +820,7 @@ RSpec.describe SalesLog, type: :model do
end end
before do before do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
end end

29
spec/models/validations/financial_validations_spec.rb

@ -139,34 +139,23 @@ RSpec.describe Validations::FinancialValidations do
end end
describe "rent period validations" do describe "rent period validations" do
let(:organisation) { create(:organisation, skip_rent_period_creation: true) } let(:organisation) { FactoryBot.create(:organisation) }
let(:user) { create(:user, organisation:) } let(:user) { FactoryBot.create(:user) }
let(:record) { create(:lettings_log, owning_organisation: organisation, managing_organisation: organisation, assigned_to: user) } let(:record) { FactoryBot.create(:lettings_log, owning_organisation: user.organisation, managing_organisation: organisation, assigned_to: user) }
let(:used_period) { 2 }
before do before do
create(:organisation_rent_period, organisation:, rent_period: used_period) FactoryBot.create(:organisation_relationship, parent_organisation: user.organisation, child_organisation: organisation)
record.period = period FactoryBot.create(:organisation_rent_period, organisation:, rent_period: 2)
end end
context "when the log uses a period that the org allows" do context "when the organisation only uses specific rent periods" do
let(:period) { used_period } it "validates that the selected rent period is used by the managing organisation" do
record.period = 3
it "does not apply a validation" do
financial_validator.validate_rent_period(record)
expect(record.errors["period"]).to be_empty
end
end
context "when the log uses a period that the org does not allow" do
let(:period) { used_period + 1 }
it "does apply a validation" do
financial_validator.validate_rent_period(record) financial_validator.validate_rent_period(record)
expect(record.errors["period"]) expect(record.errors["period"])
.to include(match I18n.t( .to include(match I18n.t(
"validations.financial.rent_period.invalid_for_org", "validations.financial.rent_period.invalid_for_org",
org_name: user.organisation.name, org_name: organisation.name,
rent_period: "every 4 weeks", rent_period: "every 4 weeks",
)) ))
end end

4
spec/request_helper.rb

@ -3,7 +3,7 @@ require "webmock/rspec"
module RequestHelper module RequestHelper
def self.stub_http_requests def self.stub_http_requests
WebMock.disable_net_connect!(allow_localhost: true) WebMock.disable_net_connect!(allow_localhost: true)
WebMock.stub_request(:get, /api\.postcodes\.io/) WebMock.stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":404,\"error\":\"Postcode not found\"}", headers: {}) .to_return(status: 200, body: "{\"status\":404,\"error\":\"Postcode not found\"}", headers: {})
WebMock.stub_request(:get, "https://api.postcodes.io/postcodes/AA11AA") WebMock.stub_request(:get, "https://api.postcodes.io/postcodes/AA11AA")
@ -14,8 +14,6 @@ module RequestHelper
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"postcode\":\"NW1L 5DP\",\"admin_district\":\"Westminster\",\"codes\":{\"admin_district\":\"E09000033\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"postcode\":\"NW1L 5DP\",\"admin_district\":\"Westminster\",\"codes\":{\"admin_district\":\"E09000033\"}}}", headers: {})
WebMock.stub_request(:get, "https://api.postcodes.io/postcodes/ZZ11ZZ") WebMock.stub_request(:get, "https://api.postcodes.io/postcodes/ZZ11ZZ")
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"postcode\":\"ZZ1 1ZZ\",\"admin_district\":\"Westminster\",\"codes\":{\"admin_district\":\"E09000033\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"postcode\":\"ZZ1 1ZZ\",\"admin_district\":\"Westminster\",\"codes\":{\"admin_district\":\"E09000033\"}}}", headers: {})
WebMock.stub_request(:get, "https://api.postcodes.io/postcodes/SW1A1AA")
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"postcode\":\"ZZ1 1ZZ\",\"admin_district\":\"Westminster\",\"codes\":{\"admin_district\":\"E09000033\"}}}", headers: {})
WebMock.stub_request(:post, /api.notifications.service.gov.uk\/v2\/notifications\/email/) WebMock.stub_request(:post, /api.notifications.service.gov.uk\/v2\/notifications\/email/)
.to_return(status: 200, body: "", headers: {}) .to_return(status: 200, body: "", headers: {})

119
spec/requests/OrganisationsController/organisations_controller_rent_periods_spec.rb

@ -1,119 +0,0 @@
require "rails_helper"
RSpec.describe OrganisationsController, type: :request do
let(:user) { create(:user, :support) }
let(:headers) { { "Accept" => "text/html" } }
let(:page) { Capybara::Node::Simple.new(response.body) }
before do
allow(user).to receive(:need_two_factor_authentication?).and_return(false)
sign_in user
end
describe "#new" do
before do
get new_organisation_path
end
it "displays the rent periods question" do
expect(page).to have_content "What are the rent periods for the organisation?"
end
it "the checkboxes for each rent period are checked by default" do
checkboxes = page.all "input[type='checkbox'][name='organisation[rent_periods][]']"
expect(checkboxes.count).to be > 5
expect(checkboxes.all? { |box| box[:checked] }).to be true
end
end
describe "#create" do
let(:org_name) { "abode team" }
let(:expected_rent_periods) { [1, 2, 3] }
let(:params) do
{
"organisation": {
name: org_name,
provider_type: "LA",
rent_periods: expected_rent_periods,
},
}
end
before do
post organisations_path headers:, params:
end
it "creates organisation rent periods with the correct rent period and organisation id" do
org = Organisation.includes(:organisation_rent_periods).find_by_name(org_name)
org_rent_periods = org.organisation_rent_periods
expect(org_rent_periods.count).to be expected_rent_periods.count
expect(org_rent_periods.map(&:rent_period)).to match_array expected_rent_periods
expect(org_rent_periods.map(&:organisation_id)).to all be org.id
end
end
describe "#edit" do
let(:organisation) { create(:organisation, skip_rent_period_creation: true) }
let(:fake_rent_periods) do
{
"1" => { "value" => "Every minute" },
"2" => { "value" => "Every decade" },
}
end
let(:checked_rent_period_id) { "1" }
before do
allow(RentPeriod).to receive(:rent_period_mappings).and_return fake_rent_periods
create(:organisation_rent_period, organisation:, rent_period: checked_rent_period_id)
get edit_organisation_path organisation
end
it "displays the rent periods question" do
expect(page).to have_content "What are the rent periods for the organisation?"
end
it "the checkboxes for each rent period are checked where appropriate" do
checkboxes = page.all "input[type='checkbox']"
expect(checkboxes.count).to be 2
expected_checked_checkbox = checkboxes.find { |cb| cb[:value] == checked_rent_period_id }
expect(expected_checked_checkbox[:checked]).to be true
expected_not_checked_checkbox = checkboxes.find { |cb| cb[:value] != checked_rent_period_id }
expect(expected_not_checked_checkbox[:checked]).to be false
end
end
describe "#update" do
let(:organisation) { create(:organisation, skip_rent_period_creation: true) }
let(:initially_checked_rent_period_id) { "1" }
let(:initially_unchecked_rent_period_id) { "2" }
let(:params) do
{
"organisation": {
name: organisation.name,
rent_periods: [initially_unchecked_rent_period_id],
all_rent_periods: [initially_unchecked_rent_period_id, initially_checked_rent_period_id],
},
}
end
before do
create(:organisation_rent_period, organisation:, rent_period: initially_checked_rent_period_id)
end
it "creates and destroys organisation rent periods as appropriate" do
rent_periods = Organisation.includes(:organisation_rent_periods)
.find(organisation.id)
.organisation_rent_periods
expect(rent_periods.count).to be 1
expect(rent_periods.first.rent_period.to_s).to eq initially_checked_rent_period_id
patch organisation_path(organisation, headers:, params:)
rent_periods = Organisation.includes(:organisation_rent_periods)
.find(organisation.id)
.organisation_rent_periods
expect(rent_periods.count).to be 1
expect(rent_periods.first.rent_period.to_s).to eq initially_unchecked_rent_period_id
end
end
end

2
spec/requests/lettings_logs_controller_spec.rb

@ -1319,7 +1319,7 @@ RSpec.describe LettingsLogsController, type: :request do
Singleton.__init__(FormHandler) Singleton.__init__(FormHandler)
completed_lettings_log.update!(startdate: Time.zone.local(2021, 4, 1), voiddate: Time.zone.local(2021, 4, 1), mrcdate: Time.zone.local(2021, 4, 1)) completed_lettings_log.update!(startdate: Time.zone.local(2021, 4, 1), voiddate: Time.zone.local(2021, 4, 1), mrcdate: Time.zone.local(2021, 4, 1))
Timecop.unfreeze Timecop.unfreeze
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
sign_in user sign_in user
end end

36
spec/requests/organisations_controller_spec.rb

@ -7,8 +7,7 @@ RSpec.describe OrganisationsController, type: :request do
let(:page) { Capybara::Node::Simple.new(response.body) } let(:page) { Capybara::Node::Simple.new(response.body) }
let(:user) { create(:user, :data_coordinator) } let(:user) { create(:user, :data_coordinator) }
let(:new_value) { "Test Name 35" } let(:new_value) { "Test Name 35" }
let(:active) { nil } let(:params) { { id: organisation.id, organisation: { name: new_value } } }
let(:params) { { id: organisation.id, organisation: { name: new_value, active:, rent_periods: [], all_rent_periods: [] } } }
before do before do
Timecop.freeze(Time.zone.local(2024, 3, 1)) Timecop.freeze(Time.zone.local(2024, 3, 1))
@ -582,7 +581,12 @@ RSpec.describe OrganisationsController, type: :request do
end end
context "with active parameter true" do context "with active parameter true" do
let(:active) { true } let(:params) do
{
id: organisation.id,
organisation: { active: "true" },
}
end
it "redirects" do it "redirects" do
expect(response).to have_http_status(:unauthorized) expect(response).to have_http_status(:unauthorized)
@ -590,7 +594,12 @@ RSpec.describe OrganisationsController, type: :request do
end end
context "with active parameter false" do context "with active parameter false" do
let(:active) { false } let(:params) do
{
id: organisation.id,
organisation: { active: "false" },
}
end
it "redirects" do it "redirects" do
expect(response).to have_http_status(:unauthorized) expect(response).to have_http_status(:unauthorized)
@ -696,7 +705,6 @@ RSpec.describe OrganisationsController, type: :request do
provider_type: "LA", provider_type: "LA",
holds_own_stock: "true", holds_own_stock: "true",
housing_registration_no: "7917937", housing_registration_no: "7917937",
rent_periods: [],
}, },
} }
end end
@ -1321,7 +1329,7 @@ RSpec.describe OrganisationsController, type: :request do
end end
it "allows to edit the organisation details" do it "allows to edit the organisation details" do
expect(page).to have_link("Change") expect(page).to have_link("Change", count: 3)
end end
end end
@ -1426,10 +1434,8 @@ RSpec.describe OrganisationsController, type: :request do
end end
describe "#update" do describe "#update" do
let(:params) { { id: organisation.id, organisation: { active:, rent_periods: [], all_rent_periods: [] } } }
context "with active parameter false" do context "with active parameter false" do
let(:active) { false } let(:params) { { id: organisation.id, organisation: { active: "false" } } }
user_to_update = nil user_to_update = nil
@ -1449,9 +1455,15 @@ RSpec.describe OrganisationsController, type: :request do
user_to_reactivate = nil user_to_reactivate = nil
user_not_to_reactivate = nil user_not_to_reactivate = nil
let(:params) do
{
id: organisation.id,
organisation: { active: "true" },
}
end
let(:notify_client) { instance_double(Notifications::Client) } let(:notify_client) { instance_double(Notifications::Client) }
let(:devise_notify_mailer) { DeviseNotifyMailer.new } let(:devise_notify_mailer) { DeviseNotifyMailer.new }
let(:active) { true }
let(:expected_personalisation) do let(:expected_personalisation) do
{ {
name: user_to_reactivate.name, name: user_to_reactivate.name,
@ -1535,7 +1547,6 @@ RSpec.describe OrganisationsController, type: :request do
provider_type:, provider_type:,
holds_own_stock:, holds_own_stock:,
housing_registration_no:, housing_registration_no:,
rent_periods: [],
}, },
} }
end end
@ -1558,8 +1569,7 @@ RSpec.describe OrganisationsController, type: :request do
it "redirects to the organisation list" do it "redirects to the organisation list" do
request request
organisation = Organisation.find_by(housing_registration_no:) expect(response).to redirect_to("/organisations")
expect(response).to redirect_to organisation_path(organisation)
end end
context "when required params are missing" do context "when required params are missing" do

2
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -84,7 +84,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
describe "validations" do describe "validations" do
before do before do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
parser.valid? parser.valid?

2
spec/services/bulk_upload/sales/year2023/row_parser_spec.rb

@ -232,7 +232,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
describe "validations" do describe "validations" do
before do before do
stub_request(:get, /api\.postcodes\.io/) stub_request(:get, /api.postcodes.io/)
.to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {}) .to_return(status: 200, body: "{\"status\":200,\"result\":{\"admin_district\":\"Manchester\", \"codes\":{\"admin_district\": \"E08000003\"}}}", headers: {})
parser.valid? parser.valid?

8
spec/services/csv/sales_log_csv_service_spec.rb

@ -160,13 +160,13 @@ RSpec.describe Csv::SalesLogCsvService do
it "exports the code for the local authority under the heading 'la'" do it "exports the code for the local authority under the heading 'la'" do
la_column_index = csv.first.index("LA") la_column_index = csv.first.index("LA")
la_value = csv.second[la_column_index] la_value = csv.second[la_column_index]
expect(la_value).to eq "E09000033" expect(la_value).to eq "E09000003"
end end
it "exports the label for the local authority under the heading 'la_label'" do it "exports the label for the local authority under the heading 'la_label'" do
la_label_column_index = csv.first.index("LANAME") la_label_column_index = csv.first.index("LANAME")
la_label_value = csv.second[la_label_column_index] la_label_value = csv.second[la_label_column_index]
expect(la_label_value).to eq "Westminster" expect(la_label_value).to eq "Barnet"
end end
context "when the requested form is 2024" do context "when the requested form is 2024" do
@ -246,13 +246,13 @@ RSpec.describe Csv::SalesLogCsvService do
it "exports the code for the local authority under the heading 'la'" do it "exports the code for the local authority under the heading 'la'" do
la_column_index = csv.first.index("LA") la_column_index = csv.first.index("LA")
la_value = csv.second[la_column_index] la_value = csv.second[la_column_index]
expect(la_value).to eq "E09000033" expect(la_value).to eq "E09000003"
end end
it "exports the label for the local authority under the heading 'la_label'" do it "exports the label for the local authority under the heading 'la_label'" do
la_label_column_index = csv.first.index("LANAME") la_label_column_index = csv.first.index("LANAME")
la_label_value = csv.second[la_label_column_index] la_label_value = csv.second[la_label_column_index]
expect(la_label_value).to eq "Westminster" expect(la_label_value).to eq "Barnet"
end end
context "when the requested form is 2024" do context "when the requested form is 2024" do

6
spec/services/merge/merge_organisations_service_spec.rb

@ -75,9 +75,6 @@ RSpec.describe Merge::MergeOrganisationsService do
end end
context "and merging organisation rent periods" do context "and merging organisation rent periods" do
let(:absorbing_organisation) { create(:organisation, holds_own_stock: false, name: "absorbing org", skip_rent_period_creation: true) }
let(:merging_organisation) { create(:organisation, holds_own_stock: true, name: "fake org", skip_rent_period_creation: true) }
before do before do
OrganisationRentPeriod.create!(organisation: absorbing_organisation, rent_period: 1) OrganisationRentPeriod.create!(organisation: absorbing_organisation, rent_period: 1)
OrganisationRentPeriod.create!(organisation: absorbing_organisation, rent_period: 3) OrganisationRentPeriod.create!(organisation: absorbing_organisation, rent_period: 3)
@ -1160,9 +1157,6 @@ RSpec.describe Merge::MergeOrganisationsService do
end end
context "and merging organisation rent periods" do context "and merging organisation rent periods" do
let(:new_absorbing_organisation) { create(:organisation, :without_dpc, holds_own_stock: false, skip_rent_period_creation: true) }
let(:merging_organisation) { create(:organisation, holds_own_stock: true, name: "fake org", skip_rent_period_creation: true) }
before do before do
OrganisationRentPeriod.create!(organisation: new_absorbing_organisation, rent_period: 1) OrganisationRentPeriod.create!(organisation: new_absorbing_organisation, rent_period: 1)
OrganisationRentPeriod.create!(organisation: new_absorbing_organisation, rent_period: 3) OrganisationRentPeriod.create!(organisation: new_absorbing_organisation, rent_period: 3)

5
spec/views/organisations/show.html.erb_spec.rb

@ -2,10 +2,15 @@ require "rails_helper"
RSpec.describe "organisations/show.html.erb" do RSpec.describe "organisations/show.html.erb" do
before do before do
Timecop.freeze(Time.zone.local(2023, 1, 10))
allow(view).to receive(:current_user).and_return(user) allow(view).to receive(:current_user).and_return(user)
assign(:organisation, user.organisation) assign(:organisation, user.organisation)
end end
after do
Timecop.return
end
let(:fragment) { Capybara::Node::Simple.new(rendered) } let(:fragment) { Capybara::Node::Simple.new(rendered) }
let(:organisation_without_dpc) { create(:organisation, :without_dpc) } let(:organisation_without_dpc) { create(:organisation, :without_dpc) }
let(:organisation_with_dsa) { create(:organisation) } let(:organisation_with_dsa) { create(:organisation) }

Loading…
Cancel
Save