Add concept waiter section
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
attr = DS.attr
|
||||
App.List = DS.Model.extend
|
||||
state: attr 'string'
|
||||
needs_help: attr 'boolean'
|
||||
needs_payment: attr 'boolean'
|
||||
is_paid: attr 'boolean'
|
||||
has_active_orders: attr 'boolean'
|
||||
price: attr 'number'
|
||||
table_number: attr 'number'
|
||||
table: DS.belongsTo('table', inverse: 'active_list')
|
||||
section: DS.belongsTo('section')
|
||||
section_id: attr('string')
|
||||
@@ -0,0 +1,6 @@
|
||||
attr = DS.attr
|
||||
App.Product = DS.Model.extend
|
||||
name: attr 'string'
|
||||
price: attr 'number'
|
||||
product_category: DS.belongsTo('product_category')
|
||||
product_orders: DS.hasMany('product_order')
|
||||
@@ -0,0 +1,4 @@
|
||||
attr = DS.attr
|
||||
App.ProductCategory = DS.Model.extend
|
||||
name: attr 'string'
|
||||
products: DS.hasMany('product')
|
||||
@@ -0,0 +1,8 @@
|
||||
attr = DS.attr
|
||||
App.ProductOrder = DS.Model.extend
|
||||
quantity: attr 'number', defaultValue: 1
|
||||
product: DS.belongsTo('product')
|
||||
table: DS.belongsTo('table')
|
||||
increment: ->
|
||||
@set('quantity', @get('quantity') + 1)
|
||||
total: (-> @get('quantity') * @get('product.price')).property('quantity')
|
||||
@@ -0,0 +1,6 @@
|
||||
attr = DS.attr
|
||||
App.Section = DS.Model.extend
|
||||
title: attr 'string'
|
||||
width: attr 'number'
|
||||
height: attr 'number'
|
||||
tables: DS.hasMany('table')
|
||||
@@ -0,0 +1,14 @@
|
||||
attr = DS.attr
|
||||
App.Table = DS.Model.extend
|
||||
number: attr 'number'
|
||||
width: attr 'number'
|
||||
height: attr 'number'
|
||||
position_x: attr 'number'
|
||||
position_y: attr 'number'
|
||||
occupied: attr 'boolean'
|
||||
section: DS.belongsTo('section')
|
||||
product_orders: DS.hasMany('product_order')
|
||||
#active_list: DS.belongsTo('list')
|
||||
#active_list: (->
|
||||
#@get('list')
|
||||
#).property('list')
|
||||
Reference in New Issue
Block a user