data-generator-retail
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -13,2 +13,8 @@ import { weightedBoolean } from './utils'; | ||
}); | ||
// set product sales | ||
db.commands.forEach(function (command) { | ||
command.basket.forEach(function (item) { | ||
db.products[item.product_id].sales += item.quantity; | ||
}); | ||
}); | ||
// add 'collector' group | ||
@@ -15,0 +21,0 @@ var customersBySpending = db.commands.reduce(function (customers, command) { |
@@ -192,7 +192,8 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
description: lorem.paragraph(), | ||
stock: weightedBoolean(20) | ||
stock: weightedBoolean(10) | ||
? 0 | ||
: random.number({ min: 0, max: 250 }), | ||
: random.number({ min: 0, max: 150 }), | ||
sales: 0, | ||
}; | ||
})); }, []); | ||
}); |
@@ -15,2 +15,8 @@ "use strict"; | ||
}); | ||
// set product sales | ||
db.commands.forEach(function (command) { | ||
command.basket.forEach(function (item) { | ||
db.products[item.product_id].sales += item.quantity; | ||
}); | ||
}); | ||
// add 'collector' group | ||
@@ -17,0 +23,0 @@ var customersBySpending = db.commands.reduce(function (customers, command) { |
@@ -194,7 +194,8 @@ "use strict"; | ||
description: en_1.lorem.paragraph(), | ||
stock: utils_1.weightedBoolean(20) | ||
stock: utils_1.weightedBoolean(10) | ||
? 0 | ||
: en_1.random.number({ min: 0, max: 250 }), | ||
: en_1.random.number({ min: 0, max: 150 }), | ||
sales: 0, | ||
}; | ||
})); }, []); | ||
}); |
{ | ||
"name": "data-generator-retail", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"homepage": "https://github.com/marmelab/react-admin/tree/master/examples/data-generator", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/marmelab/react-admin/issues", |
@@ -17,2 +17,9 @@ import { weightedBoolean } from './utils'; | ||
// set product sales | ||
db.commands.forEach(command => { | ||
command.basket.forEach(item => { | ||
db.products[item.product_id].sales += item.quantity; | ||
}); | ||
}); | ||
// add 'collector' group | ||
@@ -19,0 +26,0 @@ const customersBySpending = db.commands.reduce((customers, command) => { |
@@ -198,5 +198,6 @@ import { random, lorem } from 'faker/locale/en'; | ||
description: lorem.paragraph(), | ||
stock: weightedBoolean(20) | ||
stock: weightedBoolean(10) | ||
? 0 | ||
: random.number({ min: 0, max: 250 }), | ||
: random.number({ min: 0, max: 150 }), | ||
sales: 0, | ||
}; | ||
@@ -203,0 +204,0 @@ }), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55767
1508