Skip to content

Commit

Permalink
fix: allow null geographicScope and update sample_data
Browse files Browse the repository at this point in the history
  • Loading branch information
raimundo-henriques committed Dec 12, 2023
1 parent 05245e6 commit c835932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions endpoint/src/datamodel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub struct CarbonFootprint {
pub declared_unit: DeclaredUnit,
pub unitary_product_amount: StrictlyPositiveDecimal,
pub p_cf_excluding_biogenic: PositiveDecimal,
pub p_cf_including_biogenic: WrappedDecimal,
#[serde(skip_serializing_if = "Option::is_none")]
pub p_cf_including_biogenic: Option<WrappedDecimal>,
pub fossil_ghg_emissions: PositiveDecimal,
pub fossil_carbon_content: PositiveDecimal,
pub biogenic_carbon_content: PositiveDecimal,
Expand Down Expand Up @@ -86,7 +87,6 @@ pub struct CarbonFootprint {
pub reference_period_start: DateTime<Utc>,
pub reference_period_end: DateTime<Utc>,

#[serde(flatten)]
#[serde(skip_serializing_if = "Option::is_none")]
pub geographic_scope: Option<GeographicScope>,

Expand Down
2 changes: 1 addition & 1 deletion endpoint/src/sample_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lazy_static! {
packaging_emissions_included: false,
packaging_ghg_emissions: None,
p_cf_excluding_biogenic: dec!(0.0).into(),
p_cf_including_biogenic: dec!(0.0).into(),
p_cf_including_biogenic: Some(dec!(0.0).into()),
uncertainty_assessment_description: None,
};
}
Expand Down

0 comments on commit c835932

Please sign in to comment.