Skip to content

ktatomir/monteszama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monteszama

Simple application to improve food ordering process in company full of hungry developers :)

Requirements/flow:

  • sign in with GitHub account

  • signed in user can add an order (with description like ‘chinese’, ‘pizza’)

  • permalink is generated after creating an order

  • after entering the permalink, one can add only one item (name and price)

  • the order owner can close it (and only him/her)

  • after closing order, a person to call the restaurant is chosen randomly

  • if the order is closed, everyone can see the summary: who order what and for how much

  • orders history is public

  • remember/add who paid and how much

  • tests! rspec/minitest

  • cucumber as super hyper plus

  • layout on bootstrap is enough

  • deployment on heroku

My idea for the solution

M is for model

Order

  • id (int)

  • desc (string/text)

  • owner_id (int) [index]

  • caller_id (int) [index]

belongs_to owner (class user), has_one caller (class user), has_many items, has_many payments

Item

  • id (int)

  • name (string)

  • price (float)

  • order_id (int) [index]

  • user_id (int) [index]

constraint on order_id, user_id !!!

belongs_to order, belongs_to user

User

  • id (int)

  • login (string)

  • email (string)

has_many orders, has_many items, has_many payments

Payment

  • id (int)

  • order_id (int) [index]

  • user_id (int) [index]

constraint on order_id, user_id

belongs_to order, belongs_to user

Some additional informations

  • order history is set as root. If user is not logged in, he/she can do nothing but watch (a little creepy choose of words?)

  • user logged in can create new order or enter a link sent by order owner

  • WARNING!: if user is logged in and he/she received link to an closed order, he/she won’t be able to view it. Closed orders are so called ‘summary’ and are available only for users that added item to it (+ order owner can see it of course)

  • payments are added at the end, only owner can add them

  • if order item list is empty and order owner closes it, he/she will be automaticaly choose as caller (I thought it’s better that way, but I might be wrong here)

  • test are ummm… not very complicated. I did only model tests, as my Internet connection gives me the creeps and I can barely work with it (hotspoting from phone is not a very good solution)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published