CLDC-2996 Add correct availability details to merged schemes and locations (#2081)
* feat: use latest merge date/start date where available for availability text for schemes and locations
* feat: add tests for availability text
* feat: use startdate instead to track merges on schemes and locations
* feat: test startdates are set correctly on merged schemes and locations
* feat: add migration file
* feat: add scheme activating soon tests
* feat: add activating soon to scheme filtering
* feat: update scheme active_status
* feat: update tests
* refactor: lint
* feat: move merge orgs validation after orgs validation
* feat: update schema
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
end
end
it"cannot be after the second collection window end date"do
it"cannot be after the second collection window end date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 21/22 or 22/23 collection years, which is between 1st April 2021 and 31st March 2023")
end
end
end
end
@ -36,12 +38,14 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
it"cannot be before the first collection window start date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
end
end
it"cannot be after the second collection window end date"do
it"cannot be after the second collection window end date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 collection year, which is between 1st April 2022 and 31st March 2023")
end
end
end
end
@ -57,12 +61,14 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
it"cannot be before the first collection window start date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
end
end
it"cannot be after the second collection window end date"do
it"cannot be after the second collection window end date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 22/23 or 23/24 collection years, which is between 1st April 2022 and 31st March 2024")
end
end
end
end
@ -76,12 +82,14 @@ RSpec.describe Validations::SetupValidations do
it"cannot be before the first collection window start date"do
it"cannot be before the first collection window start date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
it"cannot be after the second collection window end date"do
it"cannot be after the second collection window end date"do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
end
end
@ -95,6 +103,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@ -103,6 +112,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).not_toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).not_toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
end
end
@ -116,6 +126,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
@ -124,6 +135,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
expect(record.errors["startdate"]).toinclude(match"Enter a date within the 23/24 collection year, which is between 1st April 2023 and 31st March 2024")
end
end
end
end
@ -151,6 +163,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
end
@ -158,6 +171,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Absorbing org became active on 1 February 2023.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning organisation was active. Absorbing org became active on 1 February 2023.")
end
end
@ -174,6 +189,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
end
@ -198,6 +216,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Absorbing org became active on 1 February 2023.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the managing organisation was active. Absorbing org became active on 1 February 2023.")
end
end
@ -214,6 +234,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
end
@ -240,6 +263,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Absorbing org became active on 1 February 2023.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisation was active. Absorbing org became active on 1 February 2023.")
end
end
@ -258,6 +283,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 and Merged org became inactive on 2 February 2023 and were replaced by Absorbing org.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 and Merged org became inactive on 2 February 2023 and were replaced by Absorbing org.")
end
end
@ -285,6 +313,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 became inactive on 2 February 2023 and was replaced by Absorbing org 2. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Merged org 2 became inactive on 2 February 2023 and was replaced by Absorbing org 2. Merged org became inactive on 2 February 2023 and was replaced by Absorbing org.")
end
end
@ -307,6 +337,7 @@ RSpec.describe Validations::SetupValidations do
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Absorbing org 2 became active on 1 February 2023, and Absorbing org became active on 1 February 2023.")
expect(record.errors["startdate"]).toinclude(match"Enter a date when the owning and managing organisations were active. Absorbing org 2 became active on 1 February 2023, and Absorbing org became active on 1 February 2023.")
end
end
@ -329,6 +361,7 @@ RSpec.describe Validations::SetupValidations do