diff --git a/transformer/releasetransformer.go b/transformer/releasetransformer.go index 2ef71b9e..72d1ecc4 100644 --- a/transformer/releasetransformer.go +++ b/transformer/releasetransformer.go @@ -90,17 +90,18 @@ type ESReleaseResponseHit struct { } type ESReleaseSourceDocument struct { - URI string `json:"uri"` - Title string `json:"title"` - Summary string `json:"summary"` - ReleaseDate string `json:"release_date,omitempty"` - Published bool `json:"published"` - Cancelled bool `json:"cancelled"` - Finalised bool `json:"finalised"` - Survey string `json:"survey"` - Keywords []string `json:"keywords,omitempty"` - Language string `json:"language,omitempty"` - DateChanges []dateChange `json:"date_changes,omitempty"` + URI string `json:"uri"` + Title string `json:"title"` + Summary string `json:"summary"` + ReleaseDate string `json:"release_date,omitempty"` + Published bool `json:"published"` + Cancelled bool `json:"cancelled"` + Finalised bool `json:"finalised"` + Survey string `json:"survey"` + Keywords []string `json:"keywords,omitempty"` + Language string `json:"language,omitempty"` + DateChanges []dateChange `json:"date_changes,omitempty"` + ProvisionalDate string `json:"provisional_date,omitempty"` } type dateChange struct { @@ -211,16 +212,17 @@ func buildRelease(hit ESReleaseResponseHit, highlighter *strings.Replacer) Relea r := Release{ URI: hit.Source.URI, Description: ReleaseDescription{ - Title: sd.Title, - Summary: sd.Summary, - ReleaseDate: sd.ReleaseDate, - Published: sd.Published, - Cancelled: sd.Cancelled, - Finalised: sd.Finalised, - Postponed: isPostponed(sd), - Census: isCensus(sd), - Keywords: sd.Keywords, - Language: sd.Language, + Title: sd.Title, + Summary: sd.Summary, + ReleaseDate: sd.ReleaseDate, + Published: sd.Published, + Cancelled: sd.Cancelled, + Finalised: sd.Finalised, + Postponed: isPostponed(sd), + Census: isCensus(sd), + Keywords: sd.Keywords, + Language: sd.Language, + ProvisionalDate: sd.ProvisionalDate, }, } diff --git a/transformer/testdata/search_release_es_response.json b/transformer/testdata/search_release_es_response.json index 703daf43..bde5a124 100644 --- a/transformer/testdata/search_release_es_response.json +++ b/transformer/testdata/search_release_es_response.json @@ -43,7 +43,8 @@ "topics":null, "finalised":true, "cancelled":false, - "published":false + "published":false, + "provisional_date": "August to September" }, "highlight":{ "summary":[ diff --git a/transformer/testdata/search_release_expected_highlighted.json b/transformer/testdata/search_release_expected_highlighted.json index 03f713c8..0b0fcc47 100644 --- a/transformer/testdata/search_release_expected_highlighted.json +++ b/transformer/testdata/search_release_expected_highlighted.json @@ -22,6 +22,7 @@ "census":false, "national_statistic":false, "latest_release":false, + "provisional_date": "August to September", "contact":{ "name":"Sarah Caul", "telephone":"+44 (0)1633 456490", @@ -47,6 +48,7 @@ "national_statistic":true, "next_release":"22 November 2018", "latest_release":false, + "provisional_date": "2018-08-23", "contact":{ "name":"Yanitsa Petkova ", "telephone":"+44 (0)1633 651599 ", diff --git a/transformer/testdata/search_release_expected_plain.json b/transformer/testdata/search_release_expected_plain.json index 18c5f9c9..1f72d663 100644 --- a/transformer/testdata/search_release_expected_plain.json +++ b/transformer/testdata/search_release_expected_plain.json @@ -21,6 +21,7 @@ "postponed":true, "national_statistic":false, "latest_release":false, + "provisional_date": "August to September", "contact":{ "name":"Sarah Caul", "telephone":"+44 (0)1633 456490",