diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index 104f552ac..bbd1ac104 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -427,7 +427,7 @@ GEM railties (>= 5.0) retriable (3.1.2) rexml (3.2.5) - rgeo (2.4.0) + rgeo (3.0.1) rgeo-activerecord (7.0.1) activerecord (>= 5.0) rgeo (>= 1.0.0) diff --git a/backend/db/schema.rb b/backend/db/schema.rb index bc404a0be..04300e051 100644 --- a/backend/db/schema.rb +++ b/backend/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_02_03_122726) do +ActiveRecord::Schema[7.0].define(version: 2023_11_20_155058) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" enable_extension "postgis" @@ -419,6 +419,16 @@ t.boolean "municipality_demands_calculated", default: false t.boolean "hydrobasin_demands_calculated", default: false t.boolean "priority_landscape_demands_calculated", default: false + t.text "positive_financial_returns_en" + t.text "positive_financial_returns_es" + t.text "positive_financial_returns_pt" + t.text "last_year_sales_revenue_en" + t.text "last_year_sales_revenue_es" + t.text "last_year_sales_revenue_pt" + t.text "climate_change_risks_details_en" + t.text "climate_change_risks_details_es" + t.text "climate_change_risks_details_pt" + t.boolean "climate_change_risks_identified", default: false t.index ["country_id"], name: "index_projects_on_country_id" t.index ["department_id"], name: "index_projects_on_department_id" t.index ["municipality_id"], name: "index_projects_on_municipality_id" diff --git a/backend/spec/factories/project.rb b/backend/spec/factories/project.rb index 4f59d0325..506a19600 100644 --- a/backend/spec/factories/project.rb +++ b/backend/spec/factories/project.rb @@ -61,7 +61,7 @@ climate_change_risks_identified { true } - sequence(:limate_change_risks_details) do |n| + sequence(:climate_change_risks_details) do |n| Faker::Config.random = Random.new(n) Faker::Lorem.paragraph(sentence_count: 2) end diff --git a/backend/spec/fixtures/snapshots/api/v1/account/open-call-applications-create.json b/backend/spec/fixtures/snapshots/api/v1/account/open-call-applications-create.json index 10e694e3a..2bcb2a746 100644 --- a/backend/spec/fixtures/snapshots/api/v1/account/open-call-applications-create.json +++ b/backend/spec/fixtures/snapshots/api/v1/account/open-call-applications-create.json @@ -142,7 +142,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": false, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/account/projects-favourites.json b/backend/spec/fixtures/snapshots/api/v1/account/projects-favourites.json index 0bcdcd660..215bc55e2 100644 --- a/backend/spec/fixtures/snapshots/api/v1/account/projects-favourites.json +++ b/backend/spec/fixtures/snapshots/api/v1/account/projects-favourites.json @@ -106,7 +106,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": true, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/account/projects.json b/backend/spec/fixtures/snapshots/api/v1/account/projects.json index faf7fe9d2..7b5f63261 100644 --- a/backend/spec/fixtures/snapshots/api/v1/account/projects.json +++ b/backend/spec/fixtures/snapshots/api/v1/account/projects.json @@ -106,7 +106,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": false, - "funded": null + "funded": null, + "positive_financial_returns": "Dolores fugiat nesciunt. Ut laborum dolores.", + "last_year_sales_revenue": "Dolores fugiat nesciunt.", + "climate_change_risks_details": "Dolores fugiat nesciunt. Ut laborum dolores.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -254,7 +258,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": false, - "funded": null + "funded": null, + "positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.", + "last_year_sales_revenue": "Placeat commodi libero.", + "climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -402,7 +410,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": false, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/accounts-project-create.json b/backend/spec/fixtures/snapshots/api/v1/accounts-project-create.json index 3b0b9b113..6136afaa0 100644 --- a/backend/spec/fixtures/snapshots/api/v1/accounts-project-create.json +++ b/backend/spec/fixtures/snapshots/api/v1/accounts-project-create.json @@ -106,7 +106,11 @@ "project_climate_impact": null, "project_water_impact": null, "project_community_impact": null, - "project_total_impact": null + "project_total_impact": null, + "positive_financial_returns": null, + "last_year_sales_revenue": null, + "climate_change_risks_details": null, + "climate_change_risks_identified": false }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/accounts-project-update.json b/backend/spec/fixtures/snapshots/api/v1/accounts-project-update.json index 7d88017c5..b880f771f 100644 --- a/backend/spec/fixtures/snapshots/api/v1/accounts-project-update.json +++ b/backend/spec/fixtures/snapshots/api/v1/accounts-project-update.json @@ -76,7 +76,11 @@ "project_climate_impact": null, "project_water_impact": null, "project_community_impact": null, - "project_total_impact": null + "project_total_impact": null, + "positive_financial_returns": "Updated financial returns data", + "last_year_sales_revenue": "Updated year sales revenues", + "climate_change_risks_details": "Updated climate risk details", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/get-project-developer-include-relationships.json b/backend/spec/fixtures/snapshots/api/v1/get-project-developer-include-relationships.json index f79a6f1ab..e1d5376cb 100644 --- a/backend/spec/fixtures/snapshots/api/v1/get-project-developer-include-relationships.json +++ b/backend/spec/fixtures/snapshots/api/v1/get-project-developer-include-relationships.json @@ -127,7 +127,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -278,7 +282,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.", + "last_year_sales_revenue": "Placeat commodi libero.", + "climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/get-project.json b/backend/spec/fixtures/snapshots/api/v1/get-project.json index 00203a75c..2d4a884de 100644 --- a/backend/spec/fixtures/snapshots/api/v1/get-project.json +++ b/backend/spec/fixtures/snapshots/api/v1/get-project.json @@ -97,7 +97,11 @@ "project_climate_impact": null, "project_water_impact": null, "project_community_impact": null, - "project_total_impact": null + "project_total_impact": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/project-developers-include-relationships.json b/backend/spec/fixtures/snapshots/api/v1/project-developers-include-relationships.json index 22cca0181..45c152227 100644 --- a/backend/spec/fixtures/snapshots/api/v1/project-developers-include-relationships.json +++ b/backend/spec/fixtures/snapshots/api/v1/project-developers-include-relationships.json @@ -255,7 +255,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -406,7 +410,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.", + "last_year_sales_revenue": "Placeat commodi libero.", + "climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/fixtures/snapshots/api/v1/projects.json b/backend/spec/fixtures/snapshots/api/v1/projects.json index 4fba72c84..b952655df 100644 --- a/backend/spec/fixtures/snapshots/api/v1/projects.json +++ b/backend/spec/fixtures/snapshots/api/v1/projects.json @@ -106,7 +106,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.", + "last_year_sales_revenue": "Placeat commodi libero.", + "climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -254,7 +258,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Et quaerat omnis. Harum voluptas atque.", + "last_year_sales_revenue": "Et quaerat omnis.", + "climate_change_risks_details": "Et quaerat omnis. Harum voluptas atque.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -402,7 +410,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Dolores fugiat nesciunt. Ut laborum dolores.", + "last_year_sales_revenue": "Dolores fugiat nesciunt.", + "climate_change_risks_details": "Dolores fugiat nesciunt. Ut laborum dolores.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -550,7 +562,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Autem et et. Voluptatem neque quibusdam.", + "last_year_sales_revenue": "Autem et et.", + "climate_change_risks_details": "Autem et et. Voluptatem neque quibusdam.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -698,7 +714,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Porro soluta beatae. Quia ratione facilis.", + "last_year_sales_revenue": "Porro soluta beatae.", + "climate_change_risks_details": "Porro soluta beatae. Quia ratione facilis.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -846,7 +866,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Mollitia aut vel. Qui illum accusantium.", + "last_year_sales_revenue": "Mollitia aut vel.", + "climate_change_risks_details": "Mollitia aut vel. Qui illum accusantium.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -994,7 +1018,11 @@ "latitude": 39.21309022641362, "longitude": -5.87810037515931, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Tempora excepturi et. Et quia sit.", + "last_year_sales_revenue": "Tempora excepturi et.", + "climate_change_risks_details": "Tempora excepturi et. Et quia sit.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { @@ -1134,7 +1162,11 @@ "latitude": 0.5, "longitude": 0.5, "favourite": null, - "funded": null + "funded": null, + "positive_financial_returns": "Enim repellat pariatur. Earum modi eos.", + "last_year_sales_revenue": "Enim repellat pariatur.", + "climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.", + "climate_change_risks_identified": true }, "relationships": { "project_developer": { diff --git a/backend/spec/requests/api/v1/accounts/projects_spec.rb b/backend/spec/requests/api/v1/accounts/projects_spec.rb index d670c704b..e58f04a79 100644 --- a/backend/spec/requests/api/v1/accounts/projects_spec.rb +++ b/backend/spec/requests/api/v1/accounts/projects_spec.rb @@ -29,6 +29,10 @@ received_funding: {type: :boolean}, received_funding_amount_usd: {type: :number}, received_funding_investor: {type: :string}, + positive_financial_returns: {type: :string}, + last_year_sales_revenue: {type: :string}, + climate_change_risks_details: {type: :string}, + climate_change_risks_identified: {type: :boolean}, replicability: {type: :string}, sustainability: {type: :string}, progress_impact_tracking: {type: :string}, @@ -297,7 +301,11 @@ impact_areas: %w[restoration pollutants-reduction], sdgs: [2, 4, 5], instrument_types: %w[grant], - locale: :en + locale: :en, + positive_financial_returns: "Updated financial returns data", + last_year_sales_revenue: "Updated year sales revenues", + climate_change_risks_details: "Updated climate risk details", + climate_change_risks_identified: true } end diff --git a/backend/spec/system/backoffice/projects_spec.rb b/backend/spec/system/backoffice/projects_spec.rb index aebc42984..2a4658c4d 100644 --- a/backend/spec/system/backoffice/projects_spec.rb +++ b/backend/spec/system/backoffice/projects_spec.rb @@ -200,7 +200,7 @@ fill_in t("simple_form.labels.project.positive_financial_returns"), with: "Positive financial returns" fill_in t("simple_form.labels.project.last_year_sales_revenue"), with: "Last year sales revenue" choose "Yes", name: "project[climate_change_risks_identified]" - fill_in t("simple_form.labels.climate_change_risks_details"), with: "Climate change risks identified" + fill_in t("simple_form.labels.project.climate_change_risks_details"), with: "Climate change risks identified" fill_in t("simple_form.labels.project.replicability"), with: "New replicability" fill_in t("simple_form.labels.project.sustainability"), with: "New sustainability" fill_in t("simple_form.labels.project.progress_impact_tracking"), with: "New progress impact tracking"