This is a simple CLI application that permit to follow their stock.
At Stockfiller the ability to place orders is a key feature for the survival of the company. Therefore it is your job to make sure that Stockfiller can run its business by completing this task. Create a program that can be executed in the terminal called place_order . Execute the program like this:
place_order {supplierId} {productIds}
The arguments to the program is:
- supplierId - A 6 character string
- productIds - A comma separated list of 6 character string
You must store all suppliers and what products they have in their assortment. There must be at least three suppliers each having at least three products. Each product must have at least an ID and a name. The program must check if the combination of supplier ID and product IDs are valid and print to standard output:
- OK {productNames} where productNames is a comma separated list of product names
- FAIL {error} where error can be either NO_SUPPLIER or NO_PRODUCT
To run the application, you need to have minimum Node.js 18
installed on your machine. You can use nvm use
.
- Install the dependencies:
yarn install
- Run the application:
yarn dev
- Create a symlink to the CLI:
npm link
- Run the CLI:
place_order {supplierId} {productIds}