Skip to content

thanikkal/rfidash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfidash

Sample JSON:

{"section":"boy","name":"Adidas undergarments","type":"XXL","quantity":23,"itemid":10}

Server:

Inventory Simulator

We want to generate fake data. Only the quantity will change at this point. At this point the server just changes the quantity at random times. It will usually just decrease quantity.

The simulator will have a series of preset defaults. We will assume:

  • random stock (60%) will get depleted at a gradual constant level (random from 5-10 minutes) by a random number (1-10)
  • stock will get replenished periodically (for those that are depleted)

Methods of simulator.js

sections = [men, women, girls, boys, kids, babies] // (for now)
init() // generates a list of 100 random items in the redis client
getItems() 	// returns a list of items (see object above)
addItem() // - adds a new item to the list (randomly generated for now)
deleteItem(itemId) // deletes the item with the item id
addInventory(itemid, num) // add inventory to item by #num
decreaseInventory(itemid, num) // decrement inventory to item by #num

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.0%
  • Ruby 6.0%