chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

Faker Product JSON Generator #28

Closed TimAConner closed 6 years ago

TimAConner commented 6 years ago

Description

exampleFakerController.js now exports a function that will generate all the product data. The data and table outline can be found in the Wiki ERD section.

Related Ticket(s)

This is apart of issue #19 .

Proposed Changes

Added functionality that will randomly generate faker data to be used for testing the api.

Added data/faker/products folder including customersFaker.js, index.js, ordersFaker.js, paymentOptions.js, productOrdersFaker.js, productsFaker.js, and productTypesFaker.js. Also added randomInt.js in products that exports a function that randomly selects an integer. Added exampleFakerController.js that will call all the faker generation functions.

Expected Behavior

When you call the function exported by exampleFakerController, it will return an object that contains an array of objects for: products, customers, orders, paymentOptions, productOrders, and productTypes.

Steps to Test Solution

Run in Command Line:

  1. cd data/faker/
  2. node
  3. const generateFakerData= require('./exampleFakerController');
  4. run: generateFakerData().