Skip to content

pietrofxq/elixir-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages