It is a script to calculate the aggregated list of purchased products and quantity based on the list of purchased products codes. The main class instance takes two inputs: a list of purchased product codes and a map of mappings for these codes. Then returns the aggregated list.
You can run those functions in you own local environment.
-
Clone the repository by typing:
git clone https://github.com/RaminMammadzada/sku-version-quality-mapper.git
-
Type
./bin/main.rb
in the root file of the project. ( You may need to update file permissions by typingchmod +x bin/main.rb
) -
If you have an issuse related to file permissions, you can also easily type
ruby bin/main.rb
in the root file of the project.
Inputs
List of products: ["CVCD", "SDFD", "DDDF", "SDFD"]
Mappings: {"CVCD": {"version": 1,"edition": "X"},"SDFD": {"version": 2,"edition": "Z"},"DDDF": {"version": 1}}
Expected Output
Purchased items: [{"version":1,"edition":"X","quantity":1},{"version":1,"quantity":1},{"version":2,"edition":"Z","qu antity":2}]
None of the tests added yet. It will be added with Rspec.
👤 Ramin Mammadzada
- Github: @RaminMammadzada
- Twitter: @RaminMammadzada
- Linkedin: @RaminMammadzada
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!