From 12eee8d6bab4e7606b4014684907f60574e713ba Mon Sep 17 00:00:00 2001 From: Alex Newton Date: Thu, 7 Nov 2024 16:12:24 +0000 Subject: [PATCH] Add new facet to SFO finder --- config/schema/elasticsearch_types/sfo_case.json | 3 ++- config/schema/field_definitions.json | 4 ++++ lib/govuk_index/presenters/elasticsearch_presenter.rb | 1 + lib/govuk_index/presenters/specialist_presenter.rb | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/schema/elasticsearch_types/sfo_case.json b/config/schema/elasticsearch_types/sfo_case.json index a95fec0dd..9818f8497 100644 --- a/config/schema/elasticsearch_types/sfo_case.json +++ b/config/schema/elasticsearch_types/sfo_case.json @@ -1,6 +1,7 @@ { "fields": [ - "sfo_case_state" + "sfo_case_state", + "sfo_case_opened_date" ], "expanded_search_result_fields": { "sfo_case_state": [ diff --git a/config/schema/field_definitions.json b/config/schema/field_definitions.json index d2fa2a039..d985f46b2 100644 --- a/config/schema/field_definitions.json +++ b/config/schema/field_definitions.json @@ -1104,5 +1104,9 @@ "sfo_case_state": { "description": "Whether a case is open or closed. Applies to SFO cases.", "type": "identifiers" + }, + "sfo_case_opened_date": { + "description": "Open date of a SFO case", + "type": "date" } } \ No newline at end of file diff --git a/lib/govuk_index/presenters/elasticsearch_presenter.rb b/lib/govuk_index/presenters/elasticsearch_presenter.rb index 5f1e228a0..4c4bb777a 100644 --- a/lib/govuk_index/presenters/elasticsearch_presenter.rb +++ b/lib/govuk_index/presenters/elasticsearch_presenter.rb @@ -156,6 +156,7 @@ def document roles: expanded_links.roles, sector: specialist.sector, service_provider: specialist.service_provider, + sfo_case_opened_date: specialist.sfo_case_opened_date, sfo_case_state: specialist.sfo_case_state, sift_end_date: specialist.sift_end_date, sifting_status: specialist.sifting_status, diff --git a/lib/govuk_index/presenters/specialist_presenter.rb b/lib/govuk_index/presenters/specialist_presenter.rb index 67d882818..3b4aa1cad 100644 --- a/lib/govuk_index/presenters/specialist_presenter.rb +++ b/lib/govuk_index/presenters/specialist_presenter.rb @@ -107,6 +107,7 @@ class SpecialistPresenter delegate_to_payload :review_status delegate_to_payload :sector, convert_to_array: true delegate_to_payload :service_provider + delegate_to_payload :sfo_case_opened_date delegate_to_payload :sfo_case_state delegate_to_payload :sift_end_date delegate_to_payload :sifting_status