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

Modify current_product_order_id to be unique #44

Closed TimAConner closed 6 years ago

TimAConner commented 6 years ago

Description

This pull request changes current_product_order_id to be unique. Before, because of nested loops, you could have the same id multiple times in a row.

Number of Fixes

This fixes one issue.

Related Ticket(s)

Fixes Issue #38

Problem to Solve

This solved the issue off having duplicate product order ids.

Proposed Changes

Change the ids from being generated from the for loop i value to using a variable outside of the for loop that is incremented each time a product order is created.

Expected Behavior

When you run the function exported by exampleFakerController, the productOrders section should contain a list of unique ids under the product_order_id property.

Steps to Test Solution

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