https://github.com/shahryarjb/supermarket_cashier_assignment
Small supermarket chain with a simple cashier function to add products to a cart and display the total price.
https://github.com/shahryarjb/supermarket_cashier_assignment
assignment elixir protocol
Last synced: 3 months ago
JSON representation
Small supermarket chain with a simple cashier function to add products to a cart and display the total price.
- Host: GitHub
- URL: https://github.com/shahryarjb/supermarket_cashier_assignment
- Owner: shahryarjb
- Created: 2025-01-17T07:26:45.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-01-17T08:41:57.000Z (5 months ago)
- Last Synced: 2025-01-29T04:37:19.926Z (5 months ago)
- Topics: assignment, elixir, protocol
- Language: Elixir
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Sca
This is a practice project for an interview, and thus it is not connected to a database. The data is provided as a list within the test file.
```elixir
def deps do
[
{:sca, github: "shahryarjb/supermarket_cashier_assignment"}
]
end
```### Note
The entire process of this project is based on the following three strategies and consists of three main sections: cart, discount, and promotions. The promotions section functions like a plugin, allowing for easy addition and removal.
Efforts have been made to align the strategies to enable seamless modifications in pricing and quantity without requiring significant code changes.
#### BuyOneGetOneFree
> The CEO is a big fan of buy-one-get-one-free offers and of green tea. He wants us to add a
> rule to do this.#### BulkDiscountFixed
> The COO, though, likes low prices and wants people buying strawberries to get a price
> discount for bulk purchases. If you buy 3 or more strawberries, the price should drop to £4.50
> per strawberry.#### TakeThreePayTwo
> The CTO is a coffee addict. If you buy 3 or more coffees, the price of all coffees should drop
> to two thirds of the original price.