function generateLocations() {
	var numberOfLoc = chance.integer({min:1, max:5});

	var locations = [];

	for (var i = 0; i < numberOfLoc; i++) {
		locations.push({
			street: chance.street(),
			number: chance.integer( {min:2, max:70} ),
			city: chance.city(),
			zip: chance.zip(),
			country: chance.country({ full: true })
		});
	}

	return locations;
}
Esempio n. 2
0
  return things.get(chance.pickone(Object.keys(things.toJS())));
};

const NEW_THINGS = {
  assets (store) {
    store.dispatch(thingReceived({
      id: '' + (new Date()).valueOf(),
      name: chance.word(),
      type: 'assets'
    }));
  },

  locations (store) {
    store.dispatch(thingReceived({
      id: '' + (new Date()).valueOf(),
      name: chance.street(),
      type: 'locations'
    }));
  },

  people (store) {
    const firstName = chance.first();
    const surname = chance.last();
    store.dispatch(thingReceived({
      id: '' + (new Date()).valueOf(),
      firstName,
      name: `${chance.prefix()} ${firstName} ${surname}`,
      type: 'people',
      surname
    }));
  }