WARNING: This repository is no longer maintained :warning: This repository will not be updated. The repository will be kept available in read-only mode. See https://developer.ibm.com/code/patterns/ for the latest patterns.
I just want to notify you that I have detected a bug.
In the order database, the order status is systematically set to "pending", even if the warranty has not expired (status should be "ordered" if the warranty has not expired)
So when the appliance sends a MQQT message indicating the need to replace a part, we never receive a mail "
To fix the issue, I made the following change in the code (line 61 of the openfridge/actions/create-order-event.js file)
Original code
if (params.warranty_expiration > Math.floor(Date.now() / 1000)) {
Modified code
if (appliance.warranty_expiration > Math.floor(Date.now() / 1000)) {
Fix needed: