Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 791 Bytes

README.md

File metadata and controls

42 lines (27 loc) · 791 Bytes

NovicapChallenge Store

Install

Assuming you have Elixir already installed, run mix deps.get && mix compile in the project folder.

Usage

  1. Run iex -S mix and alias the store module so it's easier to use the functions:
alias NovicapChallenge.Store
  1. Load products with json file. They should be stored in ./products. Calling without arguments loads the default products.json file.
Store.load_products()
  1. Scan products.
Store.scan("VOUCHER")
  1. Add rules. Current rules are: NovicapChallenge.Rules.DoubleVoucherRule and NovicapChallenge.Rules.ShirtRule.
Store.add_rule(NovicapChallenge.Rules.DoubleVoucherRule)
Store.add_rule(NovicapChallenge.Rules.ShirtRule)
  1. Check the total.
Store.total

Tests

run mix test