Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

takeaway-challenge #2234

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 41 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,54 @@ Takeaway Challenge

```

Instructions
Status -> Work in Progress
-------

* Feel free to use google, your notes, books, etc. but work on your own
* If you refer to the solution of another coach or student, please put a link to that in your README
* If you have a partial solution, **still check in a partial solution**
* You must submit a pull request to this repo with your code by 9am Monday morning
* takeaway currently doesn't allow dishes to be deleted from order -> needs to be updated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good idea - wish I'd thought of this!

* takeaway currently doesn't check for availability -> needs to be updated
* sms function currently not working
* classes need restructuring
* tests need updating
* rafactoring needed

Navigate
-----

```
laura@Lauras-Air takeaway-challenge % irb
=>
#<TakeAway:0x000000014fa299f0
...
3.0.2 :002 > take.view_menu
["1. Mattar Paneer £12.5",
"2. Black Daal £7.5",
"3. Raita £3.5",
"4. Garlic Naan £3.5"]
3.0.2 :003 > take.add_dish(1, 1)
=> ["1 x Mattar Paneer £12.5/each, has been added to your order -> £[12.5]"]
3.0.2 :004 > take.add_dish(2, 1)
=> ["1 x Black Daal £7.5/each, has been added to your order -> £[7.5]"]
3.0.2 :005 > take.add_dish(4, 1)
=> ["1 x Garlic Naan £3.5/each, has been added to your order -> £[3.5]"]
3.0.2 :006 > take.add_dish(4, 2)
=> ["2 x Garlic Naan £3.5/each, has been added to your order -> £[7.0]"]
3.0.2 :007 > take.add_dish(2, 1)
=> ["1 x Black Daal £7.5/each, has been added to your order -> £[7.5]"]
3.0.2 :008 > take.view_basket
=>
["1 x Mattar Paneer £12.5/each -> £[12.5]",
"2 x Black Daal £7.5/each -> £15.0",
"3 x Garlic Naan £3.5/each -> £10.5"]
3.0.2 :009 > take.order_total
=> "Your order total is £38.0"
```

Task
-----

* Fork this repo
* Run the command 'bundle' in the project directory to ensure you have all the gems
* Write a Takeaway program with the following user stories:
* Takeaway program with the following user stories:

```
As a customer
Expand All @@ -45,39 +79,4 @@ I would like to check that the total I have been given matches the sum of the va
As a customer
So that I am reassured that my order will be delivered on time
I would like to receive a text such as "Thank you! Your order was placed and will be delivered before 18:52" after I have ordered
```

* Hints on functionality to implement:
* Ensure you have a list of dishes with prices
* The text should state that the order was placed successfully and that it will be delivered 1 hour from now, e.g. "Thank you! Your order was placed and will be delivered before 18:52".
* The text sending functionality should be implemented using Twilio API. You'll need to register for it. It’s free.
* Use the twilio-ruby gem to access the API
* Use the Gemfile to manage your gems
* Make sure that your Takeaway is thoroughly tested and that you use mocks and/or stubs, as necessary to not to send texts when your tests are run
* However, if your Takeaway is loaded into IRB and the order is placed, the text should actually be sent
* Note that you can only send texts in the same country as you have your account. I.e. if you have a UK account you can only send to UK numbers.

* Advanced! (have a go if you're feeling adventurous):
* Implement the ability to place orders via text message.

* A free account on Twilio will only allow you to send texts to "verified" numbers. Use your mobile phone number, don't worry about the customer's mobile phone.

> :warning: **WARNING:** think twice before you push your **mobile number** or **Twilio API Key** to a public space like GitHub :eyes:
>
> :key: Now is a great time to think about security and how you can keep your private information secret. You might want to explore environment variables.

* Finally submit a pull request before Monday at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday at 9am


In code review we'll be hoping to see:

* All tests passing
* High [Test coverage](https://github.com/makersacademy/course/blob/main/pills/test_coverage.md) (>95% is good)
* The code is elegant: every class has a clear responsibility, methods are short etc.

Reviewers will potentially be using this [code review rubric](docs/review.md). Referring to this rubric in advance will make the challenge somewhat easier. You should be the judge of how much challenge you want this at this moment.

Notes on Test Coverage
------------------

You can see your [test coverage](https://github.com/makersacademy/course/blob/main/pills/test_coverage.md) when you run your tests.
```