* feat: add scheme reactivation behaviour
* test: add tests
* refactor: linting
* fix: find deactivation periods by scheme/location ids rather than just the first
* feat: add activating_soon status to location (not to schemes as they have no startdate field)
* feat: fix logic and add tests fo activating soon
* fix: check for startdate presence
availability<<" to #{(deactivation.deactivation_date-1.day).to_formatted_s(:govuk_date)}\nDeactivated on #{deactivation.deactivation_date.to_formatted_s(:govuk_date)}"
ifperiod.from.present?
availability<<"\nActive from #{deactivation.reactivation_date.to_formatted_s(:govuk_date)}"ifdeactivation.reactivation_date.present?
availability<<"\nActive from #{period.from.to_formatted_s(:govuk_date)}"
availability<<" to #{(period.to-1.day).to_formatted_s(:govuk_date)}\nDeactivated on #{period.to.to_formatted_s(:govuk_date)}"ifperiod.to.present?
missing:"You must show the DLUHC privacy notice to the tenant before you can submit this log."
missing:"You must show the DLUHC privacy notice to the tenant before you can submit this log."
scheme:
scheme:
deactivation_date:
toggle_date:
not_selected:"Select one of the options"
not_selected:"Select one of the options"
invalid:"Enter a valid day, month and year"
invalid:"Enter a valid day, month and year"
out_of_range:"The date must be on or after the %{date}"
out_of_range:"The date must be on or after the %{date}"
reactivation:
before_deactivation:"This scheme was deactivated on %{date}. The reactivation date must be on or after deactivation date"
deactivation:
during_deactivated_period:"The scheme is already deactivated during this date, please enter a different date"
location:
location:
toggle_date:
toggle_date:
@ -324,7 +330,7 @@ en:
invalid:"Enter a valid day, month and year"
invalid:"Enter a valid day, month and year"
out_of_range:"The date must be on or after the %{date}"
out_of_range:"The date must be on or after the %{date}"
reactivation:
reactivation:
before_deactivation:"This location was deactivated on %{date}\nThe reactivation date must be on or after deactivation date"
before_deactivation:"This location was deactivated on %{date}. The reactivation date must be on or after deactivation date"
deactivation:
deactivation:
during_deactivated_period:"The location is already deactivated during this date, please enter a different date"
during_deactivated_period:"The location is already deactivated during this date, please enter a different date"
@ -381,7 +387,7 @@ en:
toggle_active:
toggle_active:
apply_from:"When should this change apply?"
apply_from:"When should this change apply?"
scheme:
scheme:
deactivation:
toggle_active:
apply_from:"When should this change apply?"
apply_from:"When should this change apply?"
descriptions:
descriptions:
location:
location:
@ -397,7 +403,7 @@ en:
units:"A unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff."
units:"A unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff."
toggle_active:"If the date is before %{date}, select ‘From the start of the current collection period’ because the previous period has now closed."
toggle_active:"If the date is before %{date}, select ‘From the start of the current collection period’ because the previous period has now closed."
scheme:
scheme:
deactivation:"If the date is before %{date}, select ‘From the start of the current collection period’ because the previous period has now closed."
toggle_active:"If the date is before %{date}, select ‘From the start of the current collection period’ because the previous period has now closed."
warnings:
warnings:
location:
location:
@ -407,9 +413,11 @@ en:
reactivate:
reactivate:
existing_logs:"You’ll be able to add logs with this location if their tenancy start date is on or after the date you enter."
existing_logs:"You’ll be able to add logs with this location if their tenancy start date is on or after the date you enter."
scheme:
scheme:
deactivation:
deactivate:
existing_logs:"It will not be possible to add logs with this scheme if their tenancy start date is on or after the date you enter. Any existing logs may be affected."
existing_logs:"It will not be possible to add logs with this scheme if their tenancy start date is on or after the date you enter. Any existing logs may be affected."
review_logs:"Your data providers will need to review these logs and answer a few questions again. We’ll email each log creator with a list of logs that need updating."
review_logs:"Your data providers will need to review these logs and answer a few questions again. We’ll email each log creator with a list of logs that need updating."
reactivate:
existing_logs:"You’ll be able to add logs with this scheme if their tenancy start date is on or after the date you enter."
test:
test:
one_argument:"This is based on the tenant’s work situation: %{ecstat1}"
one_argument:"This is based on the tenant’s work situation: %{ecstat1}"
expect(availability_attribute).toeq("Active from 1 April 2022 to 9 August 2022\nDeactivated on 10 August 2022\nActive from 1 September 2022 to 14 September 2022\nDeactivated on 15 September 2022\nActive from 28 September 2022")
expect(availability_attribute).toeq("Active from 8 August 2022 to 9 August 2022\nDeactivated on 10 August 2022\nActive from 1 September 2022 to 14 September 2022\nDeactivated on 15 September 2022")
expect(availability_attribute).toeq("Active from 1 April 2022 to 9 August 2022\nDeactivated on 10 August 2022\nActive from 1 September 2022 to 14 September 2022\nDeactivated on 15 September 2022")
expect(availability_attribute).toeq("Active from 1 April 2022 to 14 June 2022\nDeactivated on 15 June 2022\nActive from 18 June 2022 to 23 September 2022\nDeactivated on 24 September 2022\nActive from 28 September 2022")
expect(availability_attribute).toeq("Active from 1 April 2022 to 14 June 2022\nDeactivated on 15 June 2022\nActive from 28 September 2022 to 23 October 2022\nDeactivated on 24 October 2022\nActive from 28 October 2022")