What would be the best way to structure orders for a restaurant (available languages are php and javascript)? Since there are multiple tables (the ones you keep things on...), I thought of using objects in javascript. But I am quite new to javascript and absolutely new to OOP, so I'm not sure whether this is the best solution, and whether my design is actually ok. Here is what I have come up with:
var order = {
id: 0,
table: 0,
number_of_items: 0,
item: {
name: "",
quantity: 0,
unit_price: 0
},
total: 0
};