Skip to content

Commit

Permalink
refactoring: Adding additional project fields to Project exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Nov 23, 2023
1 parent ffba4a6 commit 40de287
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/app/services/backoffice/csv/project_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def call
column(I18n.t("simple_form.labels.project.received_funding")) { |r| I18n.t(r.received_funding) }
column(I18n.t("simple_form.labels.project.received_funding_amount_usd")) { |r| r.received_funding_amount_usd }
column(I18n.t("simple_form.labels.project.received_funding_investor")) { |r| r.received_funding_investor }
column(I18n.t("simple_form.labels.project.positive_financial_returns")) { |r| r.positive_financial_returns }
column(I18n.t("simple_form.labels.project.last_year_sales_revenue")) { |r| r.last_year_sales_revenue }
column(I18n.t("simple_form.labels.project.climate_change_risks_identified")) do |r|
I18n.t(r.climate_change_risks_identified)
end
column(I18n.t("simple_form.labels.project.climate_change_risks_details")) { |r| r.climate_change_risks_details }
column(I18n.t("simple_form.labels.project.replicability")) { |r| r.replicability }
column(I18n.t("simple_form.labels.project.sustainability")) { |r| r.sustainability }
column(I18n.t("simple_form.labels.project.progress_impact_tracking")) { |r| r.progress_impact_tracking }
Expand Down
5 changes: 5 additions & 0 deletions backend/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
Location.delete_all
Admin.delete_all

Investor.reset_column_information
ProjectDeveloper.reset_column_information
OpenCall.reset_column_information
Project.reset_column_information

Admin.create!(first_name: "Admin", last_name: "Example", password: "SuperSecret1234", email: "[email protected]", ui_language: "en")

Rake::Task["import_geojsons:colombia"].invoke
Expand Down
8 changes: 8 additions & 0 deletions backend/spec/services/backoffice/csv/project_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
I18n.t("simple_form.labels.project.received_funding"),
I18n.t("simple_form.labels.project.received_funding_amount_usd"),
I18n.t("simple_form.labels.project.received_funding_investor"),
I18n.t("simple_form.labels.project.positive_financial_returns"),
I18n.t("simple_form.labels.project.last_year_sales_revenue"),
I18n.t("simple_form.labels.project.climate_change_risks_identified"),
I18n.t("simple_form.labels.project.climate_change_risks_details"),
I18n.t("simple_form.labels.project.replicability"),
I18n.t("simple_form.labels.project.sustainability"),
I18n.t("simple_form.labels.project.progress_impact_tracking"),
Expand Down Expand Up @@ -70,6 +74,10 @@
I18n.t(query.first.received_funding),
query.first.received_funding_amount_usd.to_s,
query.first.received_funding_investor,
query.first.positive_financial_returns,
query.first.last_year_sales_revenue.to_s,
I18n.t(query.first.climate_change_risks_identified),
query.first.climate_change_risks_details,
query.first.replicability,
query.first.sustainability,
query.first.progress_impact_tracking,
Expand Down

0 comments on commit 40de287

Please sign in to comment.