Update variant's quantity from DFC

This commit is contained in:
Maikel Linke
2023-05-12 16:49:47 +10:00
committed by Konrad
parent 48a52582e6
commit 375b3a3cb0
3 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -81,5 +81,5 @@
}
},
"dfc-b:description": "DFC-Pesto updated",
"dfc-b:quantity": 0
"dfc-b:quantity": 17
}