From 05245e6bb40a729f4443518a5a21361991d68aef Mon Sep 17 00:00:00 2001 From: Raimundo Henriques Date: Thu, 7 Dec 2023 18:18:18 +0000 Subject: [PATCH] fix: update reportingPeriod to referencePeriod --- endpoint/src/datamodel.rs | 4 ++-- endpoint/src/main.rs | 12 ++++++------ endpoint/src/sample_data.rs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/endpoint/src/datamodel.rs b/endpoint/src/datamodel.rs index 9c5da3e..9f6b353 100644 --- a/endpoint/src/datamodel.rs +++ b/endpoint/src/datamodel.rs @@ -83,8 +83,8 @@ pub struct CarbonFootprint { #[serde(skip_serializing_if = "Option::is_none")] pub boundary_processes_description: Option, - pub reporting_period_start: DateTime, - pub reporting_period_end: DateTime, + pub reference_period_start: DateTime, + pub reference_period_end: DateTime, #[serde(flatten)] #[serde(skip_serializing_if = "Option::is_none")] diff --git a/endpoint/src/main.rs b/endpoint/src/main.rs index 03cd943..f97234a 100644 --- a/endpoint/src/main.rs +++ b/endpoint/src/main.rs @@ -212,11 +212,11 @@ fn filtered_data(filter: Option<&'_ str>) -> Result, Strin .unwrap_or_default() }) .unwrap_or_default(), - "pcf/reportingPeriodStart" => { - pf.pcf.reporting_period_start.to_string() == value + "pcf/referencePeriodStart" => { + pf.pcf.reference_period_start.to_string() == value } - "pcf/reportingPeriodEnd" => { - pf.pcf.reporting_period_end.to_string() == value + "pcf/referencePeriodEnd" => { + pf.pcf.reference_period_end.to_string() == value } _ => { return Err(format!("Unsupported property {property}")); @@ -235,8 +235,8 @@ fn filtered_data(filter: Option<&'_ str>) -> Result, Strin let v = match property { "created" => Some(pf.created), "updated" => pf.updated, - "pcf/reportingPeriodStart" => Some(pf.pcf.reporting_period_start), - "pcf/reportingPeriodEnd" => Some(pf.pcf.reporting_period_end), + "pcf/referencePeriodStart" => Some(pf.pcf.reference_period_start), + "pcf/referencePeriodEnd" => Some(pf.pcf.reference_period_end), _ => { return Err(format!("Unsupported property {property}")); } diff --git a/endpoint/src/sample_data.rs b/endpoint/src/sample_data.rs index 370a7bf..bbff189 100644 --- a/endpoint/src/sample_data.rs +++ b/endpoint/src/sample_data.rs @@ -23,8 +23,8 @@ lazy_static! { name: String::from("Ecoinvent").into(), version: String::from("1.2.3").into(), }])), - reporting_period_start: *TIME_PERIOD_START, - reporting_period_end: *TIME_PERIOD_END, + reference_period_start: *TIME_PERIOD_START, + reference_period_end: *TIME_PERIOD_END, /*geography_region_or_subregion: None, geography_country: Some(ISO3166CC(String::from("FR"))), geography_country_subdivision: None, */