@harvest-profit/model-helpers
Advanced tools
Comparing version 1.7.1 to 1.8.0
@@ -86,5 +86,28 @@ Object.defineProperty(exports, "__esModule", { | ||
/** | ||
* Updates the crop ID for a planting and it's associated applications | ||
* @function | ||
* @param {planting} planting The planting to update | ||
* @param {number} cropId The new crop id for the given planting | ||
* @return {planting} The updated planting (with applications) | ||
*/ | ||
}, { | ||
key: 'updateCropId', | ||
value: function () { | ||
function updateCropId(planting, cropId) { | ||
return _extends({}, planting, { | ||
crop_id: cropId, | ||
applications: planting.applications.map(function (app) { | ||
return _extends({}, app, { crop_id: cropId }); | ||
}) | ||
}); | ||
} | ||
return updateCropId; | ||
}() | ||
/** | ||
* Updates the planted acres for a planting and it's associated applications | ||
* @function | ||
* @param {planting} planting The planting to sanitize | ||
* @param {planting} planting The planting to update | ||
* @param {number|string} acres The new acres for the given planting | ||
@@ -91,0 +114,0 @@ * @return {planting} The updated planting (with applications) |
{ | ||
"name": "@harvest-profit/model-helpers", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "All the calculations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
75784
715