diff --git a/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb b/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb index 78f513a5e1..034770bab2 100644 --- a/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb +++ b/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb @@ -18,6 +18,11 @@ module DfcProvider variant.product.update!( description: dfc_request["dfc-b:description"], ) + + # This input is DFC v1.6 currently sent by the DFC Prototype. + variant.update!( + unit_value: dfc_request["dfc-b:quantity"], + ) end private diff --git a/engines/dfc_provider/spec/requests/supplied_products_spec.rb b/engines/dfc_provider/spec/requests/supplied_products_spec.rb index 593ce7c34d..f48d761561 100644 --- a/engines/dfc_provider/spec/requests/supplied_products_spec.rb +++ b/engines/dfc_provider/spec/requests/supplied_products_spec.rb @@ -51,6 +51,7 @@ describe "SuppliedProducts", type: :request do expect(response).to have_http_status :success variant.reload }.to change { variant.description }.to("DFC-Pesto updated") + .and change { variant.unit_value }.to(17) end end end diff --git a/engines/dfc_provider/spec/support/patch_supplied_product.json b/engines/dfc_provider/spec/support/patch_supplied_product.json index a13afd9299..86230c7e7a 100644 --- a/engines/dfc_provider/spec/support/patch_supplied_product.json +++ b/engines/dfc_provider/spec/support/patch_supplied_product.json @@ -81,5 +81,5 @@ } }, "dfc-b:description": "DFC-Pesto updated", - "dfc-b:quantity": 0 + "dfc-b:quantity": 17 }