diff --git a/engines/dfc_provider/app/services/supplied_product_builder.rb b/engines/dfc_provider/app/services/supplied_product_builder.rb index 23be177ee1..2d776eafdb 100644 --- a/engines/dfc_provider/app/services/supplied_product_builder.rb +++ b/engines/dfc_provider/app/services/supplied_product_builder.rb @@ -9,7 +9,7 @@ class SuppliedProductBuilder < DfcBuilder DfcProvider::SuppliedProduct.new( id, - name: variant.name_to_display, + name: variant.product_and_full_name, description: variant.description, productType: product_type, quantity: QuantitativeValueBuilder.quantity(variant), diff --git a/engines/dfc_provider/spec/services/enterprise_builder_spec.rb b/engines/dfc_provider/spec/services/enterprise_builder_spec.rb index c1d4bf94a8..8e24ed4fd1 100644 --- a/engines/dfc_provider/spec/services/enterprise_builder_spec.rb +++ b/engines/dfc_provider/spec/services/enterprise_builder_spec.rb @@ -41,7 +41,7 @@ describe EnterpriseBuilder do expect(variant).to be_persisted expect(result.suppliedProducts.count).to eq 1 - expect(result.suppliedProducts[0].name).to eq "Apple" + expect(result.suppliedProducts[0].name).to eq "Apple - 1g" end it "assigns an address" do diff --git a/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb b/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb index 464cc73036..51563b23e7 100644 --- a/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb +++ b/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb @@ -38,7 +38,7 @@ describe SuppliedProductBuilder do variant.display_name = "Granny Smith" product = builder.supplied_product(variant) - expect(product.name).to eq "Granny Smith" + expect(product.name).to eq "Apple - Granny Smith" end it "assigns a product type" do diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index 5ef9c9e319..e128c4d92e 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -108,7 +108,7 @@ paths: dfc-b:offeredThrough: http://test.host/api/dfc/enterprises/10000/offers/10001 - "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct - dfc-b:name: Apple + dfc-b:name: Apple - 1g dfc-b:description: Red dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: @@ -339,7 +339,7 @@ paths: dfc-b:hasCountry: Australia - "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct - dfc-b:name: Apple + dfc-b:name: Apple - 1g dfc-b:description: Round dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: @@ -444,7 +444,7 @@ paths: "@context": https://www.datafoodconsortium.org "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct - dfc-b:name: Apple + dfc-b:name: Apple - 6g dfc-b:description: A delicious heritage apple dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: @@ -508,7 +508,7 @@ paths: "@context": https://www.datafoodconsortium.org "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct - dfc-b:name: Pesto + dfc-b:name: Pesto - 1g dfc-b:description: Basil Pesto dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: