Assuming you have Elixir already installed, run mix deps.get && mix compile in the project folder.
- Run
iex -S mixand alias the store module so it's easier to use the functions:
alias NovicapChallenge.Store
- Load products with json file. They should be stored in
./products. Calling without arguments loads the defaultproducts.jsonfile.
Store.load_products()
- Scan products.
Store.scan("VOUCHER")
- Add rules. Current rules are:
NovicapChallenge.Rules.DoubleVoucherRuleandNovicapChallenge.Rules.ShirtRule.
Store.add_rule(NovicapChallenge.Rules.DoubleVoucherRule)
Store.add_rule(NovicapChallenge.Rules.ShirtRule)
- Check the total.
Store.total
run mix test