mealz's People
Forkers
lewis-fidlersmealz's Issues
Nicknames for a user
So users can pick several names that will link to this user
Canceling a meal
Meals should become canceled:
- Save a canceled_at date
- Recalculate the balance for all users
- Delete wrongly created users (if the user has no mealz left after deleting)
m.users.each do |eater|
eater.balance -= m.amount if eater == m.payed_by
eater.balance += m.amount / m.users.count
eater.save!
end
This could go in a new seperate MealDestroyer
Archiving users
Saving when a user was archived.
- When a user is archived it is no longer counted for in the balances
- Adding a meal with an archived user, unarchives him
Ledgeresque bookkeeping
Do a double bookkeeping system, so keep track of outgoing payments and incoming payments. That way we're always up to date with the balances and calculating them will be a snap.
Things left as an exercise for the reader:
- [] Think of a way to keep track of current balance state
- [] Make code below do actual things
class Mealz
# Van elke user per maaltijd
has_many :incoming_payments
# Winkel en de user die is gaan halen
has_many :outgoing_payments
payment :reason
end
class Payment
belongs_to :user
belongs_to :meal
# amount
# reason
# kind
end
# Bob en Piet eten mee
# Bob is eten halen
OutgoingPayment.new(user: bob, 30, reason: "shopping")
IncomingPayment.new(user: piet, 30/2, reason: "eating")
IncomingPayment.new(user: bob, 30/2, reason: "eating")
Create a meal before in advance
Creating a meal in advance would allow people to subscribe to it.
So a meal would then have many users trough a request, request can have an extra "requests" property.
Saying something like ik eet mee: oude kaas, stokbrood
would create a meal without a payer/amount/... if none exists, or add the request to an already existing meal.
This would need #5 to be done first, so we can cancel a meal if we later on decide not to go.
Setup up Travis
To run all the tests.
Proficiat!
Gewoon getrouwd! Proficiat!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.