Files
mozo-backend/app/assets/javascripts/waiter/app/models/supplier.js.coffee
T
2015-03-24 18:40:55 +01:00

29 lines
809 B
CoffeeScript

attr = DS.attr
App.Supplier = DS.Model.extend
name: attr 'string'
email: attr 'string'
time_zone: attr 'string'
address: attr 'string'
house_number: attr 'number'
house_number_addition: attr 'string'
postal_code: attr 'string'
city: attr 'string'
open: attr 'boolean'
country: attr 'string'
facebook_promotion_url: attr 'string'
iens_profile: attr 'string'
lat: attr 'number'
lng: attr 'number'
week_starts_on_monday: attr 'boolean'
product_categories: DS.hasMany 'product_category'
orders_in_process_count: attr('number')
orders_placed_count: attr('number')
close: ->
$.post Routes.mark_as_closed_suppliers_supplier_path(@id), =>
@set 'open', false
open_the_place: ->
$.post Routes.mark_as_open_suppliers_supplier_path(@id), =>
@set 'open', true