@yteruel31/place_order

1.0.4 • Public • Published

Stockfiller assignment

This is a simple CLI application that permit to follow their stock.

Context

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

How to run the CLI

To run the application, you need to have minimum Node.js 18 installed on your machine. You can use nvm use.

  1. Install the dependencies:
yarn install
  1. Run the application:
yarn dev
  1. Create a symlink to the CLI:
npm link
  1. Run the CLI:
place_order {supplierId} {productIds}

Readme

Keywords

none

Package Sidebar

Install

npm i @yteruel31/place_order

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

12.5 kB

Total Files

13

Last publish

Collaborators

  • yteruel31